diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-09-05 17:23:48 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-13 15:38:35 +1000 |
commit | 877e48cac8bd9c6bcf0ee983abcb187780ec294d (patch) | |
tree | 336d1ff22f6730f482419ff4e6ffc512bf3088fd /source4/scripting | |
parent | b8c6e36b09c72bf77077f853b4aac910c04a57ed (diff) | |
download | samba-877e48cac8bd9c6bcf0ee983abcb187780ec294d.tar.gz samba-877e48cac8bd9c6bcf0ee983abcb187780ec294d.tar.bz2 samba-877e48cac8bd9c6bcf0ee983abcb187780ec294d.zip |
s4-subdomain: don't delete account DN not created in subdomain join
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/join.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index ddc4380a65..e30d699d92 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -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: |