Skip to content

Commit

Permalink
Look around for saslpasswd2 (typically not in the user's path).
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Jan 28, 2012
1 parent b0a858c commit a2ef6b4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion t/binary-sasl.t
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,22 @@ $empty->('x');
# Build the auth DB for testing.
my $sasldb = '/tmp/test-memcached.sasldb';
unlink $sasldb;
system("echo testpass | saslpasswd2 -a memcached -c -p testuser");

my $saslpasswd_path;
for my $dir (split(/:/, $ENV{PATH}),
"/usr/bin",
"/usr/sbin",
"/usr/local/bin",
"/usr/local/sbin",
) {
my $exe = $dir . '/saslpasswd2';
if (-x $exe) {
$saslpasswd_path = $exe;
last;
}
}

system("echo testpass | $saslpasswd_path -a memcached -c -p testuser");

$mc = MC::Client->new;

Expand Down

0 comments on commit a2ef6b4

Please sign in to comment.