Prevent runaway loop on kinit termination

pull/1/head
Timothy Pearson 13 years ago
parent ddd6159e47
commit 94e30a55ce

@ -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"
#include "libtdeldap.moc"

Loading…
Cancel
Save