|
|
|
@ -50,13 +50,13 @@
|
|
|
|
|
#define LDAP_INSECURE_PORT 389
|
|
|
|
|
#define LDAP_SECURE_PORT 636
|
|
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
// Connect this to CMake/Automake
|
|
|
|
|
#ifndef KDE_CONFDIR
|
|
|
|
|
#define KDE_CONFDIR "/etc/trinity"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
// This assumes Debian!
|
|
|
|
|
#ifndef KRB5_FILE
|
|
|
|
|
#define KRB5_FILE "/etc/krb5.conf"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define NSSWITCH_FILE "/etc/nsswitch.conf"
|
|
|
|
|
|
|
|
|
@ -74,9 +74,9 @@
|
|
|
|
|
#define CRON_UPDATE_NSS_FILE "/etc/cron.daily/upd-local-nss-db"
|
|
|
|
|
#define CRON_UPDATE_NSS_COMMAND "/usr/sbin/nss_updatedb ldap"
|
|
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
// This assumes Debian!
|
|
|
|
|
#ifndef CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND
|
|
|
|
|
#define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND "/etc/init.d/slapd force-reload"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int requested_ldap_version = LDAP_VERSION3;
|
|
|
|
|
char* ldap_user_and_operational_attributes[2] = {"*", "+"};
|
|
|
|
@ -317,12 +317,16 @@ int LDAPManager::bind(TQString* errstr) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
// All done!
|
|
|
|
|
ldap_unbind_ext_s(ldapconn, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_unbind_ext_s(ldapconn, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -655,7 +659,7 @@ LDAPUserInfoList LDAPManager::users(int* mretcode, TQString *errstr) {
|
|
|
|
|
users.append(parseLDAPUserRecord(entry));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
if (mretcode) *mretcode = 0;
|
|
|
|
@ -733,7 +737,7 @@ LDAPUserInfoList LDAPManager::users(int* mretcode, TQString *errstr) {
|
|
|
|
|
users.append(parseLDAPUserRecord(entry));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
} while (morePages);
|
|
|
|
|
|
|
|
|
@ -766,7 +770,7 @@ LDAPUserInfo LDAPManager::getUserByDistinguishedName(TQString dn) {
|
|
|
|
|
userinfo = parseLDAPUserRecord(entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return userinfo;
|
|
|
|
@ -797,7 +801,7 @@ LDAPGroupInfo LDAPManager::getGroupByDistinguishedName(TQString dn, TQString *er
|
|
|
|
|
groupinfo = parseLDAPGroupRecord(entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return groupinfo;
|
|
|
|
@ -1054,14 +1058,14 @@ int LDAPManager::setPasswordForUser(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
|
TQCString command = "kadmin";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
if (m_host.startsWith("ldapi://")) {
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (admincreds.username == "") {
|
|
|
|
|
args << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
args << TQCString("-p") << TQCString(admincreds.username.lower()+"@"+(admincreds.realm.upper())) << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-p") << TQString("%1@%2").arg(admincreds.username.lower()).arg(admincreds.realm.upper()).local8Bit() << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1071,7 +1075,7 @@ int LDAPManager::setPasswordForUser(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
|
prompt = readFullLineFromPtyProcess(&kadminProc);
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
if (prompt == "kadmin>") {
|
|
|
|
|
command = TQCString("passwd "+user.name);
|
|
|
|
|
command = TQCString("passwd ")+user.name.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -1109,7 +1113,7 @@ int LDAPManager::setPasswordForUser(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
|
TQFile file;
|
|
|
|
|
file.open(IO_ReadOnly, stdin);
|
|
|
|
|
TQTextStream qtin(&file);
|
|
|
|
|
admincreds.password = qtin.readLine();
|
|
|
|
|
admincreds.password = qtin.readLine().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (admincreds.password != "") {
|
|
|
|
@ -1156,8 +1160,8 @@ TQString klistDateTimeToRFCDateTime(TQString datetime) {
|
|
|
|
|
// HACK HACK HACK
|
|
|
|
|
// FIXME
|
|
|
|
|
TQString ret;
|
|
|
|
|
TQString command = TQString("date -R -d \"%1\"").arg(datetime);
|
|
|
|
|
FILE *output = popen(command.ascii(), "r");
|
|
|
|
|
TQCString command = TQString("date -R -d \"%1\"").arg(datetime).local8Bit();
|
|
|
|
|
FILE *output = popen(command, "r");
|
|
|
|
|
TQFile f;
|
|
|
|
|
f.open(IO_ReadOnly, output);
|
|
|
|
|
TQTextStream stream(&f);
|
|
|
|
@ -1422,10 +1426,10 @@ int LDAPManager::obtainKerberosTicket(LDAPCredentials creds, TQString principal,
|
|
|
|
|
TQCString command = "kinit";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
if (principal == "") {
|
|
|
|
|
args << TQCString(creds.username + "@" + creds.realm.upper());
|
|
|
|
|
args << TQString("%1@%2").arg(creds.username).arg(creds.realm.upper()).local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
args << TQCString("-S") << TQCString(principal) << TQCString(creds.username + "@" + creds.realm.upper());
|
|
|
|
|
args << TQCString("-S") << principal.local8Bit() << TQString("%1@%2").arg(creds.username).arg(creds.realm.upper()).local8Bit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString prompt;
|
|
|
|
@ -1453,8 +1457,8 @@ int LDAPManager::obtainKerberosTicket(LDAPCredentials creds, TQString principal,
|
|
|
|
|
|
|
|
|
|
int LDAPManager::obtainKerberosServiceTicket(TQString principal, TQString *errstr) {
|
|
|
|
|
TQString ret;
|
|
|
|
|
TQString command = TQString("kgetcred \"%1\"").arg(principal);
|
|
|
|
|
FILE *output = popen(command.ascii(), "r");
|
|
|
|
|
TQCString command = TQString("kgetcred \"%1\"").arg(principal).local8Bit();
|
|
|
|
|
FILE *output = popen(command, "r");
|
|
|
|
|
TQFile f;
|
|
|
|
|
f.open(IO_ReadOnly, output);
|
|
|
|
|
TQTextStream stream(&f);
|
|
|
|
@ -1471,8 +1475,8 @@ int LDAPManager::obtainKerberosServiceTicket(TQString principal, TQString *errst
|
|
|
|
|
|
|
|
|
|
int LDAPManager::destroyKerberosTicket(TQString principal, TQString *errstr) {
|
|
|
|
|
TQString ret;
|
|
|
|
|
TQString command = TQString("kdestroy --credential=\"%1\"").arg(principal);
|
|
|
|
|
FILE *output = popen(command.ascii(), "r");
|
|
|
|
|
TQCString command = TQString("kdestroy --credential=\"%1\"").arg(principal).local8Bit();
|
|
|
|
|
FILE *output = popen(command, "r");
|
|
|
|
|
TQFile f;
|
|
|
|
|
f.open(IO_ReadOnly, output);
|
|
|
|
|
TQTextStream stream(&f);
|
|
|
|
@ -1683,14 +1687,14 @@ int LDAPManager::addMachineInfo(LDAPMachineInfo machine, TQString *errstr) {
|
|
|
|
|
TQCString command = "kadmin";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
if (m_host.startsWith("ldapi://")) {
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (admincreds.username == "") {
|
|
|
|
|
args << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
args << TQCString("-p") << TQCString(admincreds.username.lower()+"@"+(admincreds.realm.upper())) << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-p") << TQString("%1@%2").arg(admincreds.username.lower()).arg(admincreds.realm.upper()).local8Bit() << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1703,10 +1707,10 @@ int LDAPManager::addMachineInfo(LDAPMachineInfo machine, TQString *errstr) {
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
if (prompt == "kadmin>") {
|
|
|
|
|
if (machine.newPassword == "") {
|
|
|
|
|
command = TQCString("ank --random-key "+hoststring);
|
|
|
|
|
command = TQCString("ank --random-key ")+hoststring.local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
command = TQCString("ank --password=\""+machine.newPassword+"\" "+hoststring);
|
|
|
|
|
command = TQCString("ank --password=\"")+machine.newPassword.local8Bit()+TQCString("\" ")+hoststring.local8Bit();
|
|
|
|
|
}
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
@ -1730,7 +1734,7 @@ int LDAPManager::addMachineInfo(LDAPMachineInfo machine, TQString *errstr) {
|
|
|
|
|
TQFile file;
|
|
|
|
|
file.open(IO_ReadOnly, stdin);
|
|
|
|
|
TQTextStream qtin(&file);
|
|
|
|
|
admincreds.password = qtin.readLine();
|
|
|
|
|
admincreds.password = qtin.readLine().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (admincreds.password != "") {
|
|
|
|
@ -1758,7 +1762,7 @@ int LDAPManager::addMachineInfo(LDAPMachineInfo machine, TQString *errstr) {
|
|
|
|
|
leftbracket++;
|
|
|
|
|
defaultParam = prompt.mid(leftbracket, rightbracket-leftbracket);
|
|
|
|
|
}
|
|
|
|
|
command = TQCString(defaultParam);
|
|
|
|
|
command = defaultParam.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -1808,14 +1812,14 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) {
|
|
|
|
|
TQCString command = "kadmin";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
if (m_host.startsWith("ldapi://")) {
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (admincreds.username == "") {
|
|
|
|
|
args << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
args << TQCString("-p") << TQCString(admincreds.username.lower()+"@"+(admincreds.realm.upper())) << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-p") << TQString("%1@%2").arg(admincreds.username.lower()).arg(admincreds.realm.upper()).local8Bit() << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1827,7 +1831,7 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) {
|
|
|
|
|
prompt = readFullLineFromPtyProcess(&kadminProc);
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
if (prompt == "kadmin>") {
|
|
|
|
|
command = TQCString("ank --random-key "+hoststring);
|
|
|
|
|
command = TQCString("ank --random-key ")+hoststring.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -1850,7 +1854,7 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) {
|
|
|
|
|
TQFile file;
|
|
|
|
|
file.open(IO_ReadOnly, stdin);
|
|
|
|
|
TQTextStream qtin(&file);
|
|
|
|
|
admincreds.password = qtin.readLine();
|
|
|
|
|
admincreds.password = qtin.readLine().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (admincreds.password != "") {
|
|
|
|
@ -1878,7 +1882,7 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) {
|
|
|
|
|
leftbracket++;
|
|
|
|
|
defaultParam = prompt.mid(leftbracket, rightbracket-leftbracket);
|
|
|
|
|
}
|
|
|
|
|
command = TQCString(defaultParam);
|
|
|
|
|
command = defaultParam.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -2205,7 +2209,7 @@ LDAPGroupInfoList LDAPManager::groups(int* mretcode, TQString *errstr) {
|
|
|
|
|
groups.append(parseLDAPGroupRecord(entry));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
if (mretcode) *mretcode = 0;
|
|
|
|
@ -2283,7 +2287,7 @@ LDAPGroupInfoList LDAPManager::groups(int* mretcode, TQString *errstr) {
|
|
|
|
|
groups.append(parseLDAPGroupRecord(entry));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
} while (morePages);
|
|
|
|
|
|
|
|
|
@ -2326,7 +2330,7 @@ LDAPMachineInfoList LDAPManager::machines(int* mretcode, TQString *errstr) {
|
|
|
|
|
machines.append(parseLDAPMachineRecord(entry));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
if (mretcode) *mretcode = 0;
|
|
|
|
@ -2404,7 +2408,7 @@ LDAPMachineInfoList LDAPManager::machines(int* mretcode, TQString *errstr) {
|
|
|
|
|
machines.append(parseLDAPMachineRecord(entry));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
} while (morePages);
|
|
|
|
|
|
|
|
|
@ -2486,7 +2490,7 @@ LDAPServiceInfoList LDAPManager::machineServices(TQString machine_dn, int* mretc
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
if (mretcode) *mretcode = 0;
|
|
|
|
@ -2515,14 +2519,14 @@ int LDAPManager::exportKeytabForPrincipal(TQString principal, TQString fileName,
|
|
|
|
|
TQCString command = "kadmin";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
if (m_host.startsWith("ldapi://")) {
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-l") << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (admincreds.username == "") {
|
|
|
|
|
args << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
args << TQCString("-p") << TQCString(admincreds.username.lower()+"@"+(admincreds.realm.upper())) << TQCString("-r") << TQCString(admincreds.realm.upper());
|
|
|
|
|
args << TQCString("-p") << TQString("%1@%2").arg(admincreds.username.lower()).arg(admincreds.realm.upper()).local8Bit() << TQCString("-r") << admincreds.realm.upper().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2533,10 +2537,10 @@ int LDAPManager::exportKeytabForPrincipal(TQString principal, TQString fileName,
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
if (prompt == "kadmin>") {
|
|
|
|
|
if (fileName == "") {
|
|
|
|
|
command = TQCString("ext_keytab "+principal);
|
|
|
|
|
command = TQCString("ext_keytab ")+principal.local8Bit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
command = TQCString("ext_keytab --keytab=\""+fileName+"\" "+principal);
|
|
|
|
|
command = TQCString("ext_keytab --keytab=\"")+fileName.local8Bit()+TQCString("\" ")+principal.local8Bit();
|
|
|
|
|
}
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
@ -2560,7 +2564,7 @@ int LDAPManager::exportKeytabForPrincipal(TQString principal, TQString fileName,
|
|
|
|
|
TQFile file;
|
|
|
|
|
file.open(IO_ReadOnly, stdin);
|
|
|
|
|
TQTextStream qtin(&file);
|
|
|
|
|
admincreds.password = qtin.readLine();
|
|
|
|
|
admincreds.password = qtin.readLine().local8Bit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (admincreds.password != "") {
|
|
|
|
@ -2588,7 +2592,7 @@ int LDAPManager::exportKeytabForPrincipal(TQString principal, TQString fileName,
|
|
|
|
|
leftbracket++;
|
|
|
|
|
defaultParam = prompt.mid(leftbracket, rightbracket-leftbracket);
|
|
|
|
|
}
|
|
|
|
|
command = TQCString(defaultParam);
|
|
|
|
|
command = defaultParam.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -2684,7 +2688,7 @@ TQString LDAPManager::getRealmCAMaster(TQString* errstr) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return realmCAMaster;
|
|
|
|
@ -2755,7 +2759,7 @@ int LDAPManager::moveKerberosEntries(TQString newSuffix, TQString* errstr) {
|
|
|
|
|
if((dn = ldap_get_dn(m_ldap, entry)) != NULL) {
|
|
|
|
|
TQStringList dnParts = TQStringList::split(",", dn);
|
|
|
|
|
TQString id = dnParts[0];
|
|
|
|
|
retcode = ldap_rename_s(m_ldap, dn, id, newSuffix, 0, NULL, NULL);
|
|
|
|
|
retcode = ldap_rename_s(m_ldap, dn, id.utf8(), newSuffix.utf8(), 0, NULL, NULL);
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
if (errstr) *errstr = i18n("LDAP rename failure<p>Reason: [%3] %4").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
return -1;
|
|
|
|
@ -2763,7 +2767,7 @@ int LDAPManager::moveKerberosEntries(TQString newSuffix, TQString* errstr) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
@ -2781,7 +2785,7 @@ int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole mac
|
|
|
|
|
int m_ldapBindTimeout;
|
|
|
|
|
TQString m_passwordHash;
|
|
|
|
|
TQString m_ignoredUsers;
|
|
|
|
|
TQString command;
|
|
|
|
|
TQCString command;
|
|
|
|
|
|
|
|
|
|
systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
|
|
|
|
|
systemconfig->setGroup(NULL);
|
|
|
|
@ -2835,9 +2839,9 @@ int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole mac
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
command = TQString("ln -s %1 %2").arg(LDAP_FILE).arg(LDAP_SECONDARY_FILE);
|
|
|
|
|
command = TQString("ln -s %1 %2").arg(LDAP_FILE).arg(LDAP_SECONDARY_FILE).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
if (errstr) *errstr = TQString("Execution of \"%s\" failed").arg(command.ascii());
|
|
|
|
|
if (errstr) *errstr = TQString("Execution of \"%s\" failed").arg(command);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2848,14 +2852,29 @@ int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole mac
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
command = TQString("ln -s %1 %2").arg(LDAP_FILE).arg(LDAP_TERTIARY_FILE);
|
|
|
|
|
command = TQString("ln -s %1 %2").arg(LDAP_FILE).arg(LDAP_TERTIARY_FILE).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
if (errstr) *errstr = TQString("Execution of \"%s\" failed").arg(command.ascii());
|
|
|
|
|
if (errstr) *errstr = TQString("Execution of \"%s\" failed").arg(command);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete systemconfig;
|
|
|
|
|
|
|
|
|
|
if ((machineRole == ROLE_PRIMARY_REALM_CONTROLLER) || (machineRole == ROLE_SECONDARY_REALM_CONTROLLER)) {
|
|
|
|
|
// The file may contain multi-master replication secrets, therefore only root should be able to read it
|
|
|
|
|
if (chmod(KDE_CONFDIR "/ldap/ldapconfigrc", S_IRUSR|S_IWUSR|S_IRGRP) < 0) {
|
|
|
|
|
if (errstr) *errstr = TQString("Unable to change permissions of \"%1\"").arg(KDE_CONFDIR "/ldap/ldapconfigrc");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Normal users should be allowed to read realm configuration data in order to launch realm administration utilities
|
|
|
|
|
if (chmod(KDE_CONFDIR "/ldap/ldapconfigrc", S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) {
|
|
|
|
|
if (errstr) *errstr = TQString("Unable to change permissions of \"%1\"").arg(KDE_CONFDIR "/ldap/ldapconfigrc");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3048,7 +3067,7 @@ LDAPTDEBuiltinsInfo LDAPManager::getTDEBuiltinMappings(TQString *errstr) {
|
|
|
|
|
builtininfo = parseLDAPTDEBuiltinsRecord(entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return builtininfo;
|
|
|
|
@ -3084,7 +3103,7 @@ LDAPMasterReplicationInfo LDAPManager::getLDAPMasterReplicationSettings(TQString
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
// Set OpenLDAP defaults
|
|
|
|
@ -3103,7 +3122,7 @@ LDAPMasterReplicationInfo LDAPManager::getLDAPMasterReplicationSettings(TQString
|
|
|
|
|
replicationinfo = parseLDAPMasterReplicationRecord(replicationinfo, entry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return replicationinfo;
|
|
|
|
@ -3429,7 +3448,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
if (!haveOlcOverlaySyncProv) {
|
|
|
|
@ -3479,7 +3498,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
if (!haveOlcOverlaySyncProv) {
|
|
|
|
@ -3591,7 +3610,7 @@ int LDAPManager::getTDECertificate(TQString certificateName, TQString fileName,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clean up
|
|
|
|
|
// Clean up
|
|
|
|
|
ldap_msgfree(msg);
|
|
|
|
|
|
|
|
|
|
return returncode;
|
|
|
|
@ -3803,11 +3822,11 @@ TQDateTime LDAPManager::getCertificateExpiration(TQString certfile) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::generatePublicKerberosCACertificate(LDAPCertConfig certinfo) {
|
|
|
|
|
TQString command;
|
|
|
|
|
TQCString command;
|
|
|
|
|
|
|
|
|
|
command = TQString("openssl req -key %1 -new -x509 -out %2 -subj \"/C=%3/ST=%4/L=%5/O=%6/OU=%7/CN=%8/emailAddress=%9\"").arg(KERBEROS_PKI_PEMKEY_FILE).arg(KERBEROS_PKI_PEM_FILE).arg(certinfo.countryName).arg(certinfo.stateOrProvinceName).arg(certinfo.localityName).arg(certinfo.organizationName).arg(certinfo.orgUnitName).arg(certinfo.commonName).arg(certinfo.emailAddress);
|
|
|
|
|
command = TQString("openssl req -key %1 -new -x509 -out %2 -subj \"/C=%3/ST=%4/L=%5/O=%6/OU=%7/CN=%8/emailAddress=%9\"").arg(KERBEROS_PKI_PEMKEY_FILE).arg(KERBEROS_PKI_PEM_FILE).arg(certinfo.countryName).arg(certinfo.stateOrProvinceName).arg(certinfo.localityName).arg(certinfo.organizationName).arg(certinfo.orgUnitName).arg(certinfo.commonName).arg(certinfo.emailAddress).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.ascii());
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.data());
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
if (chmod(KERBEROS_PKI_PEM_FILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) {
|
|
|
|
@ -3823,7 +3842,7 @@ int LDAPManager::generatePublicKerberosCACertificate(LDAPCertConfig certinfo) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::generatePublicKerberosCertificate(LDAPCertConfig certinfo, LDAPRealmConfig realmcfg) {
|
|
|
|
|
TQString command;
|
|
|
|
|
TQCString command;
|
|
|
|
|
|
|
|
|
|
TQString kdc_certfile = KERBEROS_PKI_KDC_FILE;
|
|
|
|
|
TQString kdc_keyfile = KERBEROS_PKI_KDCKEY_FILE;
|
|
|
|
@ -3832,14 +3851,14 @@ int LDAPManager::generatePublicKerberosCertificate(LDAPCertConfig certinfo, LDAP
|
|
|
|
|
kdc_keyfile.replace("@@@KDCSERVER@@@", realmcfg.name.lower());
|
|
|
|
|
kdc_reqfile.replace("@@@KDCSERVER@@@", realmcfg.name.lower());
|
|
|
|
|
|
|
|
|
|
command = TQString("openssl req -new -out %1 -key %2 -subj \"/C=%3/ST=%4/L=%5/O=%6/OU=%7/CN=%8/emailAddress=%9\"").arg(kdc_reqfile).arg(kdc_keyfile).arg(certinfo.countryName).arg(certinfo.stateOrProvinceName).arg(certinfo.localityName).arg(certinfo.organizationName).arg(certinfo.orgUnitName).arg(certinfo.commonName).arg(certinfo.emailAddress);
|
|
|
|
|
command = TQString("openssl req -new -out %1 -key %2 -subj \"/C=%3/ST=%4/L=%5/O=%6/OU=%7/CN=%8/emailAddress=%9\"").arg(kdc_reqfile).arg(kdc_keyfile).arg(certinfo.countryName).arg(certinfo.stateOrProvinceName).arg(certinfo.localityName).arg(certinfo.organizationName).arg(certinfo.orgUnitName).arg(certinfo.commonName).arg(certinfo.emailAddress).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.ascii());
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.data());
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
command = TQString("openssl x509 -req -in %1 -CAkey %2 -CA %3 -out %4 -extfile %5 -extensions kdc_cert -CAcreateserial").arg(kdc_reqfile).arg(KERBEROS_PKI_PEMKEY_FILE).arg(KERBEROS_PKI_PEM_FILE).arg(kdc_certfile).arg(OPENSSL_EXTENSIONS_FILE);
|
|
|
|
|
command = TQString("openssl x509 -req -in %1 -CAkey %2 -CA %3 -out %4 -extfile %5 -extensions kdc_cert -CAcreateserial").arg(kdc_reqfile).arg(KERBEROS_PKI_PEMKEY_FILE).arg(KERBEROS_PKI_PEM_FILE).arg(kdc_certfile).arg(OPENSSL_EXTENSIONS_FILE).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.ascii());
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.data());
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
if (chmod(kdc_certfile.ascii(), S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) {
|
|
|
|
@ -3861,7 +3880,7 @@ int LDAPManager::generatePublicKerberosCertificate(LDAPCertConfig certinfo, LDAP
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::generatePublicLDAPCertificate(LDAPCertConfig certinfo, LDAPRealmConfig realmcfg, uid_t ldap_uid, gid_t ldap_gid) {
|
|
|
|
|
TQString command;
|
|
|
|
|
TQCString command;
|
|
|
|
|
|
|
|
|
|
TQString ldap_certfile = LDAP_CERT_FILE;
|
|
|
|
|
TQString ldap_keyfile = LDAP_CERTKEY_FILE;
|
|
|
|
@ -3870,14 +3889,14 @@ int LDAPManager::generatePublicLDAPCertificate(LDAPCertConfig certinfo, LDAPReal
|
|
|
|
|
ldap_keyfile.replace("@@@ADMINSERVER@@@", realmcfg.name.lower());
|
|
|
|
|
ldap_reqfile.replace("@@@ADMINSERVER@@@", realmcfg.name.lower());
|
|
|
|
|
|
|
|
|
|
command = TQString("openssl req -new -out %1 -key %2 -subj \"/C=%3/ST=%4/L=%5/O=%6/OU=%7/CN=%8/emailAddress=%9\"").arg(ldap_reqfile).arg(ldap_keyfile).arg(certinfo.countryName).arg(certinfo.stateOrProvinceName).arg(certinfo.localityName).arg(certinfo.organizationName).arg(certinfo.orgUnitName).arg(realmcfg.admin_server).arg(certinfo.emailAddress);
|
|
|
|
|
command = TQString("openssl req -new -out %1 -key %2 -subj \"/C=%3/ST=%4/L=%5/O=%6/OU=%7/CN=%8/emailAddress=%9\"").arg(ldap_reqfile).arg(ldap_keyfile).arg(certinfo.countryName).arg(certinfo.stateOrProvinceName).arg(certinfo.localityName).arg(certinfo.organizationName).arg(certinfo.orgUnitName).arg(realmcfg.admin_server).arg(certinfo.emailAddress).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.ascii());
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.data());
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
command = TQString("openssl x509 -req -in %1 -CAkey %2 -CA %3 -out %4 -CAcreateserial").arg(ldap_reqfile).arg(KERBEROS_PKI_PEMKEY_FILE).arg(KERBEROS_PKI_PEM_FILE).arg(ldap_certfile);
|
|
|
|
|
command = TQString("openssl x509 -req -in %1 -CAkey %2 -CA %3 -out %4 -CAcreateserial").arg(ldap_reqfile).arg(KERBEROS_PKI_PEMKEY_FILE).arg(KERBEROS_PKI_PEM_FILE).arg(ldap_certfile).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.ascii());
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.data());
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
if (chmod(ldap_certfile.ascii(), S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) {
|
|
|
|
@ -4087,7 +4106,7 @@ int LDAPManager::writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr) {
|
|
|
|
|
stream << "auth sufficient pam_unix.so nullok try_first_pass" << "\n";
|
|
|
|
|
stream << "auth [default=ignore success=1 service_err=reset] pam_krb5.so ccache=/tmp/krb5cc_%u use_first_pass" << "\n";
|
|
|
|
|
if (pamConfig.enable_cached_credentials) {
|
|
|
|
|
stream << "auth [default=die success=done] pam_ccreds.so action=validate use_first_pass" << "\n";
|
|
|
|
|
stream << "auth [default=2 success=done] pam_ccreds.so action=validate use_first_pass" << "\n";
|
|
|
|
|
stream << "auth sufficient pam_ccreds.so action=store use_first_pass" << "\n";
|
|
|
|
|
}
|
|
|
|
|
stream << "auth required pam_deny.so" << "\n";
|
|
|
|
@ -4099,6 +4118,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";
|
|
|
|
@ -4107,9 +4129,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;
|
|
|
|
@ -4132,7 +4153,7 @@ int LDAPManager::writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr) {
|
|
|
|
|
int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, TQString adminRealm, TQString *errstr) {
|
|
|
|
|
TQCString command = "kadmin";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
args << TQCString("-p") << TQCString(adminUserName+"@"+(adminRealm.upper())) << TQCString("-r") << TQCString(adminRealm.upper());
|
|
|
|
|
args << TQCString("-p") << TQString("%1@%2").arg(adminUserName).arg(adminRealm.upper()).local8Bit() << TQCString("-r") << adminRealm.upper().local8Bit();
|
|
|
|
|
|
|
|
|
|
TQString hoststring = "host/"+getMachineFQDN();
|
|
|
|
|
|
|
|
|
@ -4142,7 +4163,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T
|
|
|
|
|
prompt = readFullLineFromPtyProcess(&kadminProc);
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
if (prompt == "kadmin>") {
|
|
|
|
|
command = TQCString("ext "+hoststring);
|
|
|
|
|
command = TQCString("ext ")+hoststring.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -4174,7 +4195,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T
|
|
|
|
|
prompt = readFullLineFromPtyProcess(&kadminProc);
|
|
|
|
|
printf("(kadmin) '%s'\n", prompt.ascii());
|
|
|
|
|
} while (prompt == "");
|
|
|
|
|
command = TQCString("ank --random-key "+hoststring);
|
|
|
|
|
command = TQCString("ank --random-key ")+hoststring.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -4212,7 +4233,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T
|
|
|
|
|
leftbracket++;
|
|
|
|
|
defaultParam = prompt.mid(leftbracket, rightbracket-leftbracket);
|
|
|
|
|
}
|
|
|
|
|
command = TQCString(defaultParam);
|
|
|
|
|
command = defaultParam.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -4222,7 +4243,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
command = TQCString("ext "+hoststring);
|
|
|
|
|
command = TQCString("ext ")+hoststring.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -4275,7 +4296,7 @@ int LDAPManager::unbondRealm(LDAPRealmConfig realmcfg, TQString adminUserName, c
|
|
|
|
|
|
|
|
|
|
TQCString command = "kadmin";
|
|
|
|
|
QCStringList args;
|
|
|
|
|
args << TQCString("-p") << TQCString(adminUserName+"@"+(adminRealm.upper()));
|
|
|
|
|
args << TQCString("-p") << TQString("%1@%2").arg(adminUserName).arg(adminRealm.upper()).local8Bit();
|
|
|
|
|
|
|
|
|
|
TQString hoststring = "host/"+getMachineFQDN();
|
|
|
|
|
|
|
|
|
@ -4288,7 +4309,7 @@ int LDAPManager::unbondRealm(LDAPRealmConfig realmcfg, TQString adminUserName, c
|
|
|
|
|
prompt = readFullLineFromPtyProcess(&kadminProc);
|
|
|
|
|
prompt = prompt.stripWhiteSpace();
|
|
|
|
|
if (prompt == "kadmin>") {
|
|
|
|
|
command = TQCString("delete "+hoststring);
|
|
|
|
|
command = TQCString("delete ")+hoststring.local8Bit();
|
|
|
|
|
kadminProc.enableLocalEcho(false);
|
|
|
|
|
kadminProc.writeLine(command, true);
|
|
|
|
|
do { // Discard our own input
|
|
|
|
@ -4321,7 +4342,7 @@ int LDAPManager::unbondRealm(LDAPRealmConfig realmcfg, TQString adminUserName, c
|
|
|
|
|
kadminProc.writeLine("quit", true);
|
|
|
|
|
|
|
|
|
|
// Delete keys from keytab
|
|
|
|
|
command = TQString("ktutil remove -p %1").arg(hoststring+"@"+adminRealm.upper());
|
|
|
|
|
command = TQString("ktutil remove -p %1").arg(hoststring+"@"+adminRealm.upper()).local8Bit();
|
|
|
|
|
if (system(command) < 0) {
|
|
|
|
|
printf("ERROR: Execution of \"%s\" failed!\n", command.data());
|
|
|
|
|
return 1; // Failure
|
|
|
|
|