From c6a40942b2c5b2f330b73a5513927ffe9ed1af20 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 12 Sep 2011 12:14:00 +1000 Subject: s4-s3-upgrade: Check for common user/group names before provisioning Pair-Programmed-With: Andrew Bartlett Signed-off-by: Andrew Bartlett --- source4/scripting/python/samba/upgrade.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/scripting/python') 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, -- cgit