Make sure ./config passes options to ./Configure correctly
authorRichard Levitte <levitte@openssl.org>
Thu, 30 Nov 2017 07:20:02 +0000 (08:20 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 7 Dec 2017 23:36:21 +0000 (00:36 +0100)
This is, even when they contain spaces or all kinds of funny quotes

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4818)

config

diff --git a/config b/config
index a341af2d616816b445426d826ea86a4da1e8d8bd..00f90876118383224f0bd0e1b1f38246da700092 100755 (executable)
--- a/config
+++ b/config
@@ -35,7 +35,8 @@ See INSTALL for instructions.
 
 EOF
 ;;
-*) options=$options" $i" ;;
+*)  i=`echo "$i" | sed -e "s|'|'\\\\\\''|g"`
+    options="$options '$i'" ;;
 esac
 done
 
@@ -902,7 +903,9 @@ if [ $? = "0" ]; then
     echo $PERL $THERE/Configure $OUT $options
   fi  
   if [ "$DRYRUN" = "false" ]; then
-    $PERL $THERE/Configure $OUT $options
+    # eval to make sure quoted options, possibly with spaces inside,
+    # are treated right
+    eval $PERL $THERE/Configure $OUT $options
   fi
 else
   echo "This system ($OUT) is not supported. See file INSTALL for details."