bugfindutils - Bugs: bug #16378, find aborts on file with mode 0000

 
 

bug #16378: find aborts on file with mode 0000

Submitted by:  None
Submitted on:  Wed 19 Apr 2006 04:28:36 AM UTC  
 
Category: findSeverity: 6 - Security
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Davyd MadeleyOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.27
Fixed Release: 4.3.5

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 05 May 2007 11:17:03 AM UTC, comment #4:

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>
Project AdministratorIn charge of this item.
Wed 19 Apr 2006 12:23:13 PM UTC, comment #3:

This was reproducable on Fedora Core 4 and 5, we did not observe it on Redhat 8.

The error would occur with:
find mydir ! -type d
but not with:
find mydir

The file was on an NFS filesystem and was probably corrupt. `stat` informed us that the mode on the file was 0000. `ls` listed the permissions as "?----------". `fsck` later on picked up the inode as being inconsistant.

Given that find works without the predicate, it seems logical that it should still work with the predicate. It may also make sense to mention a seemingly corrupt file via stderr.

Anonymous
Wed 19 Apr 2006 12:09:24 PM UTC, comment #2:

What OS are you running? Exactly what command line did you use? What type of filesystem is the file on?

I failed to reproduce the problem here because get_statinfo() alwats populates state.type with the contents of struct stat.st_mode which is not zero even for a mode-0 file, because other bits (the bits we are interested in, in fact) are non-zero, at least on the system I am testing on.

I believe that the fix is to remove the assertion, since it is valid I suppose for st_mode to be zero, depending on the value of S_IFREG on your system.

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 19 Apr 2006 04:30:33 AM UTC, comment #1:

Additionally, your bug tracker has decided that my email address is invalid.

Anonymous
Wed 19 Apr 2006 04:28:36 AM UTC, original submission:

`find` will abort if it comes across a file with mode 0000 giving an assertion error:
find: pred.c:1329: pred_type: Assertion `state.type != 0' failed.

It gives no indication of what file it was up to at the time. Ideally it would print a warning to stderr and keep on going, rather than abort. This happens when using the type predicate.

At the very least a more verbose error would be nice.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 05 May 2007 01:23:53 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.5
    Sat 05 May 2007 11:17:03 AM UTCjayStatusNone=>Fixed
    Wed 19 Apr 2006 12:10:54 PM UTCjayCarbon-Copy-=>Added -unavailable-
    Wed 19 Apr 2006 12:10:31 PM UTCjayPrivacyPrivate=>Public
    Wed 19 Apr 2006 12:09:24 PM UTCjaySeverity3 - Normal=>6 - Security
      PrivacyPublic=>Private
      Assigned toNone=>jay

    Back to the top


    Powered by Savane 3.1-cleanup1