mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4-subdomain: don't delete account DN not created in subdomain join
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
b8c6e36b09
commit
877e48cac8
@ -145,11 +145,14 @@ class dc_join(object):
|
||||
try:
|
||||
# find the krbtgt link
|
||||
print("checking samaccountname")
|
||||
res = ctx.samdb.search(base=ctx.samdb.get_default_basedn(),
|
||||
expression='samAccountName=%s' % ldb.binary_encode(ctx.samname),
|
||||
attrs=["msDS-krbTgtLink"])
|
||||
if res:
|
||||
ctx.del_noerror(res[0].dn, recursive=True)
|
||||
if ctx.subdomain:
|
||||
res = None
|
||||
else:
|
||||
res = ctx.samdb.search(base=ctx.samdb.get_default_basedn(),
|
||||
expression='samAccountName=%s' % ldb.binary_encode(ctx.samname),
|
||||
attrs=["msDS-krbTgtLink"])
|
||||
if res:
|
||||
ctx.del_noerror(res[0].dn, recursive=True)
|
||||
if ctx.connection_dn is not None:
|
||||
ctx.del_noerror(ctx.connection_dn)
|
||||
if ctx.krbtgt_dn is not None:
|
||||
|
Reference in New Issue
Block a user