Set proper permissions on root certificate files

pull/1/head
Timothy Pearson 12 years ago
parent f101efbd4d
commit 1e9b683727

@ -2643,7 +2643,7 @@ LDAPTDEBuiltinsInfo LDAPManager::getTDEBuiltinMappings(TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
builtininfo = parseLDAPTDEBuiltinsRecord(entry);
}
// clean up
ldap_msgfree(msg);
@ -2695,7 +2695,14 @@ int LDAPManager::getTDECertificate(TQString certificateName, TQString fileName,
TQByteArray ba;
ba.duplicate(vals[i]->bv_val, vals[i]->bv_len);
file.writeBlock(ba);
returncode = 0;
file.close();
if (chmod(fileName.ascii(), S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) {
if (errstr) *errstr = i18n("Unable to change permissions of \"%1\"").arg(fileName.ascii());
returncode = -1;
}
else {
returncode = 0;
}
}
}
ldap_value_free_len(vals);
@ -2707,7 +2714,7 @@ int LDAPManager::getTDECertificate(TQString certificateName, TQString fileName,
ber_free(ber, 0);
}
}
// clean up
ldap_msgfree(msg);

Loading…
Cancel
Save