[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: James Youngman
Subject: [bug #29460] -printf %Y fails in $CWD-dependent way
Date: Wed, 07 Apr 2010 09:16:17 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.7 Safari/533.2


                 Summary: -printf %Y fails in $CWD-dependent way
                 Project: findutils
            Submitted by: jay
            Submitted on: Wed 07 Apr 2010 09:16:17 AM GMT
                Category: find
                Severity: 4 - Important
              Item Group: Wrong result
                  Status: Confirmed
                 Privacy: Public
             Assigned to: jay
         Originator Name: 
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.5.7
           Fixed Release: None



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 -
14:21 tmp$ find /tmp -name sleep  -printf %Y\\n
14:21 tmp$ cd -
14:21 ~$ find /tmp -name sleep  -printf %Y\\n
14:21 ~$ cd -
14:22 tmp$ find /tmp -name sleep  -printf %Y\\n
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.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]