Skip to content

Commit

Permalink
group-add-member fails with an external member
Browse files Browse the repository at this point in the history
The command ipa group-add-member --external aduser@addomain.test
fails with an internal error when used with samba 4.19.

The command internally calls samba.security.dom_sid(sid) which
used to raise a TypeError but now raises a ValueError
(commit 9abdd67 on https://github.com/samba-team/samba).

IPA source code needs to handle properly both exception types.

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

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
flo-renaud authored and rcritten committed Oct 19, 2023
1 parent 9d49f40 commit d50624d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipaserver/dcerpc.py
Original file line number Diff line number Diff line change
@@ -303,7 +303,7 @@ def get_domain_by_sid(self, sid, exact_match=False):
# Parse sid string to see if it is really in a SID format
try:
test_sid = security.dom_sid(sid)
except TypeError:
except (TypeError, ValueError):
raise errors.ValidationError(name='sid',
error=_('SID is not valid'))

0 comments on commit d50624d

Please sign in to comment.