From 67762d7965d74e4534a9dcb06276786fa9a37713 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 30 Sep 2005 23:56:54 +0000 Subject: r10668: added a ildap_search_bytree() function (This used to be commit fd6d895ebdb201ac6afaf5c8ec84d003765cdff6) --- source4/libcli/ldap/ldap_ildap.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'source4/libcli/ldap') diff --git a/source4/libcli/ldap/ldap_ildap.c b/source4/libcli/ldap/ldap_ildap.c index 541797c25c..d85585bce8 100644 --- a/source4/libcli/ldap/ldap_ildap.c +++ b/source4/libcli/ldap/ldap_ildap.c @@ -154,10 +154,10 @@ int ildap_count_entries(struct ldap_connection *conn, struct ldap_message **res) /* perform a ldap search */ -NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn, - int scope, const char *expression, - const char * const *attrs, BOOL attributesonly, - struct ldap_message ***results) +NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn, + int scope, struct ldb_parse_tree *tree, + const char * const *attrs, BOOL attributesonly, + struct ldap_message ***results) { struct ldap_message *msg; int n, i; @@ -178,7 +178,7 @@ NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn, msg->r.SearchRequest.timelimit = 0; msg->r.SearchRequest.sizelimit = 0; msg->r.SearchRequest.attributesonly = attributesonly; - msg->r.SearchRequest.tree = ldb_parse_tree(msg, expression); + msg->r.SearchRequest.tree = tree; msg->r.SearchRequest.num_attributes = n; msg->r.SearchRequest.attributes = attrs; @@ -213,3 +213,18 @@ NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn, return status; } + +/* + perform a ldap search +*/ +NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn, + int scope, const char *expression, + const char * const *attrs, BOOL attributesonly, + struct ldap_message ***results) +{ + struct ldb_parse_tree *tree = ldb_parse_tree(conn, expression); + NTSTATUS status; + status = ildap_search(conn, basedn, scope, tree, attrs, attributesonly, results); + talloc_free(tree); + return status; +} -- cgit