]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libnet_join: move libnet_join_joindomain_store_secrets() to libnet_join_post_proce...
authorStefan Metzmacher <metze@samba.org>
Thu, 18 May 2017 13:59:00 +0000 (15:59 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 13 Jul 2017 08:51:18 +0000 (10:51 +0200)
We should not store the secrets before we did all remote changes
(except the optional dns updates).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit a922e01baeccedc3ffc8a893f1d6072bb203220f)

source3/libnet/libnet_join.c

index 403b119633c76648be4867edd3ccfe616e1f99b2..375e9d78784ba6af46648ddde44ea9c95aadef8f 100644 (file)
@@ -2235,6 +2235,10 @@ static WERROR libnet_join_post_processing(TALLOC_CTX *mem_ctx,
                saf_join_store(r->out.dns_domain_name, r->in.dc_name);
        }
 
+       if (!libnet_join_joindomain_store_secrets(mem_ctx, r)) {
+               return WERR_NERR_SETUPNOTJOINED;
+       }
+
        werr = do_JoinConfig(r);
        if (!W_ERROR_IS_OK(werr)) {
                return werr;
@@ -2626,11 +2630,6 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       if (!libnet_join_joindomain_store_secrets(mem_ctx, r)) {
-               werr = WERR_NERR_SETUPNOTJOINED;
-               goto done;
-       }
-
        werr = WERR_OK;
 
  done: