diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libtdeldap.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp index 37ddea7..8209501 100644 --- a/src/libtdeldap.cpp +++ b/src/libtdeldap.cpp @@ -1017,6 +1017,7 @@ TQString LDAPManager::readFullLineFromPtyProcess(PtyProcess* proc) { } result.replace("\n", ""); result.replace("\r", ""); + result.replace("\x20\x08", ""); // Backspace + Space. This one caused all kinds of fun with long distinguished names and/or passwords! return result; } @@ -1061,7 +1062,7 @@ int LDAPManager::setPasswordForUser(LDAPUserInfo user, TQString *errstr) { do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); if ((prompt.endsWith(" Password:")) && (prompt.startsWith(TQString(user.name + "@")))) { kadminProc.enableLocalEcho(false); @@ -1754,7 +1755,7 @@ int LDAPManager::addMachineInfo(LDAPMachineInfo machine, TQString *errstr) { do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); // Use all defaults while (prompt != "kadmin>") { @@ -1805,7 +1806,7 @@ int LDAPManager::addMachineInfo(LDAPMachineInfo machine, TQString *errstr) { do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); } } @@ -1874,7 +1875,7 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) { do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); // Use all defaults while (prompt != "kadmin>") { @@ -1925,7 +1926,7 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) { do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); } } @@ -2584,7 +2585,7 @@ int LDAPManager::exportKeytabForPrincipal(TQString principal, TQString fileName, do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); // Use all defaults while (prompt != "kadmin>") { @@ -2635,7 +2636,7 @@ int LDAPManager::exportKeytabForPrincipal(TQString principal, TQString fileName, do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); } } @@ -3535,7 +3536,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); if (prompt.endsWith(" Password:")) { kadminProc.writeLine(adminPassword, true); @@ -3560,7 +3561,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); // Use all defaults while (prompt != "kadmin>") { @@ -3591,7 +3592,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); } } @@ -3600,7 +3601,7 @@ int LDAPManager::bondRealm(TQString adminUserName, const char * adminPassword, T do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); if (prompt != "kadmin>") { if (errstr) *errstr = prompt; @@ -3653,7 +3654,7 @@ int LDAPManager::unbondRealm(LDAPRealmConfig realmcfg, TQString adminUserName, c do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n", prompt.ascii()); - } while (prompt == TQString(command)); + } while ((prompt == TQString(command)) || (prompt == "")); prompt = prompt.stripWhiteSpace(); if (prompt.endsWith(" Password:")) { kadminProc.writeLine(adminPassword, true); |