|
|
@ -4121,6 +4121,10 @@ int LDAPManager::getTDECertificate(TQString certificateName, TQFile *fileHandle,
|
|
|
|
TQByteArray ba;
|
|
|
|
TQByteArray ba;
|
|
|
|
returncode = getTDECertificate(certificateName, &ba, errstr);
|
|
|
|
returncode = getTDECertificate(certificateName, &ba, errstr);
|
|
|
|
if (returncode == 0) {
|
|
|
|
if (returncode == 0) {
|
|
|
|
|
|
|
|
if (fileHandle->isOpen()) {
|
|
|
|
|
|
|
|
printf("[WARNING] File \"%s\" was already open, closing...\n");
|
|
|
|
|
|
|
|
fileHandle->close();
|
|
|
|
|
|
|
|
}
|
|
|
|
if (fileHandle->open(IO_WriteOnly)) {
|
|
|
|
if (fileHandle->open(IO_WriteOnly)) {
|
|
|
|
fileHandle->writeBlock(ba);
|
|
|
|
fileHandle->writeBlock(ba);
|
|
|
|
fileHandle->close();
|
|
|
|
fileHandle->close();
|
|
|
@ -4592,7 +4596,7 @@ int LDAPManager::generateClientCertificatePrivateKey(TQString privateKeyFile, in
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (chown(client_keyfile.ascii(), 0, 0) < 0) {
|
|
|
|
if (chown(client_keyfile.ascii(), 0, 0) < 0) {
|
|
|
|
printf("[WARNING] Unable to change owner of \"%s\"", client_keyfile.ascii());
|
|
|
|
printf("[WARNING] Unable to change owner of \"%s\"\n", client_keyfile.ascii());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Clean up
|
|
|
|
// Clean up
|
|
|
@ -4652,7 +4656,7 @@ int LDAPManager::generateClientCertificatePublicCertificate(int expirydays, LDAP
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (chown(client_certfile.ascii(), 0, 0) < 0) {
|
|
|
|
if (chown(client_certfile.ascii(), 0, 0) < 0) {
|
|
|
|
printf("[WARNING] Unable to change owner of \"%s\"", client_certfile.ascii());
|
|
|
|
printf("[WARNING] Unable to change owner of \"%s\"\n", client_certfile.ascii());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Clean up
|
|
|
|
// Clean up
|
|
|
|