From: Stefan Metzmacher Date: Wed, 17 May 2017 08:29:59 +0000 (+0200) Subject: s3:libnet: make use of secrets_store_JoinCtx() X-Git-Tag: samba-4.5.13~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75a05ad5c73de9020fda80c4b0c8a80777795812;p=thirdparty%2Fsamba.git s3:libnet: make use of secrets_store_JoinCtx() BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider (cherry picked from commit c3ad8be5d5192070c599350d6ab28c064206b6cf) --- diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 6f497d44961..513f83a3593 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -987,31 +987,15 @@ static ADS_STATUS libnet_join_post_processing_ads_sync(TALLOC_CTX *mem_ctx, static bool libnet_join_joindomain_store_secrets(TALLOC_CTX *mem_ctx, struct libnet_JoinCtx *r) { - if (!secrets_store_domain_sid(r->out.netbios_domain_name, - r->out.domain_sid)) - { - DEBUG(1,("Failed to save domain sid\n")); - return false; - } + NTSTATUS status; - if (!secrets_store_machine_password(r->in.machine_password, - r->out.netbios_domain_name, - r->in.secure_channel_type)) - { - DEBUG(1,("Failed to save machine password\n")); + status = secrets_store_JoinCtx(r); + if (!NT_STATUS_IS_OK(status)) { + DBG_ERR("secrets_store_JoinCtx() failed %s\n", + nt_errstr(status)); return false; } - if (r->out.krb5_salt != NULL) { - bool ok; - - ok = kerberos_secrets_store_des_salt(r->out.krb5_salt); - if (!ok) { - DEBUG(1,("Failed to save krb5 salt\n")); - return false; - } - } - return true; }