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

 
 

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

Submitter:  PG <pgscooter>
Submitted:  Wed 15 Jul 2009 07:54:16 AM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  4.4.0 Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 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 pgscooter (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code