s3:libads: add ads_connect_cldap_only() helper
authorStefan Metzmacher <metze@samba.org>
Tue, 5 Mar 2024 16:45:35 +0000 (17:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 14 May 2024 10:18:31 +0000 (10:18 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libads/ads_proto.h
source3/libads/ldap.c

index 16fc24264cb9de660739d731213ee1cd61f8963a..c44119eebdfc1a1b36f988ce8b42e03fe99483a8 100644 (file)
@@ -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);
index 13406b8b54723237b21d7a946e47bc3e3d1a4d47..5e3c96fb8d8fd4ac273e9524bb384ed1f5e5fda3 100644 (file)
@@ -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