diff options
Diffstat (limited to 'contrib/perl5/lib')
-rw-r--r-- | contrib/perl5/lib/Sys/Hostname.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/perl5/lib/Sys/Hostname.pm b/contrib/perl5/lib/Sys/Hostname.pm index 95f9a99a7abf..f8e90959f473 100644 --- a/contrib/perl5/lib/Sys/Hostname.pm +++ b/contrib/perl5/lib/Sys/Hostname.pm @@ -93,14 +93,20 @@ sub hostname { # method 3 - trusty old hostname command || eval { + $pathstack = $ENV{'PATH'}; + $ENV{'PATH'} = "/bin:/usr/bin"; local $SIG{__DIE__}; $host = `(hostname) 2>/dev/null`; # bsdish + $ENV{'PATH'} = $pathstack; } # method 4 - sysV uname command (may truncate) || eval { + $pathstack = $ENV{'PATH'}; + $ENV{'PATH'} = "/bin:/usr/bin"; local $SIG{__DIE__}; $host = `uname -n 2>/dev/null`; ## sysVish + $ENV{'PATH'} = $pathstack; } # method 5 - Apollo pre-SR10 |