From owner-freebsd-arch@freebsd.org Thu May 14 23:53:19 2020 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97A282E456D for ; Thu, 14 May 2020 23:53:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NSzM3PGgz46cD; Thu, 14 May 2020 23:53:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id E42AC12B53; Thu, 14 May 2020 23:53:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Thu, 14 May 2020 16:53:16 -0700 (PDT) From: Don Lewis Subject: Re: [HEADSUP] Disallowing read() of a directory fd To: Cy Schubert cc: Kyle Evans , "freebsd-arch@freebsd.org" In-Reply-To: <202005141954.04EJsCtH036247@slippy.cwsent.com> Message-ID: References: <202005141954.04EJsCtH036247@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 23:53:19 -0000 On 14 May, Cy Schubert wrote: > In message om> > , Kyle Evans writes: >> 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. > > OpenBSD has done this for a while and more importantly Linux. Which causes annoying noise to stderr if you 'grep something *' if there are directories in the working directory.