Bug 15854 - samba-tool cannot add user to group whose name is exactly 16 characters long
Summary: samba-tool cannot add user to group whose name is exactly 16 characters long
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.22.0
Hardware: All All
: P5 regression (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-06 11:44 UTC by Richard Schütz
Modified: 2025-07-07 16:21 UTC (History)
5 users (show)

See Also:


Attachments
v4.22 fix cherry-picked from master (6.16 KB, patch)
2025-06-17 11:11 UTC, Björn Baumbach
dbagnall: review+
bbaumbach: review+
bbaumbach: ci-passed+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Schütz 2025-05-06 11:44:43 UTC
# samba-tool group addmembers abcdefghijklmnop user
ERROR: Failed to add members ['user'] to group "abcdefghijklmnop" - (32, "Base-DN '<GUID=64636261-6665-6867-696a-6b6c6d6e6f70>' not found")

This is a regression caused by commit 21a88df032c6e481b547fad2c48d14243a514035. add_remove_group_members() now tries to interpret the group name as GUID first, which eventually succeeds in GUID_from_data_blob() and GUID_from_ndr_blob() for arbitrary strings with 16 characters.
Comment 1 Jennifer Sutton 2025-05-08 05:16:39 UTC
Does add_remove_group_members() need to support SIDs and GUIDs in the first place when it also supports '<SID=>' and '<GUID=>' DN syntax?
Comment 2 Douglas Bagnall 2025-06-13 02:00:05 UTC
Richard, thanks for debugging this.

I think this patch 

https://gitlab.com/samba-team/samba/-/merge_requests/4081.patch

should work.
Comment 3 Samba QA Contact 2025-06-16 22:23:03 UTC
This bug was referenced in samba master:

3150d103bb2990e005d70c90f3f9c316c5353005
f545a77a3c466e2be37e0c453861566d42b1a01d
7c99658e22c6761ccf9abbdea588553a46af7453
Comment 4 Björn Baumbach 2025-06-17 11:11:24 UTC
Created attachment 18651 [details]
v4.22 fix cherry-picked from master
Comment 5 Björn Baumbach 2025-06-17 11:12:23 UTC
Comment on attachment 18651 [details]
v4.22 fix cherry-picked from master

CI passed: https://gitlab.com/samba-team/devel/samba/-/pipelines/1873760609
Comment 6 Samba QA Contact 2025-06-19 08:50:03 UTC
This bug was referenced in samba v4-22-test:

d80ff2e1e58dab4ee1c7de7f05fb3275c2a25239
de43d8e305da2a87792ee4dbd807895c039e4e14
76d1b6b180790b20b54265e4798e8cbaf899b405
Comment 7 Jule Anger 2025-06-19 10:07:20 UTC
Closing out bug report.

Thanks!
Comment 8 Samba QA Contact 2025-07-07 16:21:20 UTC
This bug was referenced in samba v4-22-stable (Release samba-4.22.3):

d80ff2e1e58dab4ee1c7de7f05fb3275c2a25239
de43d8e305da2a87792ee4dbd807895c039e4e14
76d1b6b180790b20b54265e4798e8cbaf899b405