From 26d47d4a1302b4cc3634f802d18a9b21102d21be Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 28 Aug 2010 18:05:03 +0000 Subject: [PATCH] Avoid spurious warning messages. Only display the messages from stderr if the passwords do not match. --- tests/common/compare_file.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/common/compare_file.pl b/tests/common/compare_file.pl index 0afb40a5..eb498d32 100755 --- a/tests/common/compare_file.pl +++ b/tests/common/compare_file.pl @@ -17,9 +17,12 @@ 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 2>tmp/openssl.err|; chomp $checkpass; + system "cat tmp/openssl.err" + if ($checkpass ne $cryptpass); + system "rm -f tmp/openssl.err"; die "Wrong password for $user: '$cryptpass'. Expected password: '$checkpass'\n" if ($checkpass ne $cryptpass); } else {