ls mystery

Ben Smithurst ben at
Tue Feb 17 10:51:14 GMT 2004

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Michael Abbott wrote:

>> 	ben at yellow:/tmp$ chmod 400 x
>> 	ben at yellow:/tmp$ ls -l x
>> 	ls: x/y: Permission denied
>> 	total 0
> Now that is odd.  My experience is quite different:
> 	$ cd /tmp; mkdir x; touch x/y
> 	$ chmod 400 x
> 	$ ls -al x
> 	$
> Listing the directory returns nothing at all.  I've tested this on FreeBSD
> 4.9 and 4.5 with the same result; interestingly, on Linux and sun3
> machines I get your result, ls: x/y: Permission denied.

ben at yellow:~$ uname -a=20
Linux 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unk=

I'd forgotten that minor point.  This is what I get for doing things
late at night! :-)

Although unfortunately this is one case where Linux looks less broken
than FreeBSD.  A plain 'ls x' will work, since that just needs to read
the directory, but anything that needs to stat() the files within it
(including ls -l, ls -F, ls -G) will fail (correctly, because of the
permissions) but without any error message. :-(

Ben Smithurst / ben at                 FreeBSD: The Power To Serve

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.4 (FreeBSD)



More information about the Ukfreebsd mailing list