Skip to content

Commit

Permalink
Handle samba changes in samba.security.dom_sid()
Browse files Browse the repository at this point in the history
samba.security.dom_sid() in 4.19 now raises ValueError instead of
TypeError. Fix the expected exception.

Related: https://pagure.io/freeipa/issue/9466

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
  • Loading branch information
flo-renaud committed Oct 23, 2023
1 parent d50624d commit ed6fa60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipaserver/dcerpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
def is_sid_valid(sid):
try:
security.dom_sid(sid)
except TypeError:
except (TypeError, ValueError):
return False
else:
return True
Expand Down Expand Up @@ -457,7 +457,7 @@ def get_trusted_domain_object_sid(self, object_name,
try:
test_sid = security.dom_sid(sid)
return unicode(test_sid)
except TypeError:
except (TypeError, ValueError):
raise errors.ValidationError(name=_('trusted domain object'),
error=_('Trusted domain did not '
'return a valid SID for '
Expand Down

0 comments on commit ed6fa60

Please sign in to comment.