From a922e01baeccedc3ffc8a893f1d6072bb203220f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 18 May 2017 15:59:00 +0200 Subject: [PATCH] s3:libnet_join: move libnet_join_joindomain_store_secrets() to libnet_join_post_processing() 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 Reviewed-by: Andreas Schneider --- source3/libnet/libnet_join.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 5e4a0d36c49..56bddf56fe1 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -2237,6 +2237,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; @@ -2628,11 +2632,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: -- 2.47.2