diff options
author | Timothy Pearson <[email protected]> | 2012-07-13 02:03:23 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-07-13 02:03:23 -0500 |
commit | 94e30a55cea8d160a284e17f93cae6ae1da562d9 (patch) | |
tree | e9d74b57c470d5bd399b929406b87bd9bc9048b8 /src/libtdeldap.cpp | |
parent | ddd6159e47fa41cad5cddbc188d2eb13574d3ef7 (diff) | |
download | libtdeldap-94e30a55cea8d160a284e17f93cae6ae1da562d9.tar.gz libtdeldap-94e30a55cea8d160a284e17f93cae6ae1da562d9.zip |
Prevent runaway loop on kinit termination
Diffstat (limited to 'src/libtdeldap.cpp')
-rw-r--r-- | src/libtdeldap.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp index 1bb51e0..7fd08ec 100644 --- a/src/libtdeldap.cpp +++ b/src/libtdeldap.cpp @@ -837,6 +837,14 @@ TQString readFullLineFromPtyProcess(PtyProcess* proc) { while ((!result.contains("\r")) && (!result.contains(":")) && (!result.contains(">"))) { result = result + TQString(proc->readLine(false)); tqApp->processEvents(); + if (!TQFile::exists(TQString("/proc/%1/exe").arg(proc->pid()))) { + result.replace("\n", ""); + result.replace("\r", ""); + if (result == "") { + result = "TDE process terminated"; + } + break; + } } result.replace("\n", ""); result.replace("\r", ""); @@ -1222,11 +1230,11 @@ int LDAPManager::obtainKerberosTicket(LDAPCredentials creds, TQString principal, kadminProc.writeLine(creds.password, true); do { // Discard our own input prompt = readFullLineFromPtyProcess(&kadminProc); - printf("(kadmin) '%s'\n\r", prompt.ascii()); + printf("(kinit) '%s'\n\r", prompt.ascii()); } while (prompt == ""); prompt = prompt.stripWhiteSpace(); } - if (prompt != "") { + if ((prompt != "") && (prompt != "TDE process terminated")) { if (errstr) *errstr = prompt; return 1; } @@ -2605,4 +2613,4 @@ KerberosTicketInfo::~KerberosTicketInfo() { // } -#include "libtdeldap.moc"
\ No newline at end of file +#include "libtdeldap.moc" |