s3:libnet_join: move kerberos_secrets_store_des_salt() to libnet_join_joindomain_stor...
authorStefan Metzmacher <metze@samba.org>
Thu, 18 May 2017 14:02:44 +0000 (16:02 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Jun 2017 14:57:44 +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 56bddf56fe114ba3dcada98230505ad0deb051e9..7669c2e0a4d22b8e6a7958188a65fc39d496ef4b 100644 (file)
@@ -970,17 +970,6 @@ static ADS_STATUS libnet_join_post_processing_ads_modify(TALLOC_CTX *mem_ctx,
 static ADS_STATUS libnet_join_post_processing_ads_sync(TALLOC_CTX *mem_ctx,
                                                        struct libnet_JoinCtx *r)
 {
-       if (r->out.krb5_salt != NULL) {
-               bool ok;
-
-               ok = kerberos_secrets_store_des_salt(r->out.krb5_salt);
-               if (!ok) {
-                       libnet_join_set_error_string(mem_ctx, r,
-                               "failed to store krb5_salt");
-                       return ADS_ERROR_NT(NT_STATUS_UNSUCCESSFUL);
-               }
-       }
-
        if (!libnet_join_create_keytab(mem_ctx, r)) {
                libnet_join_set_error_string(mem_ctx, r,
                        "failed to create kerberos keytab");
@@ -1013,6 +1002,16 @@ static bool libnet_join_joindomain_store_secrets(TALLOC_CTX *mem_ctx,
                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;
 }