From owner-freebsd-hackers@freebsd.org Fri May 15 22:47:32 2020 Return-Path: Delivered-To: freebsd-hackers@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 A96AD2DC503; Fri, 15 May 2020 22:47:32 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3Sz52N8z4YsB; Fri, 15 May 2020 22:47:31 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id B1C0716054; Sat, 16 May 2020 00:47:24 +0200 (CEST) Date: Sat, 16 May 2020 00:47:24 +0200 From: Steffen Nurpmeso To: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: [HEADSUP] Disallowing read() of a directory fd Message-ID: <20200515224724.WFACq%steffen@sdaoden.eu> In-Reply-To: <20200515220923.GA36597@bec.de> References: <202005142017.04EKH0aA093503@fire.js.berklix.net> <202005152000.04FK0tjk006516@slippy.cwsent.com> <20200515202526.GZ82984@trajan.stk.cx> <20200515220923.GA36597@bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org, hackers@freebsd.org User-Agent: s-nail v14.9.19-42-g6235a28f OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 49P3Sz52N8z4YsB X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of steffen@sdaoden.eu designates 217.144.132.164 as permitted sender) smtp.mailfrom=steffen@sdaoden.eu X-Spamd-Result: default: False [0.57 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.74)[-0.744,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[sdaoden.eu]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; NEURAL_SPAM_LONG(0.34)[0.338,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE]; IP_SCORE(0.28)[asn: 15987(1.41), country: DE(-0.02)] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:47:32 -0000 Joerg Sonnenberger wrote in <20200515220923.GA36597@bec.de>: |On Fri, May 15, 2020 at 10:25:26PM +0200, Arne Steinkamm wrote: |> On Fri, May 15, 2020 at 01:00:55PM -0700, Cy Schubert wrote: |>> It's been 42 or more years since this bug was introduced. Let's \ |>> just fix it |>> now instead of agonizing over it. |> |> I didn't want to add something as everything is said, |> but this sentence is a little bit to provocative. |> |> Everything is a file describes one of the defining features of Unix. |> |> Calling this defining feature of Unix a bug shows to me that the ideas |> behind Unix got lost in the FreeBSD universe too... | |Using linear storage for a directory is an implementation detail of the |implementation. It's not a defining feature. "Reading" from a directory |doesn't make sense for many other organisational forms. So, are you now |arguing that leaky abstractions are a defining feature of Unix? In an ideal Unix world read(2)ing from a directory fd would do the job that getdents(2) / getdirentries(2) never moved to a standard, leaving us with that terrible readdir(3) stuff. imho. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)