From: Stefan Metzmacher Date: Tue, 30 Jan 2024 09:27:58 +0000 (+0100) Subject: s3:libads: call ldap_set_option(LDAP_OPT_PROTOCOL_VERSION) as soon as possible X-Git-Tag: tdb-1.4.11~945 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da87dbcea575053ec50fdf3df961e2512553da68;p=thirdparty%2Fsamba.git s3:libads: call ldap_set_option(LDAP_OPT_PROTOCOL_VERSION) as soon as possible Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 84771f6a43e..211a18472a8 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -991,14 +991,14 @@ got_connection: } DEBUG(3,("Connected to LDAP server %s\n", ads->config.ldap_server_name)); + ldap_set_option(ads->ldap.ld, LDAP_OPT_PROTOCOL_VERSION, &version); + /* cache the successful connection for workgroup and realm */ if (ads_closest_dc(ads)) { saf_store( ads->server.workgroup, ads->config.ldap_server_name); saf_store( ads->server.realm, ads->config.ldap_server_name); } - ldap_set_option(ads->ldap.ld, LDAP_OPT_PROTOCOL_VERSION, &version); - /* fill in the current time and offsets */ status = ads_current_time( ads );