s4-s3-upgrade: Check if there are duplicate sids for users and groups
authorAmitay Isaacs <amitay@gmail.com>
Mon, 30 Jan 2012 01:13:28 +0000 (12:13 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 31 Jan 2012 01:23:17 +0000 (02:23 +0100)
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Tue Jan 31 02:23:17 CET 2012 on sn-devel-104

source4/scripting/python/samba/upgrade.py

index e9f72e9a6e93e1f5de9c2a8af059e5ce6bc18acd..850035b9e938108888961686505fc85dba306969 100644 (file)
@@ -617,7 +617,11 @@ Please fix this account before attempting to upgrade again
 
     # Check for same user sid/group sid
     group_sids = set([str(g.sid) for g in grouplist])
+    if len(grouplist) != len(group_sids):
+        raise ProvisioningError("Please remove duplicate group sid entries before upgrade.")
     user_sids = set(["%s-%u" % (domainsid, u['rid']) for u in userlist])
+    if len(userlist) != len(user_sids):
+        raise ProvisioningError("Please remove duplicate user sid entries before upgrade.")
     common_sids = group_sids.intersection(user_sids)
     if common_sids:
         logger.error("Following sids are both user and group sids:")