Untaint the hostname before trying to use it on a command line.
This commit is contained in:
parent
940ebef14f
commit
9f4d1431c3
@ -355,6 +355,11 @@ MAIN:{
|
||||
chomp($config);
|
||||
$config =~ s/^(\w+)(\..*)?/$1/;
|
||||
$CONFIG{'HOSTNAME'} = `/usr/bin/uname -n`;
|
||||
if ($CONFIG{'HOSTNAME'} =~ m/^([0-9a-z-]+(?:\.[0-9a-z-]+)*)$/) {
|
||||
$CONFIG{'HOSTNAME'} = $1;
|
||||
} else {
|
||||
$CONFIG{'HOSTNAME'} = 'unknown';
|
||||
}
|
||||
if ($ENV{'HOME'} =~ m/^((?:\/[\w\.-]+)+)\/*$/) {
|
||||
$CONFIG{'HOME'} = $1;
|
||||
$etcdir = "$1/etc";
|
||||
|
Loading…
Reference in New Issue
Block a user