From 828ee2bc6fa4f757c63a31054a0046fe09f8c26e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Jan 2006 18:56:04 +0000 Subject: r12984: add parse code and ldbsearch cmdline code for NOTIFICATION LDAP Controls http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ldap/ldap/ldap_server_notification_oid.asp this doesn't work yet, but it shows that we need to extend ldb to correctly handle async requests... metze (This used to be commit 1fe67189490c9faf499b68a28071a6294a53db0e) --- source4/lib/ldb/tools/ldbsearch.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source4/lib/ldb/tools') diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c index df895350ee..df14aac0b2 100644 --- a/source4/lib/ldb/tools/ldbsearch.c +++ b/source4/lib/ldb/tools/ldbsearch.c @@ -216,6 +216,25 @@ static struct ldb_control **parse_controls(void *mem_ctx, char **control_strings continue; } + if (strncmp(control_strings[i], "notification:", 13) == 0) { + const char *p; + int crit, ret; + + p = &(control_strings[i][13]); + ret = sscanf(p, "%d", &crit); + if ((ret != 1) || (crit < 0) || (crit > 1)) { + fprintf(stderr, "invalid notification control syntax\n"); + return NULL; + } + + ctrl[i] = talloc(ctrl, struct ldb_control); + ctrl[i]->oid = LDB_CONTROL_NOTIFICATION_OID; + ctrl[i]->critical = crit; + ctrl[i]->data = NULL; + + continue; + } + /* no controls matched, throw an error */ fprintf(stderr, "Invalid control name\n"); return NULL; -- cgit