Add kgetcred integration

pull/1/head
Timothy Pearson 13 years ago
parent 072098e10d
commit 477d5b0abb

@ -1226,6 +1226,24 @@ int LDAPManager::obtainKerberosTicket(LDAPCredentials creds, TQString principal,
return 0;
}
int LDAPManager::obtainKerberosServiceTicket(TQString principal, TQString *errstr) {
TQString ret;
TQString command = TQString("kgetcred \"%1\"").arg(principal);
FILE *output = popen(command.ascii(), "r");
TQFile f;
f.open(IO_ReadOnly, output);
TQTextStream stream(&f);
ret = stream.readLine();
f.close();
pclose(output);
if (ret != "") {
if (errstr) *errstr = ret;
return -1;
}
return 0;
}
int LDAPManager::destroyKerberosTicket(TQString principal, TQString *errstr) {
TQString ret;
TQString command = TQString("kdestroy --credential=\"%1\"").arg(principal);

@ -385,6 +385,7 @@ class LDAPManager : public TQObject {
static KerberosTicketInfoList getKerberosTicketList(TQString cache=TQString::null, TQString *cacheFileName=0);
static int getKerberosPassword(LDAPCredentials &creds, TQString prompt, bool requestServicePrincipal=false, TQWidget* parent=0);
static int obtainKerberosTicket(LDAPCredentials creds, TQString principal, TQString *errstr=0);
static int obtainKerberosServiceTicket(TQString principal, TQString *errstr=0);
static int destroyKerberosTicket(TQString principal, TQString *errstr=0);
private:

Loading…
Cancel
Save