bugfindutils - Bugs: bug #29460, -printf %Y fails in $CWD-dependent...

 
 

bug #29460: -printf %Y fails in $CWD-dependent way

Submitted by:  James Youngman <jay>
Submitted on:  Wed 07 Apr 2010 09:16:17 AM UTC  
 
Category: findSeverity: 4 - Important
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.5.7Fixed Release: 4.5.8

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 07 Apr 2010 11:10:14 PM UTC, comment #3:

Fixed in 4.5.8, which I just released.

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 07 Apr 2010 09:58:05 AM UTC, comment #2:

I've updated the patch to mention the bugfix in the NEWS file. I also changed a similar case in symlink_loop.

(file #20149, file #20150)

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 07 Apr 2010 09:21:45 AM UTC, comment #1:

The attached patch fixes the problem (and introduces a regression test case for it).

(file #20148)

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 07 Apr 2010 09:16:17 AM UTC, original submission:

This problem was diagnosed as a result of a wrongly-prepared initrd, meaning that the original Debian bug starts off with a lot of apparently-irrelevant material. However, the centre of the issue is this:

"""
Apparently it is affected by CWD:

14:21 ~$ cd -
/tmp
14:21 tmp$ find /tmp -name sleep -printf %Y\\n
f
f
14:21 tmp$ cd -
/home/jidanni
14:21 ~$ find /tmp -name sleep -printf %Y\\n
N
N
14:21 ~$ cd -
/tmp
14:22 tmp$ find /tmp -name sleep -printf %Y\\n
f
f
14:22 tmp$ mount|egrep /home\|/tmp
/dev/hda6 on /home type ext3 (rw)
tmpfs on /tmp type tmpfs (rw)
"""

Here we see that the result of %Y depends on the original choice of $CWD.

The problem is that find (ftsfind, not oldfind) is calling either stat or lstat to determine the result of %Y. Since neither of these pay attention to state.cwd_dir_fd, they will often fail to locate the file being examined and hence produce 'N', wrongly.

James Youngman <jay>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20149:  0001-Fix-Savannah-bug-29460-printf-Y-fails-in-CWD-depende.patch added by jay (5KiB - text/x-patch - Replacement patch (it also updates the NEWS file))
file #20150:  0002-More-stat-xstat-cleanup.patch added by jay (2KiB - text/x-patch - Replacement patch (it also updates the NEWS file))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 07 Apr 2010 11:10:14 PM UTCjayStatusCode Review=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.8
    Wed 07 Apr 2010 09:58:05 AM UTCjayAttached File-=>Added 0001-Fix-Savannah-bug-29460-printf-Y-fails-in-CWD-depende.patch, #20149
      Attached File-=>Added 0002-More-stat-xstat-cleanup.patch, #20150
    Wed 07 Apr 2010 09:56:45 AM UTCjayAttached File#20148=>Removed
    Wed 07 Apr 2010 09:21:45 AM UTCjayAttached File-=>Added 0001-Fix-Savannah-bug-29460-printf-Y-fails-in-CWD-depende.patch, #20148
      StatusConfirmed=>Code Review

    Back to the top


    Powered by Savane 3.1-cleanup1