]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_python: Anchor with a space so we don't mangle the middle of flags
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Thu, 22 Oct 2020 09:27:43 +0000 (10:27 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Thu, 22 Oct 2020 09:27:43 +0000 (10:27 +0100)
See #3693

src/modules/rlm_python/configure
src/modules/rlm_python/configure.ac

index c4a9134fa8f61a68b052182c5e8332388dbbae96..736a197439d61b48a254a461e69df648e021802e 100755 (executable)
@@ -2780,15 +2780,16 @@ test -n "$PYTHON_CONFIG_BIN" || PYTHON_CONFIG_BIN="not-found"
                { $as_echo "$as_me:${as_lineno-$LINENO}: ${PYTHON_CONFIG_BIN}'s cflags were \"${python_cflags}\"" >&5
 $as_echo "$as_me: ${PYTHON_CONFIG_BIN}'s cflags were \"${python_cflags}\"" >&6;}
 
-                                                                                                                                                               mod_cflags=`echo $python_cflags | sed -e '\
-                       s/-I/-isystem/g;\
-                       s/-isysroot[ =]\{0,1\}[^-]*//g;\
-                       s/-O[^[[:blank:]]]*//g;\
-                       s/-Wp,-D_FORTIFY_SOURCE=[[:digit:]]//g;\
-                       s/-g[^ ]*//g;\
-                       s/-W[^ ]*//g;\
-                       s/-DNDEBUG[[:blank:]]*//g;\
-                       s/-fstack-clash-protection[[:blank:]]*//g;
+                                                                                                                                                               mod_cflags=`echo " $python_cflags" | sed -e '\
+                       s/ -I/ -isystem/g;\
+                       s/ -isysroot[ =]\{0,1\}[^-]*//g;\
+                       s/ -O[^[[:blank:]]]*//g;\
+                       s/ -Wp,-D_FORTIFY_SOURCE=[[:digit:]]//g;\
+                       s/ -g[^ ]*//g;\
+                       s/ -W[^ ]*//g;\
+                       s/ -DNDEBUG[[:blank:]]*//g;\
+                       s/ -frecord-gcc-switches//g;\
+                       s/ -fstack-clash-protection[[:blank:]]*//g;
                        '`
                { $as_echo "$as_me:${as_lineno-$LINENO}: Sanitized cflags were \"${mod_cflags}\"" >&5
 $as_echo "$as_me: Sanitized cflags were \"${mod_cflags}\"" >&6;}
index 8607421a8ad2e3435a551ac912f4798e51978e60..8b4d16a6bdbba49a1e803a747f15ee589f96f5d0 100644 (file)
@@ -49,15 +49,16 @@ if test x$with_[]modname != xno; then
                dnl # Strip -DNDEBUG
                dnl # Strip -stack-clash-protection.  We don't need it for our module and it's not
                dnl # supported by clang < 11.
-               mod_cflags=`echo $python_cflags | sed -e '\
-                       s/-I/-isystem/g;\
-                       s/-isysroot[[ =]]\{0,1\}[[^-]]*//g;\
-                       s/-O[[^[[:blank:]]]]*//g;\
-                       s/-Wp,-D_FORTIFY_SOURCE=[[[:digit:]]]//g;\
-                       s/-g[[^ ]]*//g;\
-                       s/-W[[^ ]]*//g;\
-                       s/-DNDEBUG[[[:blank:]]]*//g;\
-                       s/-fstack-clash-protection[[[:blank:]]]*//g;
+               mod_cflags=`echo " $python_cflags" | sed -e '\
+                       s/ -I/ -isystem/g;\
+                       s/ -isysroot[[ =]]\{0,1\}[[^-]]*//g;\
+                       s/ -O[[^[[:blank:]]]]*//g;\
+                       s/ -Wp,-D_FORTIFY_SOURCE=[[[:digit:]]]//g;\
+                       s/ -g[[^ ]]*//g;\
+                       s/ -W[[^ ]]*//g;\
+                       s/ -DNDEBUG[[[:blank:]]]*//g;\
+                       s/ -frecord-gcc-switches//g;\
+                       s/ -fstack-clash-protection[[[:blank:]]]*//g;
                        '`
                AC_MSG_NOTICE([Sanitized cflags were \"${mod_cflags}\"])