Quote the salt because it may be an '*' and is expanded to filenames.

This commit is contained in:
nekral-guest
2008-02-27 00:27:18 +00:00
parent aeae21cf6e
commit 57d3f9fa83
+1 -1
View File
@@ -17,7 +17,7 @@ while ($tmp =~ m/^(.*?)([^\n]*):\@PASS_DES ([^:]*)\@:(.*)$/s) {
$file =~ s/^$user:([^:]*):(.*)$/$user:\@PASS_DES $pass\@:$2/m;
my $cryptpass = $1;
# Check the password
my $checkpass = qx|/usr/bin/openssl passwd -crypt -salt $cryptpass $pass|;
my $checkpass = qx|/usr/bin/openssl passwd -crypt -salt '$cryptpass' $pass|;
chomp $checkpass;
die "Wrong password: '$cryptpass'. Expected password: '$checkpass'\n"