Skip to content

Commit

Permalink
r23818: support LDAP_SERVER_SEARCH_OPTIONS_OID in adssearch.
Browse files Browse the repository at this point in the history
Guenther
(This used to be commit 0f0200c)
  • Loading branch information
gd authored and Gerald (Jerry) Carter committed Oct 10, 2007
1 parent f406b66 commit b8d696e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/misc/adssearch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ BEGIN
$opt_port,
$opt_realm,
$opt_saslmech,
$opt_search_opt,
$opt_scope,
$opt_simpleauth,
$opt_starttls,
Expand Down Expand Up @@ -108,6 +109,7 @@ BEGIN
'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,
Expand Down Expand Up @@ -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'},
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b8d696e

Please sign in to comment.