[Top][All Lists]

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

[bug #19806] Predicate -samefile potentially fooled by inode reuse

From: James Youngman
Subject: [bug #19806] Predicate -samefile potentially fooled by inode reuse
Date: Sat, 05 May 2007 12:25:55 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060830 Firefox/ (Debian-1.5.dfsg+


                 Summary: Predicate -samefile potentially fooled by inode
                 Project: findutils
            Submitted by: jay
            Submitted on: Saturday 05/05/2007 at 12:25
                Category: None
                Severity: 2 - Minor
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: jay
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None



The -samefile predicate checks the identity of a candidate file against the
identity of a reference file on the command line.  They are deemed to be the
same if they have the same inode and device numbers.  

This test can be fooled if the reference file is deleted after find starts
and the indoe number is reused for a new file.  The find program can
erroneously believe that the new file bearing the same inode number is in
fact the same file as the original reference file.   This causes -samefile to
produce false positives.

To fix this, we should hold a file descriptor open on the reference file
(unless it is a symbolic link and the -P option is active).  That will
prevent reuse of the inode number.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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