/************** NSSCONF License: Linuxconf/GPL (see the file COPYING for details) Author: Stein Vråle ***************/ #include "ldapconf_defs.h" /* NSS config */ void nss_config() { /* Init config*/ SSTRING nss_passwd="files"; SSTRING nss_group="files"; SSTRING nss_shadow="files"; SSTRING nss_hosts="files"; SSTRING nss_services="files"; SSTRING nss_networks="files"; SSTRING nss_protocols="files"; SSTRING nss_rpc="files"; SSTRING nss_ethers="files"; SSTRING nss_netmasks="files"; SSTRING nss_bootparams="files"; SSTRING nss_publickey="files"; SSTRING nss_automount="files"; SSTRING nss_aliases="files"; SSTRING nss_sendmailvars="files"; SSTRING nss_netgroup="files"; /* Read config */ VIEWITEMS v_nss_conf; v_nss_conf.read (f_nss_conf); nss_passwd.setfrom (get_keyval(v_nss_conf,"passwd:")); nss_group.setfrom (get_keyval(v_nss_conf,"group:")); nss_shadow.setfrom (get_keyval(v_nss_conf,"shadow:")); nss_hosts.setfrom (get_keyval(v_nss_conf,"hosts:")); nss_services.setfrom (get_keyval(v_nss_conf,"services:")); nss_networks.setfrom (get_keyval(v_nss_conf,"networks:")); nss_protocols.setfrom (get_keyval(v_nss_conf,"protocols:")); nss_rpc.setfrom (get_keyval(v_nss_conf,"rpc:")); nss_ethers.setfrom (get_keyval(v_nss_conf,"ethers:")); nss_netmasks.setfrom (get_keyval(v_nss_conf,"netmasks:")); nss_bootparams.setfrom (get_keyval(v_nss_conf,"bootparams:")); nss_publickey.setfrom (get_keyval(v_nss_conf,"publickey:")); nss_automount.setfrom (get_keyval(v_nss_conf,"automount:")); nss_aliases.setfrom (get_keyval(v_nss_conf,"aliases:")); nss_sendmailvars.setfrom (get_keyval(v_nss_conf,"sendmailvars:")); nss_netgroup.setfrom (get_keyval(v_nss_conf,"netgroup:")); /* Dialog */ DIALOG dia; dia.newf_str (MSG_U(F_NSS_PASSWD,"passwd"), nss_passwd); dia.newf_str (MSG_U(F_NSS_GROUP,"group"), nss_group); dia.newf_str (MSG_U(F_NSS_SHADOW,"shadow"), nss_shadow); dia.newf_str (MSG_U(F_NSS_HOSTS,"hosts"), nss_hosts); dia.newf_str (MSG_U(F_NSS_SERVICES,"services"),nss_services); dia.newf_str (MSG_U(F_NSS_NETWORKS,"networks"),nss_networks); dia.newf_str (MSG_U(F_NSS_PROTOCOLS,"protocols"), nss_protocols); dia.newf_str (MSG_U(F_NSS_RPC,"rpc"), nss_rpc); dia.newf_str (MSG_U(F_NSS_ETHERS,"ethers"),nss_ethers); dia.newf_str (MSG_U(F_NSS_NETMASK,"netmask"), nss_netmasks); dia.newf_str (MSG_U(F_NSS_BOOTPARAMS,"bootparams"),nss_bootparams); dia.newf_str (MSG_U(F_NSS_PUBLICKEY,"publickey"), nss_publickey); dia.newf_str (MSG_U(F_NSS_AUTOMOUNT,"automount"), nss_automount); dia.newf_str (MSG_U(F_NSS_ALIASES,"aliases"), nss_aliases); dia.newf_str (MSG_U(F_NSS_SENDMAILVARS,"sendmailvars"), nss_sendmailvars); dia.newf_str (MSG_U(F_NSS_NETGROUP,"netgroup"), nss_netgroup); int nof = 0; while (1){ MENU_STATUS code = dia.edit (MSG_U(T_NSS_CONFIG,"NSS configuration") ,MSG_U(I_NSS_CONFIG ,"This is the current NSS settings") ,help_ldap ,nof ,MENUBUT_ACCEPT|MENUBUT_CANCEL); if (code == MENU_CANCEL || code == MENU_ESCAPE){ break; } /* Save */ else if (code == MENU_ACCEPT){ set_keyval(v_nss_conf,"passwd:",nss_passwd.get()); set_keyval(v_nss_conf,"group:",nss_group.get()); set_keyval(v_nss_conf,"shadow:",nss_shadow.get()); set_keyval(v_nss_conf,"hosts:",nss_hosts.get()); set_keyval(v_nss_conf,"services:",nss_services.get()); set_keyval(v_nss_conf,"networks:",nss_networks.get()); set_keyval(v_nss_conf,"protocols:",nss_protocols.get()); set_keyval(v_nss_conf,"rpc:",nss_rpc.get()); set_keyval(v_nss_conf,"ethers:",nss_ethers.get()); set_keyval(v_nss_conf,"netmasks:",nss_netmasks.get()); set_keyval(v_nss_conf,"bootparams:",nss_bootparams.get()); set_keyval(v_nss_conf,"publickey:",nss_publickey.get()); set_keyval(v_nss_conf,"automount:",nss_automount.get()); set_keyval(v_nss_conf,"aliases:",nss_aliases.get()); set_keyval(v_nss_conf,"sendmailsvars:",nss_sendmailvars.get()); set_keyval(v_nss_conf,"netgroup:",nss_netgroup.get()); v_nss_conf.write (f_nss_conf,&p_ldap_admin); break; } } }