bug-findutils
[Top][All Lists]
Advanced

[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

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: address@hidden
             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

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