samba-tool domain demote: Allow to operate on an RODC and a subdomain
authorAndrew Bartlett <abartlet@samba.org>
Thu, 22 Oct 2015 22:23:05 +0000 (11:23 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 26 Oct 2015 04:11:21 +0000 (05:11 +0100)
commitf121173cbf46fe64746d73adf40015c43d5c55fc
treeed1e62b96ecd1180c338c70ae37f1fc7f2fda15c
parent1874f592006d8808aa8f3bc97c94d9464a7053cf
samba-tool domain demote: Allow to operate on an RODC and a subdomain

On an RODC the local database cannot be modified, and the flags to remove
are different, we need instead to remove UF_PARTIAL_SECRETS_ACCOUNT.

If we are in a subdomain, then db.get_root_basedn() points to the
forest root, not the root of our domain

If the removeDsServer() fails with WERR_DS_DRA_NO_REPLICA
this may be reasonably considered to be success in this case.

Finally, the remove_dc.remove_sysvol_references() is reused
for objects not under the computer account.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
domain demote

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/netcmd/domain.py