summaryrefslogtreecommitdiff
path: root/source3/lib/tldap_util.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-28 14:41:11 +0200
committerVolker Lendecke <vl@samba.org>2009-06-28 15:51:02 +0200
commitc594d21fdaea3fcee11afddc4f0d3e8c065db815 (patch)
tree6ff59166f6fad9f2fad25fb23f960edc396f33b0 /source3/lib/tldap_util.c
parentae5e1d984109d0b0d8356416d74b51c4f5311d2a (diff)
downloadsamba-c594d21fdaea3fcee11afddc4f0d3e8c065db815.tar.gz
samba-c594d21fdaea3fcee11afddc4f0d3e8c065db815.tar.bz2
samba-c594d21fdaea3fcee11afddc4f0d3e8c065db815.zip
Add tldap_search_va
Diffstat (limited to 'source3/lib/tldap_util.c')
-rw-r--r--source3/lib/tldap_util.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index f4fffb57d4..f3a8c71216 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -325,22 +325,19 @@ const char *tldap_errstr(TALLOC_CTX *mem_ctx, struct tldap_context *ld, int rc)
return res;
}
-int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope,
- const char *attrs[], int num_attrs, int attrsonly,
- TALLOC_CTX *mem_ctx, struct tldap_message ***res,
- const char *fmt, ...)
+int tldap_search_va(struct tldap_context *ld, const char *base, int scope,
+ const char *attrs[], int num_attrs, int attrsonly,
+ TALLOC_CTX *mem_ctx, struct tldap_message ***res,
+ const char *fmt, va_list ap)
{
- va_list ap;
char *filter;
int ret;
- va_start(ap, fmt);
filter = talloc_vasprintf(talloc_tos(), fmt, ap);
- va_end(ap);
-
if (filter == NULL) {
return TLDAP_NO_MEMORY;
}
+
ret = tldap_search(ld, base, scope, filter,
attrs, num_attrs, attrsonly,
NULL /*sctrls*/, 0, NULL /*cctrls*/, 0,
@@ -350,6 +347,21 @@ int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope,
return ret;
}
+int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope,
+ const char *attrs[], int num_attrs, int attrsonly,
+ TALLOC_CTX *mem_ctx, struct tldap_message ***res,
+ const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = tldap_search_va(ld, base, scope, attrs, num_attrs, attrsonly,
+ mem_ctx, res, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+
bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
uint64_t *presult)
{