]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samdb: Create group in wellknown user container
authorDavid Mulder <dmulder@suse.com>
Tue, 25 Aug 2020 20:16:30 +0000 (14:16 -0600)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Jun 2021 01:14:37 +0000 (01:14 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9143
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/samdb.py

index 2374505575bd67cc1d362a4f123c563cc8903c32..979cf6d3592300a18ef0ee1c55de035e0092e6ac 100644 (file)
@@ -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