ls mystery

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


--0OAP2g/MAC+5xKAE
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
>=20
> Now that is odd.  My experience is quite different:
>=20
> 	$ cd /tmp; mkdir x; touch x/y
> 	$ chmod 400 x
> 	$ ls -al x
> 	$
>=20
> 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 yellow.gradwell.net 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unk=
nown

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

--=20
Ben Smithurst / ben at FreeBSD.org                 FreeBSD: The Power To Serve
                                                    http://www.FreeBSD.org/

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAMfIibPzJ+yzvRCwRAprCAJ9XOD4pjy4sRdPQwsqEsWMvrjL8gwCgoZtg
IS2kIYKz6Cbxup3HZ4ByvKc=
=N19V
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--




More information about the Ukfreebsd mailing list