[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/2] cleanup $tmp usage
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH 0/2] cleanup $tmp usage |
Date: |
Mon, 30 Aug 2010 19:49:17 +0200 |
User-agent: |
Mutt/1.5.20 (2010-04-22) |
Hi Eric,
* Eric Blake wrote on Mon, Aug 30, 2010 at 06:32:37PM CEST:
> --- c/tests/torture.at
> +++ w/tests/torture.at
> +AT_CHECK_MACRO([AC_CONFIG_COMMANDS with temporary directory],
> +[[AC_CONFIG_COMMANDS([foo], [
> +case $ACTION in
> + use)
> + echo "$tmp" > tmpdir
> + test -d "$tmp" || AC_MSG_ERROR([No $tmp directory])
> + echo garbage-in > "$tmp/garbage-out"
> + ;;
> + corrupt)
> + echo "$tmp" > tmpdir
> + tmp=/nosuch
This isn't without danger, as two undesirable things can happen when
some code in config.status does try to write to $tmp after this: first,
the user compiling as root might be annoyed at extra junk in /, second,
some user with a security-enhanced distribution (forgot which, sorry)
may report that Autoconf tried to violate its allowed name space.
I don't recall which of the autotools I saw such a report for.
Cheers,
Ralf
> + ;;
> + *) ;;
> +esac
> +])
> +]], [
> +AT_CHECK([test ! -f tmpdir])
> +AT_CHECK([ACTION=use ./config.status], [], [ignore])
> +AT_CHECK([test -s tmpdir && test ! -d "`cat tmpdir`"])
> +AT_CHECK([ACTION=corrupt ./config.status], [], [ignore])
> +AT_CHECK([test -s tmpdir && test ! -d "`cat tmpdir`"])
- [PATCH] docs: mention another issue with variable expansion, Eric Blake, 2010/08/26
- [PATCHv2] docs: mention another issue with variable expansion, Eric Blake, 2010/08/26
- Re: [PATCHv2] docs: mention another issue with variable expansion, Ralf Wildenhues, 2010/08/27
- Re: [PATCHv2] docs: mention another issue with variable expansion, Eric Blake, 2010/08/27
- [PATCH 0/2] cleanup $tmp usage, Eric Blake, 2010/08/27
- Re: [PATCH 0/2] cleanup $tmp usage, Ralf Wildenhues, 2010/08/27
- Re: [PATCH 0/2] cleanup $tmp usage, Eric Blake, 2010/08/30
- Re: [PATCH 0/2] cleanup $tmp usage,
Ralf Wildenhues <=
- Re: [PATCH 0/2] cleanup $tmp usage, Eric Blake, 2010/08/30
- [PATCH 2/2] config.status: minimize use of $tmp, Eric Blake, 2010/08/27
- Re: [PATCH 2/2] config.status: minimize use of $tmp, Eric Blake, 2010/08/30
- Re: [PATCH 2/2] config.status: minimize use of $tmp, Ralf Wildenhues, 2010/08/30
- Re: [PATCH 2/2] config.status: minimize use of $tmp, Eric Blake, 2010/08/30
- Re: [PATCH 2/2] config.status: minimize use of $tmp, Paul Eggert, 2010/08/30
- [PATCH 1/2] docs: avoid use of $tmp outside of config.status use, Eric Blake, 2010/08/27