From: Stefan Metzmacher Date: Tue, 5 Mar 2024 16:45:35 +0000 (+0100) Subject: s3:libads: add ads_connect_cldap_only() helper X-Git-Tag: tdb-1.4.11~776 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f34e64baf6c1a496643d788d1f25aabc7fd47074;p=thirdparty%2Fsamba.git s3:libads: add ads_connect_cldap_only() helper Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/libads/ads_proto.h b/source3/libads/ads_proto.h index 16fc24264cb..c44119eebdf 100644 --- a/source3/libads/ads_proto.h +++ b/source3/libads/ads_proto.h @@ -86,6 +86,7 @@ int ads_kinit_password(ADS_STRUCT *ads); bool ads_sitename_match(ADS_STRUCT *ads); bool ads_closest_dc(ADS_STRUCT *ads); +ADS_STATUS ads_connect_cldap_only(ADS_STRUCT *ads); ADS_STATUS ads_connect(ADS_STRUCT *ads); ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads); void ads_zero_ldap(ADS_STRUCT *ads); diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 13406b8b547..5e3c96fb8d8 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -1109,6 +1109,19 @@ got_connection: return status; } +/** + * Connect to the LDAP server using without a bind + * and without a tcp connection at all + * + * @param ads Pointer to an existing ADS_STRUCT + * @return status of connection + **/ +ADS_STATUS ads_connect_cldap_only(ADS_STRUCT *ads) +{ + ads->auth.flags |= ADS_AUTH_NO_BIND; + return ads_connect_internal(ads, NULL); +} + /* * Connect to the LDAP server * @param ads Pointer to an existing ADS_STRUCT