[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug 552320] Handling AT_FDCWD as EBADF in glibc's utimens() causes
Re: [Bug 552320] Handling AT_FDCWD as EBADF in glibc's utimens() causes tar failures
Wed, 06 Jan 2010 06:20:51 -0700
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20090812 Thunderbird/126.96.36.199 Mnenhy/0.7.6.666
According to Jim Meyering on 1/5/2010 2:07 PM:
>> --- Comment #5 from Ondrej Vasik <address@hidden> 2010-01-05 14:29:13 EDT
>> Ah - even the latest gnulib doesn't handle this new recent change - so touch
>> from coreutils might be affected as well as mentioned in debian bugzilla from
>> comment #4. Therefore adding coreutils/gnulib upstream maintainer into CC.
For the record, the bug occurs any time something calls fdutimens
(negative, name, t) trying to change the timestamp of name with no fd
present, and only occurs on platforms running an old kernel (2.6.18 or
older, where utimensat syscall fails with ENOSYS) but new glibc (2.11.1 or
newer, where the futimens wrapper failing with EBADF masks the desired
ENOSYS that we used to get from the kernel). It dates back to gnulib
commit faeb3e6b2, May 2008, when fdutimens (also known as gl_utimens or
even futimens, back before POSIX standardized the name futimens with a
different signature) first started using the utimensat syscall. This
corresponds to coreutils 6.12 being the first buggy version.
Inspecting the coreutils sources, the following scenarios appear to be the
only possible places affected by the bug.
touch -c on any type of existing file
touch -h on non-symlink (introduced in 8.1)
In copy.c, copy_reg is immune (fd is always non-negative), only
copy_internal is affected. But that means that:
mv (across device boundary)
are affected when operating on directories, symlinks, fifos, ...
So, how about this NEWS item?
diff --git a/NEWS b/NEWS
index 42a8f47..686ed56 100644
@@ -4,6 +4,10 @@ GNU coreutils NEWS -*-
** Bug fixes
+ cp -p, install -p, mv, and touch -c could trigger a spurious error
+ message when using new glibc coupled with an old kernel.
+ [bug introduced in coreutils-6.12].
ls -l --color no longer prints "argetm" in front of dangling
symlinks when the 'LINK target' directive was given to dircolors.
[bug introduced in fileutils-4.0]
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
Description: OpenPGP digital signature
- Re: [Bug 552320] Handling AT_FDCWD as EBADF in glibc's utimens() causes tar failures,
Eric Blake <=