bugfindutils - Bugs: bug #15384, find misbehaves when parent...

 
 

bug #15384: find misbehaves when parent directory is not readable

Submitted by:  Dmitry V. Levin <ldv>
Submitted on:  Thu 05 Jan 2006 07:53:51 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.2.27Fixed Release: 4.3.12

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 04 Dec 2007 01:29:17 AM UTC, comment #5:

This is fixed in CVS for 4.3.x, but the fix is not yet included in any release.

James Youngman <jay>
Project AdministratorIn charge of this item.
Sun 02 Dec 2007 10:13:51 PM UTC, comment #4:

A patch fixing this problem was emailed to findutils-patches@gnu.org. It's also attached.

(file #14538)

James Youngman <jay>
Project AdministratorIn charge of this item.
Wed 22 Aug 2007 06:16:18 PM UTC, comment #3:

Actually, the failure when '.' can't be found (for example, because a parent is unsearchable) was introduced in 4.3.3; I'll open a separate report for that.

This report deals with unreadable, but searchable parents. Indeed, fts makes a difference:

$ mkdir -p private/d
$ touch private/d/a
$ ~/findutils-4.3.8/find/find /tmp/private/d
/tmp/private/d
/tmp/private/d/a
$ chmod a-rw /tmp/private
$ ~/findutils-4.3.8/find/find /tmp/private/d
/tmp/private/d
/tmp/private/d/a
$ ~/findutils-4.3.8/find/oldfind /tmp/private/d
/home/ericb/findutils-4.3.8/find/oldfind: `/tmp/private': Permission denied

At this point, since we are about to create a stable 4.4 branch where the fts()-based find works, do we still need to worry about the home-grown oldfind, which still has the bug?

And do we go ahead and add the patch attached to this bug to the 4.3.x testsuite, when it will only pass on one of the two implementations?

Eric Blake <ericb>
Project Administrator
Wed 22 Aug 2007 05:49:19 PM UTC, comment #2:

Revisiting this old bug, I wonder if the fts algorithm in 4.3.x matters.

Anyways, while trying to reproduce this, I did:

$ d=/tmp/.private/d
$ mkdir -p $d
$ chmod a-rx /tmp/.private
$ dirname $d
/tmp/.private
$ find --version |head -n1
GNU find version 4.3.8
$ find $d
find: `/tmp/.private/d': Permission denied
$ oldfind $d
assertion "starting_desc >= 0" failed: file "/home/eblake/findutils-4.3.8-1/src/findutils-4.3.8/find/find.c", line 201
Hangup

So there's certainly still a problem.

Eric Blake <ericb>
Project Administrator
Sun 08 Jan 2006 01:36:11 PM UTC, comment #1:

I can't immediately think of any other way to ensure that -execdir will securely succeed other than to chdir() to the parent directory. Where the start point is a direcotry you could chdir() to that and use "." but that workaround won't be good for a plain file.

James Youngman <jay>
Project AdministratorIn charge of this item.
Thu 05 Jan 2006 07:53:51 PM UTC, original submission:

When parent directory of a given path is not readable, find refuses to work. Here is a real world example:

$ dirname $TMPDIR
/tmp/.private
$ find $TMPDIR
find: /tmp/.private: Permission denied

Dmitry V. Levin <ldv>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Updated the item)
  • -unavailable- added by ericb (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 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 19 Dec 2007 10:41:05 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.12
    Tue 04 Dec 2007 01:29:17 AM UTCjayStatusIn Progress=>Fixed
      Fixed Release4.3.2=>None
    Sun 02 Dec 2007 10:13:51 PM UTCjayAttached File-=>Added 0002-Fix-Savannah-bug-15384-find-misbehaves-when-parent.patch, #14538
      StatusNone=>In Progress
    Sun 02 Dec 2007 11:50:08 AM UTCjayStatusFixed=>None
      Assigned toNone=>jay
    Wed 22 Aug 2007 06:16:18 PM UTCericbStatusNone=>Fixed
      Fixed ReleaseNone=>4.3.2
    Thu 05 Jan 2006 07:53:51 PM UTCldvAttached File-=>Added findutils-4.2.27-alt-find-testsuite-parent.patch, #3249

    Back to the top


    Powered by Savane 3.1-cleanup1