From c7b1f156bbf23801515547bae50c4bbbbca90911 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 12 Sep 2011 15:09:49 +1000 Subject: s4-s3-upgrade: Check for duplicate sids before provisioning Pair-Programmed-With: Andrew Bartlett Signed-off-by: Andrew Bartlett --- source4/scripting/python/samba/upgrade.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py index ae9fdab4cb..98800196d9 100644 --- a/source4/scripting/python/samba/upgrade.py +++ b/source4/scripting/python/samba/upgrade.py @@ -602,6 +602,16 @@ Please fix this account before attempting to upgrade again logger.error(" %s" % name) raise ProvisioningError("Please remove common user/group names before upgrade.") + # Check for same user sid/group sid + group_sids = set(map(lambda g: str(g.sid), grouplist)) + user_sids = set(map(lambda u: "%s-%u" % (domainsid, u['rid']), userlist)) + common_sids = group_sids.intersection(user_sids) + if common_sids: + logger.error("Following sids are both user and group sids:") + for sid in common_sids: + logger.error(" %s" % str(sid)) + raise ProvisioningError("Please remove duplicate sid entries before upgrade.") + # Do full provision result = provision(logger, session_info, None, targetdir=targetdir, realm=realm, domain=domainname, -- cgit