s3:libnet: make use of secrets_store_JoinCtx()
authorStefan Metzmacher <metze@samba.org>
Wed, 17 May 2017 08:29:59 +0000 (10:29 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Jun 2017 14:57:46 +0000 (16:57 +0200)
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>
source3/libnet/libnet_join.c

index 99bba2ae3496afb74af49bfe840e07e95696ff51..591c177b44badfd78424622192ecb2b356b2762f 100644 (file)
@@ -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;
 }