summaryrefslogtreecommitdiff
path: root/source3/libnet/libnet_join.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-05-18 15:48:49 +0200
committerStefan Metzmacher <metze@samba.org>2017-06-27 16:57:44 +0200
commit0c65d5f41023076fd201c3a179df77dd615cdb01 (patch)
tree85776a623a5500f37f37b34352f5dd6ba7624f39 /source3/libnet/libnet_join.c
parent549c9d9a07d3002442cbbb7a90d0a7fef4a92bff (diff)
downloadsamba-0c65d5f41023076fd201c3a179df77dd615cdb01.tar.gz
s3:libnet_join: move kerberos_secrets_store_des_salt() out of libnet_join_derive_salting_principal()
We should separate the calculation and the storing steps. 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>
Diffstat (limited to 'source3/libnet/libnet_join.c')
-rw-r--r--source3/libnet/libnet_join.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index a5e863a4c7a..780c26c78e1 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -865,7 +865,7 @@ static bool libnet_join_derive_salting_principal(TALLOC_CTX *mem_ctx,
}
r->out.krb5_salt = salt;
- return kerberos_secrets_store_des_salt(salt);
+ return true;
}
/****************************************************************
@@ -964,6 +964,17 @@ static ADS_STATUS libnet_join_post_processing_ads(TALLOC_CTX *mem_ctx,
return ADS_ERROR_NT(NT_STATUS_UNSUCCESSFUL);
}
+ 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");