Fix kadmin interface

pull/1/head
Timothy Pearson 12 years ago
parent c8f560a8fb
commit 8113210613

@ -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 readFullLineFromPtyProcess(PtyProcess* proc) {
TQString result = ""; 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)); result = result + TQString(proc->readLine(false));
tqApp->processEvents(); tqApp->processEvents();
if (!TQFile::exists(TQString("/proc/%1/exe").arg(proc->pid()))) { if (!TQFile::exists(TQString("/proc/%1/exe").arg(proc->pid()))) {

Loading…
Cancel
Save