diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-18 15:50:49 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-06-27 16:57:44 +0200 |
commit | 0ab7944a2b00df4aa155a239c86f97e4e731b864 (patch) | |
tree | 6ee399d3e93db4cb123d30282509c7a007725c2c /source3/libnet/libnet_join.c | |
parent | 0c65d5f41023076fd201c3a179df77dd615cdb01 (diff) | |
download | samba-0ab7944a2b00df4aa155a239c86f97e4e731b864.tar.gz |
s3:libnet_join: split libnet_join_post_processing_ads() into modify/sync
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.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 780c26c78e1..7493ac88804 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -871,8 +871,8 @@ static bool libnet_join_derive_salting_principal(TALLOC_CTX *mem_ctx, /**************************************************************** ****************************************************************/ -static ADS_STATUS libnet_join_post_processing_ads(TALLOC_CTX *mem_ctx, - struct libnet_JoinCtx *r) +static ADS_STATUS libnet_join_post_processing_ads_modify(TALLOC_CTX *mem_ctx, + struct libnet_JoinCtx *r) { ADS_STATUS status; bool need_etype_update = false; @@ -964,6 +964,12 @@ static ADS_STATUS libnet_join_post_processing_ads(TALLOC_CTX *mem_ctx, return ADS_ERROR_NT(NT_STATUS_UNSUCCESSFUL); } + return ADS_SUCCESS; +} + +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; @@ -2214,6 +2220,18 @@ static WERROR libnet_join_post_processing(TALLOC_CTX *mem_ctx, return WERR_OK; } +#ifdef HAVE_ADS + if (r->out.domain_is_ad && + !(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) { + ADS_STATUS ads_status; + + ads_status = libnet_join_post_processing_ads_modify(mem_ctx, r); + if (!ADS_ERR_OK(ads_status)) { + return WERR_GEN_FAILURE; + } + } +#endif /* HAVE_ADS */ + saf_join_store(r->out.netbios_domain_name, r->in.dc_name); if (r->out.dns_domain_name) { saf_join_store(r->out.dns_domain_name, r->in.dc_name); @@ -2224,7 +2242,7 @@ static WERROR libnet_join_post_processing(TALLOC_CTX *mem_ctx, !(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) { ADS_STATUS ads_status; - ads_status = libnet_join_post_processing_ads(mem_ctx, r); + ads_status = libnet_join_post_processing_ads_sync(mem_ctx, r); if (!ADS_ERR_OK(ads_status)) { return WERR_GEN_FAILURE; } |