Re: bug found from ls command
On Wed, Jul 8, 2009 at 10:02 AM, James Youngman wrote: > [+bug-findutils] > > On Tue, Jul 7, 2009 at 5:36 PM, PG wrote: >> ah, great! >> >> thank you for the info. That helps me understand a lot. Now I see why find >> fails. And perhaps it's not worth the extra computation time required to, >> upon failure of cd'ing into the directory, trying to list it. > > It probably should, if it is readable. But I don't think any versions > of GNU find will actually do this. OpenSolaris find doesn't either: flare:~/tmp$ find ft/tmp -ls 3474554 drwxr-xr-x 3 james1001 4096 Jul 8 09:54 ft/tmp 3474574 drw-r--r-- 2 james1001 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 James. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: bug found from ls command
[+bug-findutils] On Tue, Jul 7, 2009 at 5:36 PM, PG wrote: > ah, great! > > thank you for the info. That helps me understand a lot. Now I see why find > fails. And perhaps it's not worth the extra computation time required to, > upon failure of cd'ing into the directory, trying to list it. It probably should, if it is readable. But I don't think any versions of GNU find will actually do this. James. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: bug found from ls command
ah, great! thank you for the info. That helps me understand a lot. Now I see why find fails. And perhaps it's not worth the extra computation time required to, upon failure of cd'ing into the directory, trying to list it. I still think there should be an option for find that one could turn on that would do everything possible to find a certain filename. Thanks for the explanations. 2009/7/7 Philip Rowlands > On Mon, 6 Jul 2009, PG wrote: > > r...@system76-pc:/home/xinwei/bugreport# ls -l >> total 4 >> d---r--r-- 2 root root 4096 2009-07-05 13:27 protected >> > > xin...@system76-pc:~/bugreport$ ls -l protected/ >> ls: cannot access protected/canttouchthis: Permission denied >> total 0 >> -? ? ? ? ?? canttouchthis >> > > http://www.gnu.org/software/coreutils/manual/html_node/Mode-Structure.html > --- > There are three kinds of permissions that a user can have for a file: > > 1. permission to read the file. For directories, this means > permission to list the contents of the directory. > --- > > A directory with "read" permission allows the directory to be listed. This > is not a bug. > > > xin...@system76-pc:~/bugreport$ find ./ -name canttouchthis >> > > Curiously I get a different error here: > > $ find ./ -name canttouchthis > find: ./protected: Permission denied > > In theory find could show the file, but it attempts to chdir into the > directory before listing, which is not allowed by the directory permissions. > > > Cheers, > Phil > ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: bug found from ls command
On Mon, 6 Jul 2009, PG wrote: r...@system76-pc:/home/xinwei/bugreport# ls -l total 4 d---r--r-- 2 root root 4096 2009-07-05 13:27 protected xin...@system76-pc:~/bugreport$ ls -l protected/ ls: cannot access protected/canttouchthis: Permission denied total 0 -? ? ? ? ?? canttouchthis http://www.gnu.org/software/coreutils/manual/html_node/Mode-Structure.html --- There are three kinds of permissions that a user can have for a file: 1. permission to read the file. For directories, this means permission to list the contents of the directory. --- A directory with "read" permission allows the directory to be listed. This is not a bug. xin...@system76-pc:~/bugreport$ find ./ -name canttouchthis Curiously I get a different error here: $ find ./ -name canttouchthis find: ./protected: Permission denied In theory find could show the file, but it attempts to chdir into the directory before listing, which is not allowed by the directory permissions. Cheers, Phil ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: bug found from ls command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to PG on 7/6/2009 11:21 PM: > Dear coreutils, > > Actually, I'm not sure if ls is the perpetrator, but maybe you guys can find > out where things go wrong. I do not think that the filename "canttouchthis" > should be listed when I am not root in the following situation: Not a bug. Just because you can't stat() a file does not mean you can't learn of its existence via readdir(). ls is properly a) telling you that the file exists because readdir() said so, and b) warning you that it couldn't stat() the file because of permissions. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpTOC4ACgkQ84KuGfSFAYDiTgCgqptrBHIotZS+CGJdGG06e30U iAEAoKlY5g2G9BPh3wZeqCIw6mxEcUX9 =A8Kn -END PGP SIGNATURE- ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
bug found from ls command
Dear coreutils, Actually, I'm not sure if ls is the perpetrator, but maybe you guys can find out where things go wrong. I do not think that the filename "canttouchthis" should be listed when I am not root in the following situation: r...@system76-pc:/home/xinwei/bugreport# ls -l total 4 d---r--r-- 2 root root 4096 2009-07-05 13:27 protected r...@system76-pc:/home/xinwei/bugreport# ls -l protected total 0 -rw-r--r-- 1 xinwei xinwei 0 2009-07-05 13:27 canttouchthis r...@system76-pc:/home/xinwei/bugreport# exit xin...@system76-pc:~/bugreport$ ls -l protected/ ls: cannot access protected/canttouchthis: Permission denied total 0 -? ? ? ? ?? canttouchthis xin...@system76-pc:~/bugreport$ find ./ -name canttouchthis xin...@system76-pc:~/bugreport$ sudo !! sudo find ./ -name canttouchthis ./protected/canttouchthis xin...@system76-pc:~/bugreport$ Thanks! ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils