1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +03:00

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>
This commit is contained in:
Amitay Isaacs
2011-09-12 12:14:00 +10:00
committed by Andrew Bartlett
parent 0b089880f0
commit c6a40942b2

View File

@ -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,