diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-08-05 11:38:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:24 -0500 |
commit | 8ac0237eba1831c8ba6d01c2b9d8402636a21bb2 (patch) | |
tree | a1985decd8420a9f8bb2e5b8d3f0c297c7e0311f /source4/lib/ldb/tools | |
parent | 817610f38540fb99595f6e3b77b9f6696f9e3b3f (diff) | |
download | samba-8ac0237eba1831c8ba6d01c2b9d8402636a21bb2.tar.gz samba-8ac0237eba1831c8ba6d01c2b9d8402636a21bb2.tar.bz2 samba-8ac0237eba1831c8ba6d01c2b9d8402636a21bb2.zip |
r17420: add client support for the LDAP_SERVER_DOMAIN_SCOPE control
metze
(This used to be commit 84e74a759cfa49ebc8b4ba1b8e729d6d920fc55a)
Diffstat (limited to 'source4/lib/ldb/tools')
-rw-r--r-- | source4/lib/ldb/tools/cmdline.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index 0901c7bbf2..c470c64703 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -414,8 +414,8 @@ struct ldb_control **parse_controls(void *mem_ctx, char **control_strings) p = &(control_strings[i][15]); ret = sscanf(p, "%d:%u", &crit, &search_options); - if ((ret != 2) || (crit < 0) || (crit > 1) || (search_options < 0) || (search_options > 0x0FFFFFFFF)) { - fprintf(stderr, "invalid sd_flags control syntax\n"); + if ((ret != 2) || (crit < 0) || (crit > 1) || (search_options < 0) || (search_options > 0xF)) { + fprintf(stderr, "invalid search_options control syntax\n"); fprintf(stderr, " syntax: crit(b):search_options(n)\n"); fprintf(stderr, " note: b = boolean, n = number\n"); return NULL; @@ -431,6 +431,27 @@ struct ldb_control **parse_controls(void *mem_ctx, char **control_strings) continue; } + if (strncmp(control_strings[i], "domain_scope:", 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 domain_scope control syntax\n"); + fprintf(stderr, " syntax: crit(b)\n"); + fprintf(stderr, " note: b = boolean\n"); + return NULL; + } + + ctrl[i] = talloc(ctrl, struct ldb_control); + ctrl[i]->oid = LDB_CONTROL_DOMAIN_SCOPE_OID; + ctrl[i]->critical = crit; + ctrl[i]->data = NULL; + + continue; + } + if (strncmp(control_strings[i], "paged_results:", 14) == 0) { struct ldb_paged_control *control; const char *p; |