[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Wed Aug 31 14:44:18 UTC 2016


The branch OpenSSL_1_1_0-stable has been updated
       via  bbf007488749581fbb1a2998279cb9cafc93791f (commit)
      from  5410190ccbb410b7eb391b9182d2f2eb57e0c6c6 (commit)


- Log -----------------------------------------------------------------
commit bbf007488749581fbb1a2998279cb9cafc93791f
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Aug 30 18:41:00 2016 +0200

    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 at openssl.org>
    (cherry picked from commit f879d5ff38d3c2283db968ea57c7a3207cc05889)

-----------------------------------------------------------------------

Summary of changes:
 Configure | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Configure b/Configure
index b88f6aa..1331360 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("\" \"", at templates)."\" > \"$out.new\"";
+    my $perlcmd = (quotify("maybeshell", $config{perl}))[0];
+    my $cmd = "$perlcmd \"-I.\" \"-Mconfigdata\" \"$dofile\" -o\"Configure\" \"".join("\" \"", at 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 =


More information about the openssl-commits mailing list