From b3af1d334d6159dca75c2a74e7c6f909952c31af Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Thu, 2 Jul 2020 10:59:18 +0200 Subject: Fix ads_set_sasl_wrap_flags to only change sasl flags BUG: https://bugzilla.samba.org/show_bug.cgi?id=14439 Signed-off-by: Isaac Boukris Reviewed-by: Andreas Schneider --- source3/libads/ads_proto.h | 2 +- source3/libads/ads_struct.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source3/libads/ads_proto.h b/source3/libads/ads_proto.h index cd9c1082681..6cdde0cf6eb 100644 --- a/source3/libads/ads_proto.h +++ b/source3/libads/ads_proto.h @@ -47,7 +47,7 @@ ADS_STRUCT *ads_init(const char *realm, const char *workgroup, const char *ldap_server, enum ads_sasl_state_e sasl_state); -bool ads_set_sasl_wrap_flags(ADS_STRUCT *ads, int flags); +bool ads_set_sasl_wrap_flags(ADS_STRUCT *ads, unsigned flags); void ads_destroy(ADS_STRUCT **ads); /* The following definitions come from libads/disp_sec.c */ diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 043a1b21247..67a9a7cf75e 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -176,13 +176,17 @@ ADS_STRUCT *ads_init(const char *realm, /**************************************************************** ****************************************************************/ -bool ads_set_sasl_wrap_flags(ADS_STRUCT *ads, int flags) +bool ads_set_sasl_wrap_flags(ADS_STRUCT *ads, unsigned flags) { + unsigned other_flags; + if (!ads) { return false; } - ads->auth.flags = flags; + other_flags = ads->auth.flags & ~(ADS_AUTH_SASL_SIGN|ADS_AUTH_SASL_SEAL); + + ads->auth.flags = flags | other_flags; return true; } -- cgit v1.2.1