Don't require "Modify property" perms to unjoin (bug #6481) "net ads leave" stopped...
authorJim McDonough <jmcd@samba.org>
Mon, 29 Jun 2009 14:06:14 +0000 (10:06 -0400)
committerKarolin Seeger <kseeger@samba.org>
Tue, 30 Jun 2009 07:09:35 +0000 (09:09 +0200)
commit880d1a3f83a0834225d5a7c0f179c236b0e59ef8
treeb1e6cd7abfb88effdff4d8333d4e93dc688dca5e
parentdb7c5d175ba2d733df445f7d0dc570a79a417f49
Don't require "Modify property" perms to unjoin (bug #6481) "net ads leave" stopped working when "modify properties" permissions were not granted (meaning you had to be allowed to disable the account that you were about to delete).

Libnetapi should not delete machine accounts, as this does not
happen on win32.  The WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE flag
really means "disable" (both in practice and docs).

However, to keep the functionality in "net ads leave", we
will still try to do the delete.  If this fails, we try
to do the disable.

Additionally, it is possible in windows to not disable or
delete the account, but just tell the local machine that it
is no longer in the account.  libnet can now do this as well.

Don't use ads realm name for non-ads case.  #6481

Also check that the connection to ads worked.
source/lib/netapi/joindomain.c
source/libnet/libnet_join.c
source/librpc/gen_ndr/libnet_join.h
source/librpc/gen_ndr/ndr_libnet_join.c
source/librpc/idl/libnet_join.idl
source/utils/net_ads.c