Switched macro to use new nesting mechanism.
This commit is contained in:
parent
85cdb5bd0c
commit
147aac791a
51 changed files with 133 additions and 435 deletions
|
|
@ -13,24 +13,14 @@ package WebGUI::Macro::Execute;
|
|||
use strict;
|
||||
use WebGUI::Macro;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp);
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /WebGUI.conf/) {
|
||||
$temp = "SECURITY VIOLATION";
|
||||
} else {
|
||||
$temp = `$param[0]`;
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^Execute\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
my @param = WebGUI::Macro::getParams($_[0]);
|
||||
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /\.conf/) {
|
||||
return "SECURITY VIOLATION";
|
||||
} else {
|
||||
return `$param[0]`;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue