summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-03-11 16:05:53 +0100
committerKarolin Seeger <kseeger@samba.org>2016-03-15 20:29:33 +0100
commita35ce5d57bdaa9cb6bdeef9169d770e64e8fee21 (patch)
treedd3a9b68962dc03f2efd442882b94527ed1b1b21 /source3
parent60c5909859e3699322023896835ea1babedad6b0 (diff)
downloadsamba-a35ce5d57bdaa9cb6bdeef9169d770e64e8fee21.tar.gz
s3:libnet:libnet_join: fill in output enctypes and only modify when necessary.
Guenther BUG: https://bugzilla.samba.org/show_bug.cgi?id=11755 Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 5d498d1b4d9b83f179fb7b2841a19ad984eec5f8)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/ldap.c2
-rw-r--r--source3/libnet/libnet_join.c18
2 files changed, 18 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 8232bcc80c3..67350720818 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1478,7 +1478,7 @@ char *ads_parent_dn(const char *dn)
{
ADS_STATUS status;
char *expr;
- const char *attrs[] = {"*", "nTSecurityDescriptor", NULL};
+ const char *attrs[] = {"*", "msDS-SupportedEncryptionTypes", "nTSecurityDescriptor", NULL};
*res = NULL;
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index c72172ad97b..ac7e3efdbde 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -417,6 +417,11 @@ static ADS_STATUS libnet_join_find_machine_acct(TALLOC_CTX *mem_ctx,
goto done;
}
+ if (!ads_pull_uint32(r->in.ads, res, "msDS-SupportedEncryptionTypes",
+ &r->out.set_encryption_types)) {
+ r->out.set_encryption_types = 0;
+ }
+
done:
ads_msgfree(r->in.ads, res);
TALLOC_FREE(dn);
@@ -700,6 +705,10 @@ static ADS_STATUS libnet_join_set_etypes(TALLOC_CTX *mem_ctx,
return status;
}
+ if (r->in.desired_encryption_types == r->out.set_encryption_types) {
+ return ADS_SUCCESS;
+ }
+
/* now do the mods */
mods = ads_init_mods(mem_ctx);
@@ -713,7 +722,14 @@ static ADS_STATUS libnet_join_set_etypes(TALLOC_CTX *mem_ctx,
return status;
}
- return ads_gen_mod(r->in.ads, r->out.dn, mods);
+ status = ads_gen_mod(r->in.ads, r->out.dn, mods);
+ if (!ADS_ERR_OK(status)) {
+ return status;
+ }
+
+ r->out.set_encryption_types = r->in.desired_encryption_types;
+
+ return ADS_SUCCESS;
}
#endif
/****************************************************************