From owner-freebsd-hackers@freebsd.org  Thu May 14 20:30:31 2020
Return-Path: <owner-freebsd-hackers@freebsd.org>
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 C2F7C2DE80A
 for <freebsd-hackers@mailman.nyi.freebsd.org>;
 Thu, 14 May 2020 20:30:31 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::50:13])
 by mx1.freebsd.org (Postfix) with ESMTP id 49NNTL4XvHz3P2W
 for <freebsd-hackers@freebsd.org>; Thu, 14 May 2020 20:30:30 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: by mailman.nyi.freebsd.org (Postfix)
 id 9BB912DE807; Thu, 14 May 2020 20:30:30 +0000 (UTC)
Delivered-To: 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 9B6B92DE806;
 Thu, 14 May 2020 20:30:30 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222])
 (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 49NNTL38M2z3P2V;
 Thu, 14 May 2020 20:30:29 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by phk.freebsd.dk (Postfix) with ESMTPS id A1E181AF18C;
 Thu, 14 May 2020 20:30:27 +0000 (UTC)
Received: from critter.freebsd.dk (localhost [127.0.0.1])
 by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id 04EKURnS033551
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 14 May 2020 20:30:27 GMT (envelope-from phk@critter.freebsd.dk)
Received: (from phk@localhost)
 by critter.freebsd.dk (8.15.2/8.15.2/Submit) id 04EKUQmj033550;
 Thu, 14 May 2020 20:30:26 GMT (envelope-from phk)
To: Alan Somers <asomers@freebsd.org>
cc: "Julian H. Stacey" <jhs@berklix.com>, Kyle Evans <kevans@freebsd.org>,
 "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>,
 "freebsd-hackers@freebsd.org" <hackers@freebsd.org>
Subject: Re: [HEADSUP] Disallowing read() of a directory fd
In-reply-to: <CAOtMX2i2Z-KX=3rYR2nZ1g1Lb_tF==H3xPKcQMBxJs1Kqr-meQ@mail.gmail.com>
From: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
References: <CACNAnaFszg+QWPRS0kghsnQMxXc+5niPTTNiUPSmK60YyBGCzA@mail.gmail.com>
 <202005142017.04EKH0aA093503@fire.js.berklix.net>
 <CAOtMX2i2Z-KX=3rYR2nZ1g1Lb_tF==H3xPKcQMBxJs1Kqr-meQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <33548.1589488226.1@critter.freebsd.dk>
Content-Transfer-Encoding: quoted-printable
Date: Thu, 14 May 2020 20:30:26 +0000
Message-ID: <33549.1589488226@critter.freebsd.dk>
X-Rspamd-Queue-Id: 49NNTL38M2z3P2V
X-Spamd-Bar: -----
Authentication-Results: mx1.freebsd.org;
	none
X-Spamd-Result: default: False [-5.96 / 15.00];
 NEURAL_HAM_MEDIUM(-0.96)[-0.964,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.33
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
 <freebsd-hackers.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-hackers>, 
 <mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers/>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
 <mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 14 May 2020 20:30:31 -0000

--------
In message <CAOtMX2i2Z-KX=3D3rYR2nZ1g1Lb_tF=3D=3DH3xPKcQMBxJs1Kqr-meQ@mail=
.gmail.com>
, Alan Somers writes:

>Really?  When is that occasionally useful?  I've never seen anything usef=
ul
>come out of reading a directory.

Two things I have done over the years:

Figure out which filenames prevent a enormous but sparse directory
from being compacted.

Figure out which control characters were in a filename.


It might be a good idea to add a override flag on this feature,
along the lines of:

	kern.geom.debugflags=3D0x10


-- =

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    =

Never attribute to malice what can adequately be explained by incompetence=
.