autoconf-patches
[Top][All Lists]
Advanced

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

Re: Try to update config.cache atomically; respect symlinks.


From: Eric Blake
Subject: Re: Try to update config.cache atomically; respect symlinks.
Date: Sat, 14 Aug 2010 11:20:45 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1

On 08/14/2010 12:32 AM, Ralf Wildenhues wrote:
> This patch fixes a long-standing issue GCC has with Autoconf: cache
> files are not updated atomically.  (This was IIUC the primary reason
> GCC introduced per-configure cache files.)

> 
> There's a small chance of a leftover file in the directory where the
> cache file resides, when a signal arrives at the right time.  Not sure
> if that's worth changing the exit trap, that wasn't done for the
> 'confcache' file either; but of course, the latter would be cleaned up
> after another configure run.  OTOH, the exit trap could then open up a
> symlink attack upon '--cache-file=/tmp/config.cache'.

Is it worth documenting that such a scratch file is safe to delete?

> +++ b/tests/base.at
> @@ -454,6 +454,13 @@ AT_CHECK_CONFIGURE([], [], [stdout])
>  AT_CHECK([grep cache stdout], [1])
>  AT_CHECK([LC_ALL=C ls -t config.cache a-stamp-file | sed 1q | grep 
> config.cache], [1])
>  
> +# Using a symlinked cache file works.
> +: > cache
> +rm -f config.cache
> +AS_LN_S([cache], [config.cache])
> +AT_CHECK_CONFIGURE([-C])
> +AT_CHECK([test -s cache || test ! -h config.cache])

Will this test work on mingw, which lacks symlinks?  Do we need to add
an extra check before AT_CHECK_CONFIGURE that skips if config.cache is
not a symlink?

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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