diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-09-12 12:14:00 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-12 20:42:17 +1000 |
commit | c6a40942b2c5b2f330b73a5513927ffe9ed1af20 (patch) | |
tree | 203a555e06cfba594df71fc4a75dfb54b0f35989 /source4 | |
parent | 0b089880f021121320744f4f1b742857c0cb5cbf (diff) | |
download | samba-c6a40942b2c5b2f330b73a5513927ffe9ed1af20.tar.gz samba-c6a40942b2c5b2f330b73a5513927ffe9ed1af20.tar.bz2 samba-c6a40942b2c5b2f330b73a5513927ffe9ed1af20.zip |
s4-s3-upgrade: Check for common user/group names 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 41c93ea151..ae9fdab4cb 100644 --- a/source4/scripting/python/samba/upgrade.py +++ b/source4/scripting/python/samba/upgrade.py @@ -592,6 +592,16 @@ Please fix this account before attempting to upgrade again logger.info("Next rid = %d", next_rid) + # Check for same username/groupname + group_names = set(map(lambda g: g.nt_name, grouplist)) + user_names = set(map(lambda u: u['account_name'], userlist)) + common_names = group_names.intersection(user_names) + if common_names: + logger.error("Following names are both user names and group names:") + for name in common_names: + logger.error(" %s" % name) + raise ProvisioningError("Please remove common user/group names before upgrade.") + # Do full provision result = provision(logger, session_info, None, targetdir=targetdir, realm=realm, domain=domainname, |