diff options
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/libads/ldap.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 68e3926342..75b616b300 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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, diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 7b9e51068b..7c64082ab4 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -527,6 +527,18 @@ got_connection: } /** + * 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 **/ |