Another empty argument through expr workaround.

* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Detect empty
arguments.  Reject empty file argument.
* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Check for missing argument.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake 2010-07-20 08:06:16 -06:00
parent a759826d21
commit 82f7cdadbb
3 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,11 @@
2010-07-20 Eric Blake <eblake@redhat.com>
Another empty argument through expr workaround.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Detect empty
arguments. Reject empty file argument.
* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Check for missing argument.
Also reject ' and newline from AC_INIT strings.
* lib/autoconf/general.m4 (_AC_INIT_LITERAL): Reject a couple more
problematic characters.

View File

@ -1464,11 +1464,16 @@ ac_need_defaults=:
while test $[#] != 0
do
case $[1] in
--*=*)
--*=?*)
ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$[1]
ac_optarg=$[2]
@ -1491,6 +1496,7 @@ m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
'') AC_MSG_ERROR([missing file argument]) ;;
esac
AS_VAR_APPEND([CONFIG_FILES], [" '$ac_optarg'"])
ac_need_defaults=false;;

View File

@ -276,6 +276,12 @@ if test -w /dev/full && test -c /dev/full; then
[1], [ignore], [ignore])
fi
# Validate that --file requires an argument
AT_CHECK([./config.status --file], [1], [ignore], [stderr])
AT_CHECK([grep 'missing file argument' stderr], [0], [ignore])
AT_CHECK([./config.status --file=], [1], [ignore], [stderr])
AT_CHECK([grep 'missing file argument' stderr], [0], [ignore])
# Create a header
AT_CHECK_CONFIG_CREATION_NOWRITE(header)
# Create a header on stdout