bugfindutils - Bugs: bug #19806, Predicate -samefile potentially...

 
 

bug #19806: Predicate -samefile potentially fooled by inode reuse

Submitter:  James Youngman <jay>
Submitted:  Sat 05 May 2007 12:25:54 PM UTC
   
 
Category:  None Severity:  2 - Minor
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  None Fixed Release:  4.3.5
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 May 2007 12:43:42 PM UTC, comment #1: 

This problem is fixed in the CVS code for findutils.
To resolve your problem, you could either wait for the
next official release of findutils, or check out a copy
of the code from the CVS repository for findutils.

James Youngman <jay>
Group administrator
Sat 05 May 2007 12:25:54 PM UTC, original submission:  

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.

James Youngman <jay>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-05-05 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3.5
    2007-05-05 jay StatusNone Fixed

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code