[HEADSUP] Disallowing read() of a directory fd
Jim Thompson
jim at netgate.com
Fri May 15 17:34:15 UTC 2020
> On May 15, 2020, at 2:51 AM, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
>
> Summary: I'm perfectly fine with read(2) returning error on a
> directory *under normal circumstances*, and I think it makes good
> sense by protecting a lot of terminals from a lot of binary
> garbage.
>
> But there is absolutely no reason to make it *impossible* for
> a competent root to do what competent roots do.
In the large, I’m in agreement that read(2) on a directory should work, at least for if (suser()), but the last sentence here would allow root to write(2) a directory, too, and that hasn’t been true for Unix for over 40 years, if ever.
Jim
More information about the freebsd-arch
mailing list