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 [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
