[HEADSUP] Disallowing read() of a directory fd

andrew clarke mail at ozzmosis.com
Thu May 14 22:56:09 UTC 2020


On 2020-05-14 22:17:00, Julian H. Stacey (jhs at berklix.com) wrote:

> There is ZERO need for a spurious change at 2 days notice after 42+ years !
> 
> "cat ." as been supported since Unix V6 1978 or earlier, 
> no problem, even occasionaly useful.

I think you're overstating its importance.

In the past I've accidentally run "cat" on a directory in FreeBSD and was
surprised it didn't return an error.

Running "cat /" here on FreeBSD 12.1-REL results in no useful output, perhaps
because root is on ZFS:

$ cat / | hd
00000000  03 00 00 00 00 00 00 80  19 a5 bc 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00              |............|
0000001c

So I have no problem with "cat /" returning a more useful error message instead.


More information about the freebsd-hackers mailing list