Created attachment 311427 [details] Do not resolve paths unnecessarily. When utimensat is called on a symlink with AT_SYMLINK_NOFOLLOW set sandbox calls realpath on the symlink. This subtly changes behavior: it updates the atime of the symlink when utimensat itself might not. Specifically it causes the testsuite of many packages that use gnulib to fail. Its testsuite does this (leaving out a few steps irrelevant to this problem): - Create a symlink to a nonexistant file - lstat it and remember the result - sleep a few milliseconds - call utimensat(AT_FDCWD, name, times, AT_SYMLINK_NOFOLLOW) with "times" invalid - lstat the symlink again, and assert atime is unchanged. The attached patch seems to fix this, but I'm not exactly familiar with the sandbox code, so I might have broken something else.
can you provide a specific package that fails its testsuite due to this ? i'm having a hard time putting together a test case that reproduces the bug for the sandbox testsuite.
Gee, it sure would've been smart of me to include that piece of information when I filed this. sys-apps/coreutils-8.20-r2 is affected (I see some other failures there too, but I believe this bug causes test-fdutimensat and test-utimensat in gnulib-tests to fail). Either run the entire ebuild or compare "make check" and "sandbox make check" in the gnulib-tests subdir after running ./configure && make in the root.
thanks ... there were a few nuances in my test case attempt that i missed. i looked at the coreutils gnulib tests and was able to work out the bugs. pushed now in master and will be in sandbox-2.10: http://gitweb.gentoo.org/proj/sandbox.git/commit/?id=4377a68df2a20cda06aadb58c179ce2e8d78f7cd
*** Bug 423583 has been marked as a duplicate of this bug. ***