summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-06-26 16:14:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:18:57 -0500
commit72bc37cfa4fac9546326b3d0b2a4054b6d8a71b4 (patch)
treea82eeafd8a19d349ad06142368da4aadfb6e32fd /examples
parent7e76f785f8fa3bb53e6024ecab0cb4c7f0de820b (diff)
downloadsamba-72bc37cfa4fac9546326b3d0b2a4054b6d8a71b4.tar.gz
samba-72bc37cfa4fac9546326b3d0b2a4054b6d8a71b4.tar.bz2
samba-72bc37cfa4fac9546326b3d0b2a4054b6d8a71b4.zip
r16521: Fix different extended_dn handling for win2k/2k3 (thanks to Frederic
Brin at Novell). Guenther (This used to be commit f19f781e15da98cfaa94c71fc455fe095dac7b4d)
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/misc/adssearch.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/misc/adssearch.pl b/examples/misc/adssearch.pl
index a26bb3b6c4..6a677fa205 100755
--- a/examples/misc/adssearch.pl
+++ b/examples/misc/adssearch.pl
@@ -87,7 +87,7 @@ GetOptions(
'base|b=s' => \$opt_base,
'D|DN=s' => \$opt_binddn,
'debug=i' => \$opt_debug,
- 'extendeddn|e' => \$opt_display_extendeddn,
+ 'extendeddn|e=i' => \$opt_display_extendeddn,
'help' => \$opt_help,
'host|h=s' => \$opt_host,
'machine|P' => \$opt_machine,
@@ -1396,12 +1396,12 @@ sub gen_controls {
>
);
- my $ctl_extended_dn_val = $asn_extended_dn->encode( mode => '1');
- my $ctl_extended_dn =Net::LDAP::Control->new(
- type => $ads_controls{'LDAP_SERVER_EXTENDED_DN_OID'},
- critical => 'true',
- value => $ctl_extended_dn_val);
-
+ # only w2k3 accepts '1' and needs the ctl_val, w2k does not accept a ctl_val
+ my $ctl_extended_dn_val = $asn_extended_dn->encode( mode => $opt_display_extendeddn);
+ my $ctl_extended_dn = Net::LDAP::Control->new(
+ type => $ads_controls{'LDAP_SERVER_EXTENDED_DN_OID'},
+ critical => 'true',
+ value => $opt_display_extendeddn ? $ctl_extended_dn_val : "");
# setup notify control
my $ctl_notification = Net::LDAP::Control->new(
@@ -1421,7 +1421,7 @@ sub gen_controls {
push(@ctrls_s, "LDAP_PAGED_RESULT_OID_STRING" );
}
- if ($opt_display_extendeddn) {
+ if (defined($opt_display_extendeddn)) {
push(@ctrls, $ctl_extended_dn);
push(@ctrls_s, "LDAP_SERVER_EXTENDED_DN_OID");
}