Do not use quotemeta
on cmdv4
and cmdv6
arguments
`quotemeta` prevents executing commands with arguments. With this change, it is now possible to get an IP address with: usev4=cmdv4 cmdv4="dig +short myip.opendns.com @resolver1.opendns.com"
This commit is contained in:
parent
17fc4c0a35
commit
ae01ba26c1
1 changed files with 2 additions and 4 deletions
|
@ -3343,8 +3343,7 @@ sub get_ipv4 {
|
|||
warning("'--cmd-skip' ignored for '--usev4=$p{'usev4'}'")
|
||||
if opt('verbose') && defined($p{'cmd-skip'});
|
||||
if ($arg) {
|
||||
my $sys_cmd = quotemeta($arg);
|
||||
$reply = qx{$sys_cmd};
|
||||
$reply = qx{$arg};
|
||||
$reply = '' if $?;
|
||||
}
|
||||
} elsif ($p{'usev4'} eq 'webv4') {
|
||||
|
@ -3457,8 +3456,7 @@ sub get_ipv6 {
|
|||
warning("'--cmd-skip' ignored for '--usev6=$p{'usev6'}'")
|
||||
if opt('verbose') && defined($p{'cmd-skip'});
|
||||
if ($arg) {
|
||||
my $sys_cmd = quotemeta($arg);
|
||||
$reply = qx{$sys_cmd};
|
||||
$reply = qx{$arg};
|
||||
$reply = '' if $?;
|
||||
}
|
||||
} elsif ($p{'usev6'} eq 'webv6' || $p{'usev6'} eq 'web') {
|
||||
|
|
Loading…
Reference in a new issue