URL:
  <http://savannah.gnu.org/bugs/?29460>

                 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: [email protected]
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.5.7
           Fixed Release: None

    _______________________________________________________

Details:

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.






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29460>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to