From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 2dae55cc for ; Thu, 9 Jan 2020 15:42:41 +0000 (UTC) Received: (qmail 14739 invoked by alias); 9 Jan 2020 15:42:32 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24619 Received: (qmail 9305 invoked by uid 1010); 9 Jan 2020 15:42:32 -0000 X-Qmail-Scanner-Diagnostics: from out3-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(66.111.4.27):SA:0(-2.6/5.0):. Processed in 3.98251 secs); 09 Jan 2020 15:42:32 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeiuddggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugfgfgesthektd dttderudenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgv lhdrshhhrghhrghfrdhnrghmvgeqnecukfhppeejledrudektddrheejrdduudelnecurf grrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghm vgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Date: Thu, 9 Jan 2020 15:41:45 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Unreadable directories aren't included in glob expansion Message-ID: <20200109154145.rqksfenozx6745rn@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20170113 (1.7.2) Consider: % mkdir foo % mkdir -m 000 bar % echo */ foo/ % echo *(/) bar foo % Shouldn't the expansion of «*/» include «bar/»? The shell knows, in that situation, that ./bar is a directory; «test -d bar» and «zstat -or bar» both confirm this. dash/bash/ksh all include «bar/» in that expansion. strace shows a probable cause: . access("buster/.", F_OK) = -1 EACCES (Permission denied) I've discussed this on IRC with Eric, but I'd rather let him explain his view in his own words. Cheers, Daniel P.S. Test case: diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst index 5638e1255..1c1663a48 100644 --- a/Test/D02glob.ztst +++ b/Test/D02glob.ztst @@ -728,3 +728,10 @@ >does/not/exist >not/exist >exist + + mkdir -m 000 glob.tmp/secret1 + (setopt nullglob + echo glob.tmp/*/ glob.tmp/*(/) + ) +-f:unreadable directories can be globbed +>glob.tmp/secret1/ glob.tmp/secret1