From owner-freebsd-arch@freebsd.org Thu May 14 23:58:28 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 945322E482D for ; Thu, 14 May 2020 23:58:28 +0000 (UTC) (envelope-from kevans@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 49NT5J3RMFz46jm; Thu, 14 May 2020 23:58:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 647D212B54; Thu, 14 May 2020 23:58:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f173.google.com with SMTP id t25so519939qtc.0; Thu, 14 May 2020 16:58:28 -0700 (PDT) X-Gm-Message-State: AOAM532d9s7dR3hpbkfxb8myfw+zDvlkDrcO/Rs8cwEAjoNqEkYwjgHm UI6LLFRj2h5Y6Xb23IEAA7icSdv3ZEEsxhnDxSI= X-Google-Smtp-Source: ABdhPJzjwCUjbTc3V7Ihk2hSVknHmQcNsH6R0KQLsCBjFp8ni1YKQPjWoxRI1NfRrUh2Nhb+U6FiF4xs+og25GyyPvI= X-Received: by 2002:ac8:6f2f:: with SMTP id i15mr789384qtv.53.1589500707974; Thu, 14 May 2020 16:58:27 -0700 (PDT) MIME-Version: 1.0 References: <202005141954.04EJsCtH036247@slippy.cwsent.com> In-Reply-To: From: Kyle Evans Date: Thu, 14 May 2020 18:58:17 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [HEADSUP] Disallowing read() of a directory fd To: Don Lewis Cc: Cy Schubert , "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" 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:58:28 -0000 On Thu, May 14, 2020 at 6:53 PM Don Lewis wrote: > > 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. > This is one that I actually find particularly annoying when I'm on a UFS system, as my partial inquiries will sometimes match the names of directory entries, so I'll get: Binary file ${dirname} matches That's almost never what I wanted, though.