From: David Mulder Date: Tue, 25 Aug 2020 20:16:30 +0000 (-0600) Subject: samdb: Create group in wellknown user container X-Git-Tag: tevent-0.11.0~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4602f4fc1b537e74fdee8d9f1a390a4ea1ba18d5;p=thirdparty%2Fsamba.git samdb: Create group in wellknown user container BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143 Signed-off-by: David Mulder Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 2374505575b..979cf6d3592 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -228,7 +228,12 @@ lockoutTime: 0 :param sd: security descriptor of the object """ - group_dn = "CN=%s,%s,%s" % (groupname, (groupou or "CN=Users"), self.domain_dn()) + if groupou: + group_dn = "CN=%s,%s,%s" % (groupname, groupou, self.domain_dn()) + else: + group_dn = "CN=%s,%s" % (groupname, self.get_wellknown_dn( + self.get_default_basedn(), + dsdb.DS_GUID_USERS_CONTAINER)) # The new user record. Note the reliance on the SAMLDB module which # fills in the default information