diff options
author | Timothy Pearson <[email protected]> | 2012-12-12 00:44:01 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-12-12 00:44:01 -0600 |
commit | 8113210613cc40e4c97042198a7c731e7a200859 (patch) | |
tree | fee5d44378e919fe218fa3261ca17ac9c3d6ba35 | |
parent | c8f560a8fba55db923679e112bb3d95da2be5203 (diff) | |
download | libtdeldap-8113210613cc40e4c97042198a7c731e7a200859.tar.gz libtdeldap-8113210613cc40e4c97042198a7c731e7a200859.zip |
Fix kadmin interface
-rw-r--r-- | src/libtdeldap.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp index 7fd08ec..de1ef0f 100644 --- a/src/libtdeldap.cpp +++ b/src/libtdeldap.cpp @@ -832,9 +832,18 @@ int LDAPManager::updateUserInfo(LDAPUserInfo user) { } } +// WARNING +// kadmin does not have a standard "waiting for user input" character or sequence +// To make matters worse, the colon does not uniquely designate the end of a line; for example the response "kadmin: ext openldap/foo.bar.baz: Principal does not exist" +// One way around this would be to see if the first colon is part of a "kadmin:" string; if so, then the colon is not a reliable end of line indicator for the current line +// (in fact only '\r' should be used as the end of line indicator in that case) TQString readFullLineFromPtyProcess(PtyProcess* proc) { TQString result = ""; - while ((!result.contains("\r")) && (!result.contains(":")) && (!result.contains(">"))) { + while ((!result.contains("\r")) && + (!result.contains(">")) && + (!((!result.contains("kadmin:")) && result.contains(":"))) && + (!((result.contains("kadmin:")) && result.contains("\r"))) + ) { result = result + TQString(proc->readLine(false)); tqApp->processEvents(); if (!TQFile::exists(TQString("/proc/%1/exe").arg(proc->pid()))) { |