Date: Fri, 15 May 2020 12:34:10 -0500 From: Jim Thompson <jim@netgate.com> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Kyle Evans <kevans@freebsd.org>, Alan Somers <asomers@freebsd.org>, "Julian H. Stacey" <jhs@berklix.com>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>, "freebsd-hackers@freebsd.org" <hackers@freebsd.org> Subject: Re: [HEADSUP] Disallowing read() of a directory fd Message-ID: <9C0CCC6D-BA3A-4068-BC3B-5B40E7C668E1@netgate.com> In-Reply-To: <35501.1589529102@critter.freebsd.dk> References: <CACNAnaFszg%2BQWPRS0kghsnQMxXc%2B5niPTTNiUPSmK60YyBGCzA@mail.gmail.com> <202005142017.04EKH0aA093503@fire.js.berklix.net> <CAOtMX2i2Z-KX=3rYR2nZ1g1Lb_tF==H3xPKcQMBxJs1Kqr-meQ@mail.gmail.com> <33549.1589488226@critter.freebsd.dk> <CACNAnaFDHMkConkBLY-2BMAudueDA8-HTJ5_FNpt4WrB=gg_HA@mail.gmail.com> <35501.1589529102@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
> On May 15, 2020, at 2:51 AM, Poul-Henning Kamp <phk@phk.freebsd.dk> = wrote: >=20 > 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. >=20 > But there is absolutely no reason to make it *impossible* for > a competent root to do what competent roots do. In the large, I=E2=80=99m 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=E2=80=99t been = true for Unix for over 40 years, if ever. Jim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9C0CCC6D-BA3A-4068-BC3B-5B40E7C668E1>