]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/general.m4 (_AC_DO_ECHO): Be more conservative
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 31 May 2006 01:28:06 +0000 (01:28 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 31 May 2006 01:28:06 +0000 (01:28 +0000)
about quoting ac_try: quote all of it, if any of it seems suspicious.
This means we don't have to worry about ${ or sed any more.
Also, double-quote the case statement, to work around misuses via
underquoting as reported by Ralf Wildenhues in
<http://lists.gnu.org/archive/html/autoconf-patches/2006-05/msg00169.html>.
(_AC_EVAL_STDERR): Revert, since evidently some packages rely on this
undocumented and dangerous macro.
Problem reported by Ralf Wildenhues in
<http://lists.gnu.org/archive/html/autoconf-patches/2006-05/msg00168.html>.

ChangeLog
lib/autoconf/general.m4

index ad98eb3901a91e42dc9c321f4eee5c1d06740c93..cb6d107abc140097127d214c27dc6eb50b5a2b58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-05-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/autoconf/general.m4 (_AC_DO_ECHO): Be more conservative
+       about quoting ac_try: quote all of it, if any of it seems suspicious.
+       This means we don't have to worry about ${ or sed any more.
+       Also, double-quote the case statement, to work around misuses via
+       underquoting as reported by Ralf Wildenhues in
+       <http://lists.gnu.org/archive/html/autoconf-patches/2006-05/msg00169.html>.
+       (_AC_EVAL_STDERR): Revert, since evidently some packages rely on this
+       undocumented and dangerous macro.
+       Problem reported by Ralf Wildenhues in
+       <http://lists.gnu.org/archive/html/autoconf-patches/2006-05/msg00168.html>.
+
 2006-05-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * lib/m4sugar/m4sh.m4 (_AS_DIRNAME_PREPARE): Check whether
index a1cbce11274eb6c27153fdbf6846d061e46ee9e6..404891bc33462f56dc7b0e8dbc43d705454460b9 100644 (file)
@@ -2149,15 +2149,17 @@ AC_DEFUN([_AC_RUN_LOG_STDERR],
 AC_DEFUN([_AC_DO_ECHO],
 [m4_if([$1], [$ac_try], [], [ac_try="$1"
 ])dnl
-dnl If the string contains '${', '"', '`', or '\', then escape
-dnl $, ", `, and \.  This is a hack, but it is safe and it also
-dnl typically expands substrings like '$CC', which is what we want.
-case $ac_try in #(
-  *\${* | *\"* | *\`* | *\\*)
-    ac_script='s/[[$"`\\]]/\\&/g'
-    ac_try=`echo "$ac_try" | sed "$ac_script"`;;
+dnl If the string contains '"', '`', or '\', then just echo it rather
+dnl than expanding it.  This is a hack, but it is safer, while also
+dnl typically expanding simple substrings like '$CC', which is what we want.
+dnl The rest of this macro body is quoted, to work around misuses like
+dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))',
+dnl which underquotes the 3rd arg and would misbehave if we didn't quote here.
+[case $ac_try in #(
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; #(
+  *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try\""])
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\""]])
 
 # _AC_DO(COMMAND)
 # ---------------
@@ -2198,13 +2200,22 @@ AC_DEFUN([_AC_DO_TOKENS],
 # -----------------
 # Eval COMMAND, save the exit status in ac_status, and log it.
 # Unlike _AC_DO, this macro mishandles quoted arguments in some cases.
-# It is present only to support the backward-compatibility macros
-# AC_TRY_EVAL and AC_TRY_COMMAND.
+# It is present only for backward compatibility with previous Autoconf versions.
 AC_DEFUN([_AC_EVAL],
 [_AC_RUN_LOG([eval $1],
             [eval echo "$as_me:$LINENO: \"$1\""])])
 
 
+# _AC_EVAL_STDERR(COMMAND)
+# ------------------------
+# Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
+# Unlike _AC_DO_STDERR, this macro mishandles quoted arguments in some cases.
+# It is present only for backward compatibility with previous Autoconf versions.
+AC_DEFUN([_AC_EVAL_STDERR],
+[_AC_RUN_LOG_STDERR([eval $1],
+                   [eval echo "$as_me:$LINENO: \"$1\""])])
+
+
 # AC_TRY_EVAL(VARIABLE)
 # ---------------------
 # Evaluate $VARIABLE, which should be a valid shell command.