Commit 996dc0e8 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

sympa_test_ldap: If --bind_dn was given but not --bind_password, password...

sympa_test_ldap: If --bind_dn was given but not --bind_password, password prompt is shown. However, input password was ignored.
parent 16aa7767
...@@ -67,17 +67,6 @@ if ($options{use_start_tls}) { ...@@ -67,17 +67,6 @@ if ($options{use_start_tls}) {
delete $options{use_start_tls}; delete $options{use_start_tls};
delete $options{use_ssl}; delete $options{use_ssl};
my $db = Sympa::Database->new('LDAP', %options);
unless ($db
and defined $options{'suffix'}
and defined $options{'filter'}) {
pod2usage(-exitval => 1, -output => \*STDERR);
}
print join ' ',
map { sprintf '%s=%s', $_, $options{$_} } qw(host suffix filter);
print "\n";
if ($options{'bind_dn'} and not $options{'bind_password'}) { if ($options{'bind_dn'} and not $options{'bind_password'}) {
local $SIG{TERM} = sub { system qw(stty echo) }; local $SIG{TERM} = sub { system qw(stty echo) };
system qw(stty -echo); system qw(stty -echo);
...@@ -90,6 +79,17 @@ if ($options{'bind_dn'} and not $options{'bind_password'}) { ...@@ -90,6 +79,17 @@ if ($options{'bind_dn'} and not $options{'bind_password'}) {
$options{'bind_password'} = $password; $options{'bind_password'} = $password;
} }
my $db = Sympa::Database->new('LDAP', %options);
unless ($db
and defined $options{'suffix'}
and defined $options{'filter'}) {
pod2usage(-exitval => 1, -output => \*STDERR);
}
print join ' ',
map { sprintf '%s=%s', $_, $options{$_} } qw(host suffix filter);
print "\n";
my ($mesg, $res); my ($mesg, $res);
$db->connect or die sprintf "Connect impossible: %s\n", ($db->error || ''); $db->connect or die sprintf "Connect impossible: %s\n", ($db->error || '');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment