summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2007-11-09 16:34:52 -0500
committerRob Crittenden <rcritten@redhat.com>2007-11-09 16:34:52 -0500
commit99b84bfd01e0b3f4e9e69ea7c2912545bef0d71a (patch)
tree225cf00948fe031c7c5db7c5ac16036fe07fdfaf
parentf7358533d0b81f70f10e9116652f4e7d71e29b02 (diff)
downloadfreeipa-99b84bfd01e0b3f4e9e69ea7c2912545bef0d71a.tar.gz
freeipa-99b84bfd01e0b3f4e9e69ea7c2912545bef0d71a.tar.xz
freeipa-99b84bfd01e0b3f4e9e69ea7c2912545bef0d71a.zip
Handle ldap.UNWILLING_TO_PERFORM more gracefully
-rw-r--r--ipa-python/ipaerror.py5
-rw-r--r--ipa-server/xmlrpc-server/funcs.py5
2 files changed, 9 insertions, 1 deletions
diff --git a/ipa-python/ipaerror.py b/ipa-python/ipaerror.py
index b10a9a8fc..f583322e6 100644
--- a/ipa-python/ipaerror.py
+++ b/ipa-python/ipaerror.py
@@ -152,3 +152,8 @@ CONNECTION_GSSAPI_CREDENTIALS = gen_error_code(
CONNECTION_CATEGORY,
0x0003,
"GSSAPI Authorization error")
+
+CONNECTION_UNWILLING = gen_error_code(
+ CONNECTION_CATEGORY,
+ 0x0004,
+ "Account inactivated. Server is unwilling to perform.")
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 6fdaaca51..a45124525 100644
--- a/ipa-server/xmlrpc-server/funcs.py
+++ b/ipa-server/xmlrpc-server/funcs.py
@@ -77,7 +77,10 @@ class IPAConnPool:
conn = ipaserver.ipaldap.IPAdmin(host,port,None,None,None,debug)
# This will bind the connection
- conn.set_krbccache(krbccache, cprinc.name)
+ try:
+ conn.set_krbccache(krbccache, cprinc.name)
+ except ldap.UNWILLING_TO_PERFORM, e:
+ raise ipaerror.gen_exception(ipaerror.CONNECTION_UNWILLING)
return conn