s3:libads: add ads_connect_no_bind() helper
authorStefan Metzmacher <metze@samba.org>
Tue, 5 Mar 2024 16:45:35 +0000 (17:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 May 2024 08:17:05 +0000 (10:17 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/libads/ads_proto.h
source3/libads/ldap.c

index 10f64b0191085f6ecedcca647bdd9ee2e8d96e2a..34192878b6faf23c4d7286d9335e8c8e8e15f8cc 100644 (file)
@@ -88,6 +88,7 @@ bool ads_sitename_match(ADS_STRUCT *ads);
 bool ads_closest_dc(ADS_STRUCT *ads);
 ADS_STATUS ads_connect_creds(ADS_STRUCT *ads, struct cli_credentials *creds);
 ADS_STATUS ads_connect_anon(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_no_bind(ADS_STRUCT *ads);
 ADS_STATUS ads_connect_machine(ADS_STRUCT *ads);
 ADS_STATUS ads_connect(ADS_STRUCT *ads);
 ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
index 7fa4a47e3f9aa6dc33da7ecdaf374678f1620a14..5c0594de9c289771d393f1183d55d275821ea2d6 100644 (file)
@@ -1115,6 +1115,17 @@ ADS_STATUS ads_connect_anon(ADS_STRUCT *ads)
        return status;
 }
 
+/**
+ * Connect to the LDAP server using without a bind at all
+ * @param ads Pointer to an existing ADS_STRUCT
+ * @return status of connection
+ **/
+ADS_STATUS ads_connect_no_bind(ADS_STRUCT *ads)
+{
+       ads->auth.flags |= ADS_AUTH_NO_BIND;
+       return ads_connect_anon(ads);
+}
+
 /**
  * Connect to the LDAP server using the machine account
  * @param ads Pointer to an existing ADS_STRUCT