Create the PKCS#11 configuration directory if it does not exist before attempting to write the configuration file into it

pull/1/head
Timothy Pearson 8 years ago
parent e7fe109b39
commit 1ccfd00cd4

@ -5136,6 +5136,14 @@ int LDAPManager::writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr) {
}
if (pamConfig.enable_pkcs11_login) {
TQDir pkcs11dir(PAMD_PKCS11_CONFIG_DIRECTORY);
if (!pkcs11dir.exists()) {
if (mkdir(PAMD_PKCS11_CONFIG_DIRECTORY, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) < 0) {
if (errstr) {
*errstr = i18n("Could not create directoy '%1'").arg(PAMD_PKCS11_CONFIG_DIRECTORY);
}
}
}
TQFile file4(PAMD_PKCS11_CONFIG_DIRECTORY PAMD_PKCS11_CONFIG_FILE);
if (file4.open(IO_WriteOnly)) {
TQTextStream stream( &file4 );

Loading…
Cancel
Save