Bug 552320 - Handling AT_FDCWD as EBADF in glibc's utimens() causes tar failures
Summary: Handling AT_FDCWD as EBADF in glibc's utimens() causes tar failures
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: tar
Version: rawhide
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-04 17:10 UTC by Michal Hlavinka
Modified: 2010-01-05 23:54 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-01-05 21:27:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Hlavinka 2010-01-04 17:10:01 UTC
Description of problem:
When I create tar archive with new tar (tar-1.22-10.fc12.x86_64) old tar is not able to open this archive. 

Version-Release number of selected component (if applicable):
tar-1.22-10.fc12.x86_64

How reproducible:
always

Steps to Reproduce:
1.create archive with new tar
2.try to extract it with old tar
3.
  
Actual results:
/bin/tar: squirrelmail-1.4.20-RC2/images/folder.png: Cannot utime: Bad file descriptor

I've got this error in koji when updating package:

http://koji.fedoraproject.org/koji/getfile?taskID=1901164&name=build.log


Expected results:
extracted archive

Additional info:
this breaks package updates where maintainer has to recreate tar archive. Also upstream tarballs where upstream uses Fedora system may produce broken tarballs which is even worse, so I consider this to be high severity.

Comment 1 Kamil Dudka 2010-01-04 17:24:39 UTC
We figured out off-list the "old tar" from original report is 1.22-11.fc13, which is more likely a newer one :-)

Comment 2 Ondrej Vasik 2010-01-04 20:53:45 UTC
As a sidenote - there were more such reports off-the-bugzlla - most likely caused by recent change in the new glibc - anyway - as the glibc maintainers are quite sure the problem is in tar, we should probably fix it.

Comment 3 Ondrej Vasik 2010-01-05 14:32:52 UTC
> > That looks like a bug in tar, trying to call futimens with a bad file
> > descriptor.
> > Andreas Schwab
>  Probably, possibly exposed by this recent change in glibc-2.11.90-5:
> - Handle AT_FDCWD in futimens (BZ#10992).
> Tomas Bzatek

Adding relevant part of the off-the-bugzilla conversation.

Comment 4 Ondrej Vasik 2010-01-05 15:25:18 UTC
Here is duplicate report in debian (they have same problems with eglibc updated to POSIX2008) - patch fixing the issue is available there - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563726 - However - I tend to use latest gnulib lib/utimens.c - though - as they are other utimens/utimensat call related fixes.

Comment 5 Ondrej Vasik 2010-01-05 19:29:13 UTC
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.

Jim, what do you think? Is the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563726#66 good way to go and should be applied to gnulib/coreutils-8.3 to prevent touch (or better said futimens() with AT_FDCWD file descriptor) failures after glibc update?

Comment 6 Ondrej Vasik 2010-01-05 21:27:01 UTC
Fixed in tar-1.22-12.fc13, closing RAWHIDE.

Comment 7 Jim Meyering 2010-01-05 21:50:02 UTC
Hi Ondrej,

Thanks again for the heads up.
I've replied on bug-gnulib and Cc'd the debian bug address.
(too bad bugzilla doesn't have a reply-to-via-email option):

http://bugs.debian.org/563726#88

Comment 8 Ondrej Vasik 2010-01-05 23:54:41 UTC
Thanks Jim for replies/confirmation of bugfix correctness. Yep - it would be good bugzilla improvement to have such thing.


Note You need to log in before you can comment on or make changes to this bug.