libads: add ads_connect_user_creds() that won't overwrite given user creds.
authorGünther Deschner <gd@samba.org>
Tue, 24 Jun 2008 11:02:03 +0000 (13:02 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 24 Jun 2008 21:37:49 +0000 (23:37 +0200)
Guenther
(This used to be commit 026018c9f1ed0680b3ca5b26dd6b8dc466e27e0d)

source3/include/proto.h
source3/libads/ldap.c

index 68e3926342374a8d247db1b9b6b40692413fd2e7..75b616b300f8e61b2de9876bb4af0bb9c5b45f05 100644 (file)
@@ -2063,6 +2063,7 @@ bool ads_sitename_match(ADS_STRUCT *ads);
 bool ads_closest_dc(ADS_STRUCT *ads);
 bool ads_try_connect(ADS_STRUCT *ads, const char *server );
 ADS_STATUS ads_connect(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
 void ads_disconnect(ADS_STRUCT *ads);
 ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
                                int scope, const char *expr, const char **attrs,
index 7b9e51068b7b59bf3c9e3b74af0eb1d1e2d29e0f..7c64082ab46e8c98507cd080f6fc14b859f6dba2 100644 (file)
@@ -526,6 +526,18 @@ got_connection:
        return status;
 }
 
+/**
+ * Connect to the LDAP server using given credentials
+ * @param ads Pointer to an existing ADS_STRUCT
+ * @return status of connection
+ **/
+ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads)
+{
+       ads->auth.flags |= ADS_AUTH_USER_CREDS;
+
+       return ads_connect(ads);
+}
+
 /**
  * Disconnect the LDAP server
  * @param ads Pointer to an existing ADS_STRUCT