diff options
author | Timothy Pearson <[email protected]> | 2019-03-07 16:41:51 -0600 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-03-08 02:43:24 +0100 |
commit | 23d8a034c7106ed2800ddc6618ab44d3c1c3224e (patch) | |
tree | dfadde0d608d440417e07d3b1fe7161b2dfca98d /src | |
parent | ce77911fa5981bdd7965f8d8aad7632a7aa35f7b (diff) | |
download | libtdeldap-23d8a034c7106ed2800ddc6618ab44d3c1c3224e.tar.gz libtdeldap-23d8a034c7106ed2800ddc6618ab44d3c1c3224e.zip |
Properly set umask on login
(cherry picked from commit 10472c4c2b98b22c0d8309e3f21ae2df32a6538a)
Diffstat (limited to 'src')
-rw-r--r-- | src/libtdeldap.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp index 70b9c15..e1a2d3c 100644 --- a/src/libtdeldap.cpp +++ b/src/libtdeldap.cpp @@ -4108,6 +4108,9 @@ int LDAPManager::writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr) { if (file3.open(IO_WriteOnly)) { TQTextStream stream( &file3 ); + char modestring[8]; + sprintf(modestring, "%04o", pamConfig.autocreate_user_directories_umask); + stream << "# This file was automatically generated by TDE\n"; stream << "# All changes will be lost!\n"; stream << "\n"; @@ -4116,9 +4119,8 @@ int LDAPManager::writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr) { stream << "session required pam_permit.so" << "\n"; stream << "session required pam_unix.so" << "\n"; stream << "session optional pam_ck_connector.so nox11" << "\n"; + stream << "session optional pam_umask.so usergroups umask=" << modestring << "\n"; if (pamConfig.autocreate_user_directories_enable) { - char modestring[8]; - sprintf(modestring, "%04o", pamConfig.autocreate_user_directories_umask); TQString skelstring; if (pamConfig.autocreate_user_directories_skel != "") { skelstring = " skel=" + pamConfig.autocreate_user_directories_skel; |