autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debian-specific Autoconf patches


From: Paul Eggert
Subject: Re: Debian-specific Autoconf patches
Date: Tue, 30 May 2006 18:33:53 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> let's just revert all these changes, so we can release 2.60 without
> headaches;

I installed the following patch, which should fix all the headaches
reported so far in this area (and thanks for reporting them).  This
isn't the same as reverting all these changes, but it's getting
closer.  We're going to have headaches no matter what, as far as this
quoting issue goes; I don't yet see why the currently-installed
changes make things worse.

2006-05-30  Paul Eggert  <address@hidden>

        * 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>.

--- general.m4  30 May 2006 07:38:17 -0000      1.922
+++ general.m4  31 May 2006 01:28:06 -0000      1.923
@@ -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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]