Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sympa_test_ldap.pl misses bind password #558

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/bin/sympa_test_ldap.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ if ($options{use_start_tls}) {
delete $options{use_start_tls};
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'}) {
local $SIG{TERM} = sub { system qw(stty echo) };
system qw(stty -echo);
Expand All @@ -90,6 +79,17 @@ if ($options{'bind_dn'} and not $options{'bind_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);

$db->connect or die sprintf "Connect impossible: %s\n", ($db->error || '');
Expand Down