From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id 00C96282C7D9 for <9fans@9fans.net>; Sat, 6 Jun 2020 17:13:21 -0400 (EDT) (envelope-from ori@eigenstate.org) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 0C44010C76A; Sat, 6 Jun 2020 17:13:20 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1591478000; b=eCQpX9RdhBedXYgSGsYlZvwJn9+W4Qjf1R4I2wRqcXTDo6C55R gopRK4DRbK1CR7NidbKFpYlHTyQI9MDKsm/hq1ya6CMoBwpy2skmz5vs1pfyksNw 9gXiKCNKQat7qGSnysTxv/f6cR3qrHdsd+PAgENtBMM1jFICrGr2WyPrjyYjwXFX Gx3yzzwjEtWHO0ANJ0TxD1qSi0L4I5KQIUoUZIi/cuqlIJ7ZAXBWwZD5yM3WL7zt Co2bK83oseZtzcnt6ZFQvj+xY/kM3mq2PpRgcytc/sU1R/9c+KrZYsGwACzTN7zQ xxHNYOks7h+Fl63eVa5fqXY0yvLhv1XXzkqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:subject:date:from:in-reply-to :mime-version:content-type:content-transfer-encoding; s=arcseal; t=1591478000; bh=yglCUrFeHFIW3JgYhlVBpwOhpokGkNyFtjHdNrsNY2k=; b= cFCrjVE9F2Zinw6/8WgGRxi4//nceN+9kiP9TduaaWnPlYMzOFBteFrKvjQmf+LG uEjYbFrAIxs2eORxiEIuKwZ6N8WtrJ4eZBwKPpfuPVZ0X0wiGbobHGKS7o+/VmH2 0j08hCgQsLxdEGnFUTB4TebF4XlkvRM942stgVBBvcGHlHdAwDgwcuQgjwHHMPXd cmyqCvoMh2Gk8MznHA/jq2hSTJZaPLllraNzQdYwB2I6iDH50mS/AtrviAyq1o2L +MQhdaf6Aab0jkam9ZX/4yGcwlFpgCT0X6vHmEffSni9aTsZ2WKbFkQxp/nVs7Hg LK2jTztxF/Ny4TIGH9YZUw== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=eigenstate.org; iprev=pass smtp.remote-ip=206.124.132.107 (mimir.eigenstate.org); spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-aligned-from=pass (Address match); x-ptr=pass smtp.helo=mimir.eigenstate.org policy.ptr=mimir.eigenstate.org; x-return-mx=pass header.domain=eigenstate.org policy.is_org=yes (MX Records found: kusuri.pikopiko.org,eigenstate.org,mail.pikopiko.org,nokogiri.pikopiko.org); x-return-mx=pass smtp.domain=eigenstate.org policy.is_org=yes (MX Records found: kusuri.pikopiko.org,eigenstate.org,mail.pikopiko.org,nokogiri.pikopiko.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=eigenstate.org; iprev=pass smtp.remote-ip=206.124.132.107 (mimir.eigenstate.org); spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-aligned-from=pass (Address match); x-ptr=pass smtp.helo=mimir.eigenstate.org policy.ptr=mimir.eigenstate.org; x-return-mx=pass header.domain=eigenstate.org policy.is_org=yes (MX Records found: kusuri.pikopiko.org,eigenstate.org,mail.pikopiko.org,nokogiri.pikopiko.org); x-return-mx=pass smtp.domain=eigenstate.org policy.is_org=yes (MX Records found: kusuri.pikopiko.org,eigenstate.org,mail.pikopiko.org,nokogiri.pikopiko.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeghedgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkffvuf ffhfgjgggtgfesthejjedttddtvdenucfhrhhomhepohhrihesvghighgvnhhsthgrthgv rdhorhhgnecuggftrfgrthhtvghrnhepvdehtdeffeetgeelhfegkeehhfeuhfehvddvie duueehjeetgeevkeeitdevuefhnecukfhppedvtdeirdduvdegrddufedvrddutdejpdej gedruddtuddrvddrieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvg htpedvtdeirdduvdegrddufedvrddutdejpdhhvghlohepmhhimhhirhdrvghighgvnhhs thgrthgvrdhorhhgpdhmrghilhhfrhhomhepoehorhhisegvihhgvghnshhtrghtvgdroh hrgheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (eigenstate.org: 206.124.132.107 is authorized to use 'ori@eigenstate.org' in 'mfrom' identity (mechanism 'mx' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="ori@eigenstate.org"; helo=mimir.eigenstate.org; client-ip=206.124.132.107 Received: from mimir.eigenstate.org (mimir.eigenstate.org [206.124.132.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sat, 6 Jun 2020 17:13:20 -0400 (EDT) (envelope-from ori@eigenstate.org) Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 2bf1cd81 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Sat, 6 Jun 2020 14:13:18 -0700 (PDT) Message-ID: <58181689FAB504813F509082A0F70248@eigenstate.org> To: eekee57@fastmail.fm, 9fans@9fans.net Subject: Re: [9fans] `test -x` returns wrong results for directories Date: Sat, 6 Jun 2020 14:13:17 -0700 From: ori@eigenstate.org In-Reply-To: <33fdd954-db9a-4273-a0ac-907f07b42499@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 8f5304ae-a83a-11ea-8027-a6cfc1b8638f > it's open() which is failing. i suppose it should. > > if the open fails, maybe access should stat the file, and if it's a > directory, try dirread(2). or maybe just opening it for reading will > work. i don't know, i'm new to this bit of plan 9 & i haven't slept. This is a bit subtle, though -- if you want to check if *you* can traverse the directory, then simply checking for an execute bit isn't enough -- you need to check that you belong to a group that has the execute bit. On a related note, execute permission seems to behave strangely in general. You can create a directory and list it: Even without execute permission it's listable. Makes sense. cpu% mkdir -p d/a/b cpu% touch d/x cpu% chmod -x d cpu% ls -ld d d-rw-r--r-- M 81 ori ori 0 Jun 5 07:53 d cpu% ls d d/a d/x As expected, it can't be traversed: cpu% ls d/x ls: d/x: 'd/x' does not exist But, you can cd into it: cpu% cd d And list '.': cpu% ls a x cpu% ls . a x Can't traverse it to list subdirectories, though: ls a ls: a: 'a' access permission denied cd a Can't cd a: 'a' access permission denied cpu% cd .. Can't cd ..: '..' access permission denied So, cd'ing into a directory withut +x leads to an inescapabler trap. Perhaps 'cd' should prevent entering that directory.