summaryrefslogtreecommitdiff
path: root/examples/misc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-07-10 15:14:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:28:29 -0500
commitb8d696ebf0beb2dd858ffcb99be8589d2641f446 (patch)
tree37335ca72ff2027de2d5a6bfd85ee4ffa51466b0 /examples/misc
parentf406b6677cab2b84095c28ff447dd8730b0f2b71 (diff)
downloadsamba-b8d696ebf0beb2dd858ffcb99be8589d2641f446.tar.gz
samba-b8d696ebf0beb2dd858ffcb99be8589d2641f446.tar.bz2
samba-b8d696ebf0beb2dd858ffcb99be8589d2641f446.zip
r23818: support LDAP_SERVER_SEARCH_OPTIONS_OID in adssearch.
Guenther (This used to be commit 0f0200c43cdf3f7ced17e2dffdce7f4a4e8f533f)
Diffstat (limited to 'examples/misc')
-rwxr-xr-xexamples/misc/adssearch.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/misc/adssearch.pl b/examples/misc/adssearch.pl
index bf9f75f899..b880366c88 100755
--- a/examples/misc/adssearch.pl
+++ b/examples/misc/adssearch.pl
@@ -77,6 +77,7 @@ my (
$opt_port,
$opt_realm,
$opt_saslmech,
+ $opt_search_opt,
$opt_scope,
$opt_simpleauth,
$opt_starttls,
@@ -108,6 +109,7 @@ GetOptions(
'saslmech|Y=s' => \$opt_saslmech,
'schema|c' => \$opt_dump_schema,
'scope|s=s' => \$opt_scope,
+ 'searchopt:i' => \$opt_search_opt,
'simpleauth|x' => \$opt_simpleauth,
'tls|Z' => \$opt_starttls,
'user|U=s' => \$opt_user,
@@ -1464,6 +1466,21 @@ sub gen_controls {
critical => 'true',
value => $opt_display_extendeddn ? $ctl_extended_dn_val : "");
+ # setup search options
+ my $search_opt = Convert::ASN1->new;
+ $search_opt->prepare(
+ q< searchopt ::= SEQUENCE {
+ flags INTEGER
+ }
+ >
+ );
+
+ my $tmp = $search_opt->encode( flags => $opt_search_opt);
+ my $ctl_search_opt = Net::LDAP::Control->new(
+ type => $ads_controls{'LDAP_SERVER_SEARCH_OPTIONS_OID'},
+ critical => 'true',
+ value => $tmp);
+
# setup notify control
my $ctl_notification = Net::LDAP::Control->new(
type => $ads_controls{'LDAP_SERVER_NOTIFICATION_OID'},
@@ -1506,6 +1523,11 @@ sub gen_controls {
push(@ctrls_s, "LDAP_SERVER_DOMAIN_SCOPE_OID");
}
+ if ($opt_search_opt) {
+ push(@ctrls, $ctl_search_opt);
+ push(@ctrls_s, "LDAP_SERVER_SEARCH_OPTIONS_OID");
+ }
+
return @ctrls;
}