summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-08-30 18:41:00 +0200
committerRichard Levitte <levitte@openssl.org>2016-08-31 16:43:26 +0200
commitf879d5ff38d3c2283db968ea57c7a3207cc05889 (patch)
tree2e27d79d7fa7ab7a107ecc0abd7e2e185ea08cfb /Configure
parentbde588df8a4d9f714cefe9cfd1a3931558de4c3c (diff)
The Perl interpreter might be in a path with spaces, so maybe quote it
Note: some shells do not like the command verb to be quoted, so we avoid it unless it's actually necessary. RT#4665 Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure11
1 files changed, 10 insertions, 1 deletions
diff --git a/Configure b/Configure
index b88f6aad42..133136077d 100755
--- a/Configure
+++ b/Configure
@@ -2398,7 +2398,8 @@ sub run_dofile
foreach (@templates) {
die "Can't open $_, $!" unless -f $_;
}
- my $cmd = "$config{perl} \"-I.\" \"-Mconfigdata\" \"$dofile\" -o\"Configure\" \"".join("\" \"",@templates)."\" > \"$out.new\"";
+ my $perlcmd = (quotify("maybeshell", $config{perl}))[0];
+ my $cmd = "$perlcmd \"-I.\" \"-Mconfigdata\" \"$dofile\" -o\"Configure\" \"".join("\" \"",@templates)."\" > \"$out.new\"";
#print STDERR "DEBUG[run_dofile]: \$cmd = $cmd\n";
system($cmd);
exit 1 if $? != 0;
@@ -2558,6 +2559,14 @@ sub quotify {
perl => sub { my $x = shift;
$x =~ s/([\\\$\@"])/\\$1/g;
return '"'.$x.'"'; },
+ maybeshell => sub { my $x = shift;
+ (my $y = $x) =~ s/([\\\"])/\\$1/g;
+ if ($x ne $y || $x =~ m|\s|) {
+ return '"'.$y.'"';
+ } else {
+ return $x;
+ }
+ },
);
my $for = shift;
my $processor =