netapi: Move DC check to NetJoinDomain() where it is needed.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 11 Dec 2013 01:59:20 +0000 (14:59 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 11 Dec 2014 18:14:06 +0000 (19:14 +0100)
This partially reverts 15f6e27bd5a9065c8b781fa21f5989ce2c355776.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10891

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/lib/netapi/joindomain.c
source3/libnet/libnet_join.c

index 9da1bdc6e1bfedc9a01cb591df935ecfdfc59b5a..632c8c6638fc9c2ca16842086a3d5ba08c683236 100644 (file)
@@ -115,6 +115,10 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
        struct dcerpc_binding_handle *b;
        DATA_BLOB session_key;
 
+       if (IS_DC) {
+               return WERR_SETUP_DOMAIN_CONTROLLER;
+       }
+
        werr = libnetapi_open_pipe(ctx, r->in.server,
                                   &ndr_table_wkssvc,
                                   &pipe_cli);
index 7c70d35cfe542db2d12a538e579e26517b5fd18a..73c9a573879747a3ac787496e36b31f401bc06e1 100644 (file)
@@ -1957,10 +1957,6 @@ static WERROR libnet_join_pre_processing(TALLOC_CTX *mem_ctx,
                return WERR_INVALID_PARAM;
        }
 
-       if (IS_DC) {
-               return WERR_SETUP_DOMAIN_CONTROLLER;
-       }
-
        if (!r->in.admin_domain) {
                char *admin_domain = NULL;
                char *admin_account = NULL;