libnetjoin: First store configuration and then verify the join.
authorGünther Deschner <gd@samba.org>
Thu, 5 Jun 2008 16:58:27 +0000 (18:58 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 5 Jun 2008 17:34:06 +0000 (19:34 +0200)
Jerry, this fixes the issues while joining with "config backend = registry".

Guenther
(This used to be commit b3d47f099286778252c6df6bf2c1fee0c4e26560)

source3/libnet/libnet_join.c

index 3b2bce9fcf1e4a436ea2195830ca09ed9b255032..16dcc61afed3e8a3962459af7461eb0ae6b0d064 100644 (file)
@@ -1333,6 +1333,8 @@ static WERROR do_JoinConfig(struct libnet_JoinCtx *r)
                return werr;
        }
 
+       lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
+
        r->out.modified_config = true;
        r->out.result = werr;
 
@@ -1359,6 +1361,8 @@ static WERROR libnet_unjoin_config(struct libnet_UnjoinCtx *r)
                return werr;
        }
 
+       lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
+
        r->out.modified_config = true;
        r->out.result = werr;
 
@@ -1748,17 +1752,20 @@ WERROR libnet_Join(TALLOC_CTX *mem_ctx,
                if (!W_ERROR_IS_OK(werr)) {
                        goto done;
                }
+       }
 
+       werr = libnet_join_post_processing(mem_ctx, r);
+       if (!W_ERROR_IS_OK(werr)) {
+               goto done;
+       }
+
+       if (r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) {
                werr = libnet_join_post_verify(mem_ctx, r);
                if (!W_ERROR_IS_OK(werr)) {
                        goto done;
                }
        }
 
-       werr = libnet_join_post_processing(mem_ctx, r);
-       if (!W_ERROR_IS_OK(werr)) {
-               goto done;
-       }
  done:
        r->out.result = werr;