From: Samuel Cabrero Date: Tue, 24 May 2022 16:06:47 +0000 (+0200) Subject: s3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT X-Git-Tag: tevent-0.13.0~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed89ef46af2d29dafdb95a3cca38f0d350be95bd;p=thirdparty%2Fsamba.git s3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT Fixes the problem described in commit a26f535dedc651afa2a25dd37113ac71787197ff but for ads_domain_func_level() function. Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 6caeebe6037..4a533c9dc88 100755 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3391,6 +3391,13 @@ ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32_t *val) goto done; } } + + /* + * Reset ads->config.flags as it can contain the flags + * returned by the previous CLDAP ping when reusing the struct. + */ + ads_s->config.flags = 0; + ads_s->auth.flags = ADS_AUTH_ANON_BIND; status = ads_connect( ads_s ); if ( !ADS_ERR_OK(status))