Properly set umask on login

(cherry picked from commit 10472c4c2b)
r14.0.x
Timothy Pearson 6 years ago committed by Slávek Banko
parent ce77911fa5
commit 23d8a034c7
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -4108,6 +4108,9 @@ int LDAPManager::writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr) {
if (file3.open(IO_WriteOnly)) { if (file3.open(IO_WriteOnly)) {
TQTextStream stream( &file3 ); TQTextStream stream( &file3 );
char modestring[8];
sprintf(modestring, "%04o", pamConfig.autocreate_user_directories_umask);
stream << "# This file was automatically generated by TDE\n"; stream << "# This file was automatically generated by TDE\n";
stream << "# All changes will be lost!\n"; stream << "# All changes will be lost!\n";
stream << "\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_permit.so" << "\n";
stream << "session required pam_unix.so" << "\n"; stream << "session required pam_unix.so" << "\n";
stream << "session optional pam_ck_connector.so nox11" << "\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) { if (pamConfig.autocreate_user_directories_enable) {
char modestring[8];
sprintf(modestring, "%04o", pamConfig.autocreate_user_directories_umask);
TQString skelstring; TQString skelstring;
if (pamConfig.autocreate_user_directories_skel != "") { if (pamConfig.autocreate_user_directories_skel != "") {
skelstring = " skel=" + pamConfig.autocreate_user_directories_skel; skelstring = " skel=" + pamConfig.autocreate_user_directories_skel;

Loading…
Cancel
Save