用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
845 B

#################### Perl module starts ####################
perl;
my $d_dir = $ENV{'datadir'};
my $s_pattern = $ENV{'search_pattern'};
my $filename = $ENV{'ts_name'};
my $ts_filename="$d_dir/$filename";
open TS_FILE, "<$ts_filename" or die "$!";
@lines = <TS_FILE>;
close TS_FILE;
my $vardir = $ENV{'MYSQLTEST_VARDIR'};
my $filename="$vardir/tmpfile.txt";
open(OP_FILE, '>', $filename) or die "$!";
my $found = 0;
foreach $line (@lines) {
chomp( $line );
print OP_FILE;
if($line =~ /$s_pattern/) {
$found=1;
}
}
if ($found == 1) {
print OP_FILE "table space is Unencrypted.\n";
} else {
print OP_FILE "table space is Encrypted.\n";
}
close OP_FILE;
EOF
#################### Perl module ends ####################
--echo # Print result
cat_file $MYSQLTEST_VARDIR/tmpfile.txt;