[HEADSUP] Disallowing read() of a directory fd
Brooks Davis
brooks at freebsd.org
Thu May 14 20:28:40 UTC 2020
On Thu, May 14, 2020 at 01:26:46PM -0500, Kyle Evans wrote:
> Hi,
>
> This is a heads up, given that I'm completely flipping our historical
> behavior- I intend to commit this review in a couple days' time
> without substantial objection: https://reviews.freebsd.org/D24596
>
> With this, FreeBSD 13 will not allow read() of a directory fd, which
> could have previously returned some data from the underlying
> filesystem in no particular standardized format.
>
> This is a still-standards-compliant switch from one
> implementation-defined behavior to another that's already been adopted
> in various other popular kernels, to include OpenBSD, MacOS, and
> Linux.
>
> Worth noting is that there's not really one largely-compelling reasons
> to switch this after so many years (unless you find yourself that
> irate when you accidentally `cat` a directory), but there are some
> benefits which are briefly discussed in the commentary around the
> review along with the history of the current behavior.
>
> This change also simplifies filesystem implementations to some extent.
I'm sure this made sense in v7, but I've never opened a directory with vi
or cat and thought "that's what I wanted to do".
In theory can use it as a terrible ls I've you've totally foobar'd your
system, but we have /rescue these days.
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20200514/9d3abd20/attachment.sig>
More information about the freebsd-arch
mailing list