From bab3f92304d4ffb89e207440c6fe8b8b5d1d7d59 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 11 Feb 2008 19:44:02 +0000 Subject: [PATCH] Accept password file with multiple password specified as @PASS_DES ...@ --- tests/common/compare_file.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/common/compare_file.pl b/tests/common/compare_file.pl index 349f9457..dd0ba1f4 100755 --- a/tests/common/compare_file.pl +++ b/tests/common/compare_file.pl @@ -8,9 +8,12 @@ my $file = join "", ; my $today = int(time()/(24*3600)); $template =~ s/\@TODAY\@/$today/g; -if ($template =~ m/(.*):\@PASS_DES (.*)\@:/m) { - my $user = $1; - my $pass = $2; +my $tmp = $template; +while ($tmp =~ m/^(.*?)([^\n]*):\@PASS_DES ([^:]*)\@:(.*)$/s) { + my $user = $2; + my $pass = $3; + $tmp = $4; + if ($file =~ m/^$user:/m) { $file =~ s/^$user:([^:]*):(.*)$/$user:\@PASS_DES $pass\@:$2/m; my $cryptpass = $1; # Check the password