diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-09-12 15:09:49 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-12 20:42:20 +1000 |
commit | c7b1f156bbf23801515547bae50c4bbbbca90911 (patch) | |
tree | 067674e84a8bfdb909add641ca1186ea00410c19 /source4 | |
parent | 662818b123ea7813f72053bd976aad4628637cd1 (diff) | |
download | samba-c7b1f156bbf23801515547bae50c4bbbbca90911.tar.gz samba-c7b1f156bbf23801515547bae50c4bbbbca90911.tar.bz2 samba-c7b1f156bbf23801515547bae50c4bbbbca90911.zip |
s4-s3-upgrade: Check for duplicate sids before provisioning
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/upgrade.py | 10 |
1 files changed, 10 insertions, 0 deletions
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, |