mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 08:41:55 -06:00
Catch public exceptions when creating the LDAP context in WSGI.
Made specifically for the case where S4U2Proxy delegation fails. https://fedorahosted.org/freeipa/ticket/2414
This commit is contained in:
parent
1c898e388b
commit
b241e828a9
@ -241,6 +241,9 @@ def _handle_errors(e, **kw):
|
||||
except _ldap.SUCCESS:
|
||||
pass
|
||||
except _ldap.LDAPError, e:
|
||||
if 'NOT_ALLOWED_TO_DELEGATE' in info:
|
||||
raise errors.ACIError(info="KDC returned NOT_ALLOWED_TO_DELEGATE")
|
||||
root_logger.info('Unhandled LDAPError: %s' % str(e))
|
||||
raise errors.DatabaseError(desc=desc, info=info)
|
||||
|
||||
|
||||
|
@ -317,9 +317,15 @@ class xmlserver(WSGIExecutioner):
|
||||
'''
|
||||
|
||||
self.debug('WSGI xmlserver.__call__:')
|
||||
self.create_context(ccache=environ.get('KRB5CCNAME'))
|
||||
try:
|
||||
self.create_context(ccache=environ.get('KRB5CCNAME'))
|
||||
response = super(xmlserver, self).__call__(environ, start_response)
|
||||
except PublicError, e:
|
||||
status = '200 OK'
|
||||
response = status
|
||||
headers = [('Content-Type', 'text/plain')]
|
||||
start_response(status, headers)
|
||||
return self.marshal(None, e)
|
||||
finally:
|
||||
destroy_context()
|
||||
return response
|
||||
|
Loading…
Reference in New Issue
Block a user