Add some more error handling in libnetjoin.
authorGünther Deschner <gd@samba.org>
Thu, 28 Feb 2008 16:02:14 +0000 (17:02 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 28 Feb 2008 16:05:38 +0000 (17:05 +0100)
Guenther
(This used to be commit 892b2bc0cf1692c5707d322d0eb711b8245a3a96)

source3/libnet/libnet_join.c

index 623ca39f715b1a470123176f3047ad1b1f783d66..97fad95a680cb886484db32c403430f544b10ba1 100644 (file)
@@ -1193,6 +1193,9 @@ static WERROR libnet_join_pre_processing(TALLOC_CTX *mem_ctx,
        }
 
        if (r->in.modify_config && !lp_config_backend_is_registry()) {
+               libnet_join_set_error_string(mem_ctx, r,
+                       "Configuration manipulation requested but not "
+                       "supported by backend");
                return WERR_NOT_SUPPORTED;
        }
 
@@ -1519,9 +1522,16 @@ static WERROR libnet_unjoin_pre_processing(TALLOC_CTX *mem_ctx,
        }
 
        if (r->in.modify_config && !lp_config_backend_is_registry()) {
+               libnet_unjoin_set_error_string(mem_ctx, r,
+                       "Configuration manipulation requested but not "
+                       "supported by backend");
                return WERR_NOT_SUPPORTED;
        }
 
+       if (IS_DC) {
+               return WERR_SETUP_DOMAIN_CONTROLLER;
+       }
+
        if (!secrets_init()) {
                libnet_unjoin_set_error_string(mem_ctx, r,
                        "Unable to open secrets database");