Group creation: Add msSFU30Name only when --nis-domain was given
authorMarc Muehlfeld <mmuehlfeld@samba.org>
Thu, 11 Jun 2015 19:20:55 +0000 (21:20 +0200)
committerChristian Ambach <ambi@samba.org>
Tue, 16 Jun 2015 09:58:02 +0000 (11:58 +0200)
This fixes a bug, that all new created groups automatically get an
msSFU30Name attribute added. This should only be the case, when
we also have a nis-domain (samba-tool --nis-domain=...).

Bugreport: https://bugzilla.samba.org/show_bug.cgi?id=11315

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Jun 16 11:58:02 CEST 2015 on sn-devel-104

python/samba/samdb.py

index e74e823f23ebdab634e043677eec59a085ec41aa..e3a6292bb4a41d0a4ad2bdbe372f65db2a6709cc 100644 (file)
@@ -191,8 +191,6 @@ pwdLastSet: 0
             "sAMAccountName": groupname,
             "objectClass": "group"}
 
-        ldbmessage["msSFU30Name"] = groupname
-
         if grouptype is not None:
             ldbmessage["groupType"] = normalise_int32(grouptype)
 
@@ -209,6 +207,7 @@ pwdLastSet: 0
             ldbmessage["gidNumber"] = normalise_int32(gidnumber)
 
         if nisdomain is not None:
+            ldbmessage["msSFU30Name"] = groupname
             ldbmessage["msSFU30NisDomain"] = nisdomain
 
         if sd is not None: