fix: execute: remove osh_warn on tainted params to avoid exposing arguments on coding error

This commit is contained in:
Stéphane Lesimple 2021-02-15 11:17:55 +00:00 committed by Stéphane Lesimple
parent fbe7461fcb
commit 4624f71ea2

View file

@ -67,7 +67,6 @@ sub execute {
}
=cut
#=cut only to debug tainted stuff
require Scalar::Util;
foreach (@$cmd) {
if (Scalar::Util::tainted($_) && /(.+)/) {
@ -75,12 +74,9 @@ sub execute {
# to be able to warn under -T; untaint it. we're going to crash right after anyway.
require Carp;
warn(Carp::longmess("would exec <" . join('^', @$cmd) . "> but param '$1' is tainted!"));
osh_warn("about to execute a cmd but param '$1' is tainted, I'm gonna crash!");
}
}
#=cut
if ($system) {
my $child_exit_status = system(@$cmd);
$fnret = sysret2human($child_exit_status);