bugfindutils - Bugs: bug #27032, find fails to find a file that ls...

 
 

bug #27032: find fails to find a file that ls can list

Submitted by:  PG <pgscooter>
Submitted on:  Wed 15 Jul 2009 07:54:16 AM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: None
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.4.0Fixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Wed 15 Jul 2009 07:54:16 AM UTC, original submission:

the command "ls" can find a file that find cannot. I think that find should either find files of this type by default, or at least have an option to do so. From what I understand, find cannot find the file because it attempts to cd into the directory before listing, instead of just listing the directory. It is possible that you have permission to do one but not the other.

To reproduce the situation, please see the following commands and output:

root@system76-pc:/home/xinwei/bugreport# ls -l
total 4
d---r--r-- 2 root root 4096 2009-07-05 13:27 protected

root@system76-pc:/home/xinwei/bugreport# ls -l protected
total 0
-rw-r--r-- 1 xinwei xinwei 0 2009-07-05 13:27 canttouchthis
root@system76-pc:/home/xinwei/bugreport# exit
xinwei@system76-pc:~/bugreport$ ls -l protected/

ls: cannot access protected/canttouchthis: Permission denied
total 0
-????????? ? ? ? ? ? canttouchthis
xinwei@system76-pc:~/bugreport$ find ./ -name canttouchthis
xinwei@system76-pc:~/bugreport$ sudo !!

sudo find ./ -name canttouchthis
./protected/canttouchthis
xinwei@system76-pc:~/bugreport$

-----------------------------------------------------------
here is a copy of some further conversation on this exact topic:

Posted by James Youngman <jay@gnu.org>
OpenSolaris find doesn't either:

flare:~/tmp$ find ft/tmp -ls
347455 4 drwxr-xr-x 3 james 1001 4096 Jul 8 09:54 ft/tmp
347457 4 drw-r--r-- 2 james 1001 4096 Jul 8 09:54
ft/tmp/nonexecutable
find: cannot read dir ft/tmp/nonexecutable/: Permission denied
flare:~/tmp$ ls -l ft/tmp/nonexecutable
ft/tmp/nonexecutable/foo: Permission denied
total 0
$ find ft -print
ft
ft/tmp
ft/tmp/nonexecutable
find: cannot read dir ft/tmp/nonexecutable/: Permission denied
flare:~/tmp$ uname -a
SunOS flare.spiral-arm.org 5.11 snv_101b i86pc i386 i86xpv

Thank you

PG <pgscooter>

 

(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 pgscooter (Submitted the item)
  •  

    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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup