From: Jarkko Hietaniemi Date: Sun, 25 May 2003 18:51:00 +0000 (+0000) Subject: Run external commands only with localized sanitized $ENV{PATH}. X-Git-Tag: upstream/5.16.3~24135 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18c8aed301fbcf003fca115a36b4b7ae503d99b6;p=platform%2Fupstream%2Fperl.git Run external commands only with localized sanitized $ENV{PATH}. p4raw-id: //depot/perl@19621 --- diff --git a/ext/Sys/Hostname/Hostname.pm b/ext/Sys/Hostname/Hostname.pm index efc8d38bae..632ea9bb79 100644 --- a/ext/Sys/Hostname/Hostname.pm +++ b/ext/Sys/Hostname/Hostname.pm @@ -72,6 +72,8 @@ sub hostname { else { # Unix # is anyone going to make it here? + local $ENV{PATH} = '/usr/bin:/bin:/usr/sbin:/sbin'; # Paranoia. + # method 2 - syscall is preferred since it avoids tainting problems # XXX: is it such a good idea to return hostname untainted? eval {