summaryrefslogtreecommitdiffstats
path: root/src/libtdeldap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtdeldap.cpp')
-rw-r--r--src/libtdeldap.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp
index 6d954a8..bad84ef 100644
--- a/src/libtdeldap.cpp
+++ b/src/libtdeldap.cpp
@@ -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);