diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-08-05 11:18:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:24 -0500 |
commit | 817610f38540fb99595f6e3b77b9f6696f9e3b3f (patch) | |
tree | 7bdd6e7483a0b7433d7169545915e76cbb1f350d /source4/lib/ldb/tools | |
parent | b4028ca1041fc8e0266de2f5c858dd40e660aafb (diff) | |
download | samba-817610f38540fb99595f6e3b77b9f6696f9e3b3f.tar.gz samba-817610f38540fb99595f6e3b77b9f6696f9e3b3f.tar.bz2 samba-817610f38540fb99595f6e3b77b9f6696f9e3b3f.zip |
r17419: add client support for the LDAP_SERVER_SEARCH_OPTIONS support.
with this you can limit a search to a specific partitions
or a search over all partitions without getting referrals.
(Witch is the default behavior on the Global Catalog Port)
metze
(This used to be commit 4ccd0f8171f3748ee6efe1abd3f894d2cdf46bf4)
Diffstat (limited to 'source4/lib/ldb/tools')
-rw-r--r-- | source4/lib/ldb/tools/cmdline.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index d5a52cf370..0901c7bbf2 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -406,6 +406,31 @@ struct ldb_control **parse_controls(void *mem_ctx, char **control_strings) continue; } + if (strncmp(control_strings[i], "search_options:", 15) == 0) { + struct ldb_search_options_control *control; + const char *p; + int crit, ret; + unsigned search_options; + + 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"); + fprintf(stderr, " syntax: crit(b):search_options(n)\n"); + fprintf(stderr, " note: b = boolean, n = number\n"); + return NULL; + } + + ctrl[i] = talloc(ctrl, struct ldb_control); + ctrl[i]->oid = LDB_CONTROL_SEARCH_OPTIONS_OID; + ctrl[i]->critical = crit; + control = talloc(ctrl[i], struct ldb_search_options_control); + control->search_options = search_options; + ctrl[i]->data = control; + + continue; + } + if (strncmp(control_strings[i], "paged_results:", 14) == 0) { struct ldb_paged_control *control; const char *p; |