From c3ad8be5d5192070c599350d6ab28c064206b6cf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 May 2017 10:29:59 +0200 Subject: [PATCH] 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 --- source3/libnet/libnet_join.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 99bba2ae349..591c177b44b 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; } -- 2.11.4.GIT