automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. Release-1-


From: Ralf Wildenhues
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. Release-1-10-235-ge9a942a
Date: Thu, 27 Nov 2008 21:01:11 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=e9a942a19485b83690596cc8ae375b86777eaf9e

The branch, master has been updated
       via  e9a942a19485b83690596cc8ae375b86777eaf9e (commit)
      from  21072002ed61ffc230faab3fa3f0ef720b436965 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e9a942a19485b83690596cc8ae375b86777eaf9e
Author: Ralf Wildenhues <address@hidden>
Date:   Thu Nov 27 21:46:36 2008 +0100

    Cope with whitespace in $MISSING and $install_sh.
    
    * configure.ac (am_AUTOHEADER): New substitution, save the value
    of $AUTOHEADER before AM_INIT_AUTOMAKE may add $MISSING.
    * tests/defs.in: Use am_AUTOHEADER.
    * lib/am/install.am: Fix typo.
    * m4/install-sh.m4 (AM_PROG_INSTALL_SH): Add suitable
    single-quote quoting to install_sh, but only if needed.
    * m4/missing.m4 (AM_MISSING_HAS_RUN): Add suitable double-quote
    quoting to MISSING, but only if needed.
    * m4/sanity.m4 (AM_SANITY_CHECK): Abort configure if `pwd` or
    $srcdir contain shell meta-characters that cannot be handled;
    space and tab are allowed in the former only.
    * tests/sanity.test: New test.
    * tests/Makefile.am: Adjust.
    * NEWS: Update.
    Reports by Jim Meyering and others.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog                           |   20 ++++++++++++++++
 Makefile.in                         |    1 +
 NEWS                                |   11 ++++++++
 configure                           |   44 +++++++++++++++++++++++++++++++----
 configure.ac                        |    3 +-
 doc/Makefile.in                     |    1 +
 lib/Automake/Makefile.in            |    1 +
 lib/Automake/tests/Makefile.in      |    1 +
 lib/Makefile.in                     |    1 +
 lib/am/Makefile.in                  |    1 +
 lib/am/install.am                   |    4 +-
 m4/Makefile.in                      |    1 +
 m4/install-sh.m4                    |   11 +++++++-
 m4/missing.m4                       |   13 ++++++++--
 m4/sanity.m4                        |   21 +++++++++++++---
 tests/Makefile.am                   |    1 +
 tests/Makefile.in                   |    2 +
 tests/defs.in                       |    2 +-
 tests/{python5.test => sanity.test} |   36 ++++++++++++++++++----------
 19 files changed, 144 insertions(+), 31 deletions(-)
 copy tests/{python5.test => sanity.test} (61%)

diff --git a/ChangeLog b/ChangeLog
index ef7f710..c31e083 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2008-11-27  Ralf Wildenhues  <address@hidden>
+           Jim Meyering  <address@hidden>
+
+       Cope with whitespace in $MISSING and $install_sh.
+       * configure.ac (am_AUTOHEADER): New substitution, save the value
+       of $AUTOHEADER before AM_INIT_AUTOMAKE may add $MISSING.
+       * tests/defs.in: Use am_AUTOHEADER.
+       * lib/am/install.am: Fix typo.
+       * m4/install-sh.m4 (AM_PROG_INSTALL_SH): Add suitable
+       single-quote quoting to install_sh, but only if needed.
+       * m4/missing.m4 (AM_MISSING_HAS_RUN): Add suitable double-quote
+       quoting to MISSING, but only if needed.
+       * m4/sanity.m4 (AM_SANITY_CHECK): Abort configure if `pwd` or
+       $srcdir contain shell meta-characters that cannot be handled;
+       space and tab are allowed in the former only.
+       * tests/sanity.test: New test.
+       * tests/Makefile.am: Adjust.
+       * NEWS: Update.
+       Reports by Jim Meyering and others.
+
 2008-11-24  Ralf Wildenhues  <address@hidden>
 
        Let `missing' also work with versioned and prefixed programs.
diff --git a/Makefile.in b/Makefile.in
index 7f8b810..375bf9b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -172,6 +172,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/NEWS b/NEWS
index 8e0d027..e566172 100644
--- a/NEWS
+++ b/NEWS
@@ -127,6 +127,17 @@ New in 1.10a:
 
   - The `missing' script works better with versioned tool names.
 
+  - Automake's early configure-time sanity check now diagnoses an
+    unsafe absolute source directory name and makes configure fail.
+
+  - The Automake macros and rules cope better with whitespace in the
+    current directory name, as long as the relative path to `configure'
+    does not contain whitespace.  To this end, the values of `$(MISSING)'
+    and `$(install_sh)' may contain suitable quoting, and their expansion
+    might need `eval'uation if used outside of a makefile.  These
+    undocumented variables may be used in several documented macros such
+    as $(AUTOCONF) or $(MAKEINFO).
+
 Bugs fixed in 1.10a:
 
 * Long standing bugs:
diff --git a/configure b/configure
index 73994bd..8247805 100755
--- a/configure
+++ b/configure
@@ -637,6 +637,7 @@ am__isrc
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
+am_AUTOHEADER
 am_AUTOCONF
 build_os
 build_vendor
@@ -1839,9 +1840,11 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 
's/ /-/g'`;; esac
 
 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
 # way we can run Autoconf tests from configure (or from the test
-# suite) without being bothered by `missing'.
+# suite) without being bothered by `missing'.  Likewise for autoheader.
 am_AUTOCONF="${AUTOCONF-autoconf}"
 
+am_AUTOHEADER="${AUTOHEADER-autoheader}"
+
 
 am__api_version='1.10a'
 
@@ -1943,16 +1946,33 @@ $as_echo_n "checking whether build environment is 
sane... " >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory 
name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$*" != "X $srcdir/configure conftest.file" \
@@ -1996,7 +2016,14 @@ program_transform_name=`$as_echo 
"$program_transform_name" | sed "$ac_script"`
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -2188,7 +2215,14 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
 
 # Installed binaries are usually stripped using `strip' when the user
 # run `make install-strip'.  However `strip' might not be the right
diff --git a/configure.ac b/configure.ac
index 3ede853..7073d6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,9 @@ AC_CANONICAL_BUILD
 
 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
 # way we can run Autoconf tests from configure (or from the test
-# suite) without being bothered by `missing'.
+# suite) without being bothered by `missing'.  Likewise for autoheader.
 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
+AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
 
 AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests])
 
diff --git a/doc/Makefile.in b/doc/Makefile.in
index a64f13c..e692797 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -143,6 +143,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index d6498b3..0df4112 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -159,6 +159,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 9675112..efe0811 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -112,6 +112,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 173e13f..2e3c4d8 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -162,6 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index ee54090..dbaf398 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -122,6 +122,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/am/install.am b/lib/am/install.am
index 885ad0b..c114fa5 100644
--- a/lib/am/install.am
+++ b/lib/am/install.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004, 2006  Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008  Free Software Foundation, 
Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -78,7 +78,7 @@ install-am: all-am
 ## directory.
 .MAKE .PHONY: install-strip
 install-strip:
-## Beware that they are two variables used to install programs:
+## Beware that there are two variables used to install programs:
 ##   INSTALL_PROGRAM is used for ordinary *_PROGRAMS
 ##   install_sh_PROGRAM is used for nobase_*_PROGRAMS (because install-sh
 ##                                                     creates directories)
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 1e2de16..a15fd1b 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -122,6 +122,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/m4/install-sh.m4 b/m4/install-sh.m4
index 32c2ebb..b153715 100644
--- a/m4/install-sh.m4
+++ b/m4/install-sh.m4
@@ -1,5 +1,5 @@
 ##                                                          -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -10,5 +10,12 @@
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
 AC_SUBST(install_sh)])
diff --git a/m4/missing.m4 b/m4/missing.m4
index 26fab2a..136399c 100644
--- a/m4/missing.m4
+++ b/m4/missing.m4
@@ -1,13 +1,13 @@
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -24,7 +24,14 @@ AC_SUBST($1)])
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
diff --git a/m4/sanity.m4 b/m4/sanity.m4
index 2e76b10..3d2f304 100644
--- a/m4/sanity.m4
+++ b/m4/sanity.m4
@@ -1,13 +1,13 @@
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # AM_SANITY_CHECK
 # ---------------
@@ -16,16 +16,29 @@ AC_DEFUN([AM_SANITY_CHECK],
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$[*]" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$[*]" != "X $srcdir/configure conftest.file" \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9f9dc32..2a8e847 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -522,6 +522,7 @@ req.test \
 reqd.test \
 reqd2.test \
 rulepat.test \
+sanity.test \
 scripts.test \
 seenc.test \
 sinclude.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 64668e0..c1c67a6 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -113,6 +113,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
+am_AUTOHEADER = @am_AUTOHEADER@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
@@ -675,6 +676,7 @@ req.test \
 reqd.test \
 reqd2.test \
 rulepat.test \
+sanity.test \
 scripts.test \
 seenc.test \
 sinclude.test \
diff --git a/tests/defs.in b/tests/defs.in
index e7d9d39..de0c682 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -69,7 +69,7 @@ export SHELL
 test -z "$PERL" && PERL='@PERL@'
 test -z "$MAKE" && MAKE=make
 test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
-test -z "$AUTOHEADER" && AUTOHEADER="@AUTOHEADER@"
+test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
 test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
 test -z "$MISSING" && MISSING=`pwd`/../lib/missing
 # Use -Werror because this also turns some Perl warnings into error.
diff --git a/tests/python5.test b/tests/sanity.test
similarity index 61%
copy from tests/python5.test
copy to tests/sanity.test
index af79377..0d3830d 100755
--- a/tests/python5.test
+++ b/tests/sanity.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,26 +14,36 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test detection of missing Python.
-# Same as python4.test, but requiring a version.
+# Unsafe absolute directory names should be diagnosed.
 
-# Python is not required for this test.
 . ./defs || Exit 1
 
 set -e
 
-cat >>configure.in <<EOF
-# Hopefully the Python team will never release such a version.
-AM_PATH_PYTHON(9999.9)
-AC_OUTPUT
-EOF
+mkdir 'unsafe$'
+cd 'unsafe$'
+
+cat > configure.in << 'END'
+AC_INIT([sanity], [1.0])
+AM_INIT_AUTOMAKE([foreign])
+AC_OUTPUT(Makefile)
+END
+
+cp ../install-sh ../missing .
 
 : > Makefile.am
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --add-missing
-
+$AUTOMAKE
 ./configure 2>stderr && { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'no suitable Python interpreter found' stderr
+cat stderr
+grep 'unsafe absolute working directory' stderr
+
+cd ..
+mkdir build
+cd build
+../unsafe$/configure 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr
+grep 'unsafe srcdir' stderr
+:


hooks/post-receive
--
GNU Automake




reply via email to

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