From owner-freebsd-arch@freebsd.org Fri May 15 15:06:55 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 126252F7C96; Fri, 15 May 2020 15:06:55 +0000 (UTC) (envelope-from arne@Steinkamm.COM) Received: from mail.steinkamm.com (mail.steinkamm.com [194.127.175.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "steinkamm.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NsFS5Ws5z3xr0; Fri, 15 May 2020 15:06:52 +0000 (UTC) (envelope-from arne@Steinkamm.COM) Received: from trajan.stk.cx (trajan.stk.cx [10.8.8.110]) by basis.steinkamm.com (8.15.2/8.15.2) with ESMTPS id 04FF6dt3014096 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 15 May 2020 17:06:39 +0200 (CEST) (envelope-from arne@steinkamm.com) Received: from trajan.stk.cx (localhost [127.0.0.1]) by trajan.stk.cx (8.15.2/8.15.2) with ESMTPS id 04FF6cxw065070 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 15 May 2020 17:06:38 +0200 (CEST) (envelope-from arne@trajan.stk.cx) Received: (from arne@localhost) by trajan.stk.cx (8.15.2/8.15.2/Submit) id 04FF6RIZ064487; Fri, 15 May 2020 17:06:27 +0200 (CEST) (envelope-from arne) Date: Fri, 15 May 2020 17:06:27 +0200 From: Arne Steinkamm To: Diane Bruce Cc: "Rodney W. Grimes" , Arne Steinkamm , FreeBSD Hackers , freebsd-arch@freebsd.org Subject: Re: [HEADSUP] Disallowing read() of a directory fd Message-ID: <20200515150627.GY82984@trajan.stk.cx> Reply-To: arne@Steinkamm.COM References: <202005151247.04FClhsD086497@gndrsh.dnsmgr.net> <20200515144815.GA8265@night.db.net> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200515144815.GA8265@night.db.net> User-Agent: Mutt@Trajan/1.12.1 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on basis.steinkamm.com X-Rspamd-Queue-Id: 49NsFS5Ws5z3xr0 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of arne@Steinkamm.COM has no SPF policy when checking 194.127.175.194) smtp.mailfrom=arne@Steinkamm.COM X-Spamd-Result: default: False [0.82 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[arne@Steinkamm.COM]; NEURAL_HAM_MEDIUM(-0.47)[-0.470,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.00)[country: DE(-0.02)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[Steinkamm.COM]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.10)[0.098,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[freebsd-hackers@Steinkamm.COM,arne@Steinkamm.COM]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:34646, ipnet:194.127.175.0/24, country:DE]; FROM_NEQ_ENVFROM(0.00)[freebsd-hackers@Steinkamm.COM,arne@Steinkamm.COM]; RCVD_TLS_ALL(0.00)[] X-Mailman-Approved-At: Sat, 16 May 2020 07:22:55 +0000 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: Fri, 15 May 2020 15:06:55 -0000 On Fri, May 15, 2020 at 10:48:15AM -0400, Diane Bruce wrote: > All I have to say on this noisy bikeshed is, let's resurrect the mkdir > bug of V7 because it's tradition and the BSD way and history and stuff. > (I only expect a few of you to remember this one.) Oh, this "bug" was alive until Sys V 3.2 times... Implementing mkdir as library function without a syscall wasn't a good idea. ken and dmr saw no reason to implement mkdir as atomic operation. So it was easy, even with a shell script, to jump between the mknod(2) and the chown(2) to replace the directory node with a symlink to /etc/passwd. This was from a todays point of view a stupid mistake. Reading a directory node is lightyears away from "a stupid mistake". Make it switchable with a sysctl switch... would be the best of both worlds. .//. Arne -- Arne Steinkamm | Home: Mail: arnesteinkammcom Tel.: +49.89.21031004 | Gröbenbachweg 13, 82178 Puchheim, GERMANY