mirror of
https://github.com/samba-team/samba.git
synced 2025-07-27 07:42:04 +03:00
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>
This commit is contained in:
committed by
Andrew Bartlett
parent
662818b123
commit
c7b1f156bb
@ -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,
|
||||
|
Reference in New Issue
Block a user