summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-09-23 14:30:06 -0400
committerSimo Sorce <idra@samba.org>2008-09-23 18:17:46 -0400
commit508527890adc7bedd47522a7dae0c96d2b2e4bae (patch)
tree77e510421ff8eb98c0a9b0836905ca2f67eaf42f /source4/lib/ldb/include
parentd275cc762dad1985045d381ca211e92234d9d77d (diff)
downloadsamba-508527890adc7bedd47522a7dae0c96d2b2e4bae.tar.gz
samba-508527890adc7bedd47522a7dae0c96d2b2e4bae.tar.bz2
samba-508527890adc7bedd47522a7dae0c96d2b2e4bae.zip
Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.
The previous ldb_search() interface made it way too easy to leak results, and being able to use a printf-like expression turns to be really useful.
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r--source4/lib/ldb/include/ldb.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 937029f52c..645d7866c5 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -1023,31 +1023,21 @@ struct ldb_control *ldb_request_get_control(struct ldb_request *req, const char
records that match an LDAP-like search expression
\param ldb the context associated with the database (from ldb_init())
+ \param mem_ctx the memory context to use for the request and the results
+ \param result the return result
\param base the Base Distinguished Name for the query (use ldb_dn_new() for an empty one)
\param scope the search scope for the query
- \param expression the search expression to use for this query
\param attrs the search attributes for the query (pass NULL if none required)
- \param res the return result
+ \param exp_fmt the search expression to use for this query (printf like)
\return result code (LDB_SUCCESS on success, or a failure code)
\note use talloc_free() to free the ldb_result returned
*/
-int ldb_search(struct ldb_context *ldb,
- struct ldb_dn *base,
- enum ldb_scope scope,
- const char *expression,
- const char * const *attrs, struct ldb_result **res);
-
-/*
- * a useful search function where you can easily define the expression and
- * that takes a memory context where results are allocated
-*/
-
-int ldb_search_exp_fmt(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
- struct ldb_result **result, struct ldb_dn *base,
- enum ldb_scope scope, const char * const *attrs,
- const char *exp_fmt, ...) PRINTF_ATTRIBUTE(7,8);
+int ldb_search(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
+ struct ldb_result **result, struct ldb_dn *base,
+ enum ldb_scope scope, const char * const *attrs,
+ const char *exp_fmt, ...) PRINTF_ATTRIBUTE(7,8);
/**
Add a record to the database.