The Samba-Bugzilla – Attachment 18651 Details for
Bug 15854
samba-tool cannot add user to group whose name is exactly 16 characters long
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v4.22 fix cherry-picked from master
fix-bug-15853-4.22.patch (text/plain), 6.16 KB, created by
Björn Baumbach
on 2025-06-17 11:11:24 UTC
(
hide
)
Description:
v4.22 fix cherry-picked from master
Filename:
MIME Type:
Creator:
Björn Baumbach
Created:
2025-06-17 11:11:24 UTC
Size:
6.16 KB
patch
obsolete
>From b9fcaf5d1819aed292095cf237385b6b4922278e Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Fri, 13 Jun 2025 12:23:30 +1200 >Subject: [PATCH 1/3] pytest:samba-tool group: test addmembers >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15854 > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Reviewed-by: Björn Baumbach <bb@samba.org> >(cherry picked from commit 3150d103bb2990e005d70c90f3f9c316c5353005) >--- > python/samba/tests/samba_tool/group.py | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/python/samba/tests/samba_tool/group.py b/python/samba/tests/samba_tool/group.py >index e8c0960849f..485dcb0cf66 100644 >--- a/python/samba/tests/samba_tool/group.py >+++ b/python/samba/tests/samba_tool/group.py >@@ -334,6 +334,20 @@ class GroupCmdTestCase(SambaToolCmdTest): > name = str(groupobj.get("dn", idx=0)) > self.assertMatch(out, name, "group '%s' not found" % name) > >+ def test_addmember(self): >+ groups = [g['name'] for g in self.groups] >+ for parent, child in zip(groups, groups[1:]): >+ (result, out, err) = self.runsubcmd( >+ "group", "addmembers", parent, child) >+ self.assertCmdSuccess(result, out, err) >+ >+ (result, out, err) = self.runsubcmd( >+ "group", "addmembers", groups[-1], ','.join(groups[:-1])) >+ self.assertCmdSuccess(result, out, err) >+ >+ (result, out, err) = self.runsubcmd( >+ "group", "addmembers", groups[0], "alice,bob") >+ self.assertCmdSuccess(result, out, err) > > def test_move(self): > full_ou_dn = str(self.samdb.normalize_dn_in_domain("OU=movetest_grp")) >-- >2.43.0 > > >From c0f8fbdee381033073bf4d53e3ed1e3296a6f5e8 Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Fri, 13 Jun 2025 11:38:22 +1200 >Subject: [PATCH 2/3] pytest: samba-tool group: test with 16 character name >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15854 > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Reviewed-by: Björn Baumbach <bb@samba.org> >(cherry picked from commit f545a77a3c466e2be37e0c453861566d42b1a01d) >--- > python/samba/tests/samba_tool/group.py | 3 ++- > selftest/knownfail.d/samba-tool-group-addmember | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > create mode 100644 selftest/knownfail.d/samba-tool-group-addmember > >diff --git a/python/samba/tests/samba_tool/group.py b/python/samba/tests/samba_tool/group.py >index 485dcb0cf66..1c5bc9690f9 100644 >--- a/python/samba/tests/samba_tool/group.py >+++ b/python/samba/tests/samba_tool/group.py >@@ -38,7 +38,8 @@ class GroupCmdTestCase(SambaToolCmdTest): > self.groups.append(self._randomGroup({"name": "testgroup1"})) > self.groups.append(self._randomGroup({"name": "testgroup2"})) > self.groups.append(self._randomGroup({"name": "testgroup3"})) >- self.groups.append(self._randomGroup({"name": "testgroup4"})) >+ self.groups.append(self._randomGroup( >+ {"name": "16 character name for bug 15854"[:16]})) > self.groups.append(self._randomGroup({"name": "testgroup5 (with brackets)"})) > self.groups.append(self._randomPosixGroup({"name": "posixgroup1"})) > self.groups.append(self._randomPosixGroup({"name": "posixgroup2"})) >diff --git a/selftest/knownfail.d/samba-tool-group-addmember b/selftest/knownfail.d/samba-tool-group-addmember >new file mode 100644 >index 00000000000..ddc6021a5ae >--- /dev/null >+++ b/selftest/knownfail.d/samba-tool-group-addmember >@@ -0,0 +1 @@ >+^samba.tests.samba_tool.group.+GroupCmdTestCase.test_addmember >-- >2.43.0 > > >From 5f18bb96dfe3acc8dd5d492c33c11fae31ba8c6a Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Fri, 13 Jun 2025 12:29:02 +1200 >Subject: [PATCH 3/3] python: Do not interpret 16 character group names as > GUIDs >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15854 > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Reviewed-by: Björn Baumbach <bb@samba.org> > >Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> >Autobuild-Date(master): Mon Jun 16 22:22:27 UTC 2025 on atb-devel-224 > >(cherry picked from commit 7c99658e22c6761ccf9abbdea588553a46af7453) >--- > python/samba/samdb.py | 10 +++++++++- > selftest/knownfail.d/samba-tool-group-addmember | 1 - > 2 files changed, 9 insertions(+), 2 deletions(-) > delete mode 100644 selftest/knownfail.d/samba-tool-group-addmember > >diff --git a/python/samba/samdb.py b/python/samba/samdb.py >index 0545aed98eb..7a1cee1e108 100644 >--- a/python/samba/samdb.py >+++ b/python/samba/samdb.py >@@ -35,6 +35,7 @@ from samba.common import normalise_int32 > from samba.common import get_bytes, cmp > from samba.dcerpc import security > from samba import is_ad_dc_built >+from samba import string_is_guid > from samba import NTSTATUSError, ntstatus > import binascii > >@@ -388,6 +389,13 @@ lockoutTime: 0 > > partial_groupfilter = None > >+ # If <group> looks like a SID, GUID, or DN, we use it >+ # accordingly, otherwise as a name. >+ # >+ # Because misc.GUID() will read any 16 byte sequence as a >+ # binary guid, we need to be careful not to read 16 character >+ # names as GUIDs. >+ > group_sid = None > try: > group_sid = security.dom_sid(group) >@@ -397,7 +405,7 @@ lockoutTime: 0 > partial_groupfilter = "(objectClass=*)" > > group_guid = None >- if partial_groupfilter is None: >+ if partial_groupfilter is None and string_is_guid(group): > try: > group_guid = misc.GUID(group) > except NTSTATUSError as e: >diff --git a/selftest/knownfail.d/samba-tool-group-addmember b/selftest/knownfail.d/samba-tool-group-addmember >deleted file mode 100644 >index ddc6021a5ae..00000000000 >--- a/selftest/knownfail.d/samba-tool-group-addmember >+++ /dev/null >@@ -1 +0,0 @@ >-^samba.tests.samba_tool.group.+GroupCmdTestCase.test_addmember >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
dbagnall
:
review+
bbaumbach
:
review+
bbaumbach
:
ci-passed+
Actions:
View
Attachments on
bug 15854
: 18651