summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-10-22 20:30:40 -0600
committerJason Gerard DeRose <jderose@redhat.com>2008-10-22 20:30:40 -0600
commit98da855176cdd32021a850bb55d91cd53d77e1f5 (patch)
treeb339cef67bb1dbbc7df5d453d73e3b537753981f /ipalib/util.py
parent4da1f096751f000efcd7eb5ca3b7d719f3ce5581 (diff)
parent1daf319a19f902d7c7bef37af065cac81be9189e (diff)
downloadfreeipa.git-98da855176cdd32021a850bb55d91cd53d77e1f5.tar.gz
freeipa.git-98da855176cdd32021a850bb55d91cd53d77e1f5.tar.xz
freeipa.git-98da855176cdd32021a850bb55d91cd53d77e1f5.zip
Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index b60bfc8a..184c6d7c 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -20,6 +20,7 @@
"""
Various utility functions.
"""
+import krbV
def xmlrpc_marshal(*args, **kw):
"""
@@ -39,3 +40,11 @@ def xmlrpc_unmarshal(*params):
else:
kw = {}
return (params[1:], kw)
+
+def get_current_principal():
+ try:
+ return krbV.default_context().default_ccache().principal().name
+ except krbV.Krb5Error:
+ #TODO: do a kinit
+ print "Unable to get kerberos principal"
+ return None