diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-21 00:59:14 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-21 00:59:14 -0500 |
commit | 074b7ac197af8d27009ca85b82369b2482b48b3f (patch) | |
tree | 8bbebc7f58d46d18f9508ee0527f48ee49429dd5 /src | |
parent | bb72c681df66c174f16ed8a1a3502a9892034ef2 (diff) | |
download | kcmldap-074b7ac197af8d27009ca85b82369b2482b48b3f.tar.gz kcmldap-074b7ac197af8d27009ca85b82369b2482b48b3f.zip |
Add crontab entry
Diffstat (limited to 'src')
-rw-r--r-- | src/ldap.cpp | 18 | ||||
-rw-r--r-- | src/ldap.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/ldap.cpp b/src/ldap.cpp index 31b2b0c..1e8356f 100644 --- a/src/ldap.cpp +++ b/src/ldap.cpp @@ -59,6 +59,7 @@ #define PAMD_DIRECTORY "/etc/pam.d/" #define PAMD_COMMON_ACCOUNT "common-account" #define PAMD_COMMON_AUTH "common-auth" +#define CRON_UPDATE_NSS_FILE "/etc/cron.daily/upd-local-nss-db" #define DEFAULT_IGNORED_USERS_LIST "avahi,avahi-autoipd,backup,bin,colord,daemon,games,gnats,haldaemon,hplip,irc,klog,landscape,libuuid,list,lp,mail,man,messagebus,news,ntp,polkituser,postfix,proxy,pulse,root,rtkit,saned,sshd,statd,sync,sys,syslog,timidity,usbmux,uucp,www-data" typedef KGenericFactory<LDAPConfig, TQWidget> ldapFactory; @@ -345,6 +346,8 @@ void LDAPConfig::save() { writeNSSwitchFile(); // Write the PAM configuration files writePAMFiles(); + // Write the cron files + writeCronFiles(); } load(); @@ -742,6 +745,21 @@ void LDAPConfig::writePAMFiles() { } } +void LDAPConfig::writeCronFiles() { + TQFile file(CRON_UPDATE_NSS_FILE); + if (file.open(IO_WriteOnly)) { + TQTextStream stream( &file ); + + stream << "# This file was automatically generated by TDE\n"; + stream << "# All changes will be lost!\n"; + stream << "\n"; + stream << "#!/bin/sh" << "\n"; + stream << "/usr/sbin/nss_updatedb ldap" << "\n"; + + file.close(); + } +} + int LDAPConfig::buttons() { return KCModule::Apply|KCModule::Help; } @@ -95,6 +95,7 @@ class LDAPConfig: public KCModule void writeLDAPConfFile(); void writeNSSwitchFile(); void writePAMFiles(); + void writeCronFiles(); private: KAboutData *myAboutData; |