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 E9C742838EC6 for <9fans@9fans.net>; Sun, 7 Jun 2020 10:48:54 -0400 (EDT) (envelope-from eekee57@fastmail.fm) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 688F957E5FF; Sun, 7 Jun 2020 10:48:54 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1591541334; b=Uy37UTPYHqy2g2Z8rp1I28nC1Hrt4hTzvbR5D3I3X59Q87j8db FBgMZnFIlkH8A22J3t3riYiVL8kD5nz/dGpKOPi3Xq4uXWIm0TblkUHx0Kjjsa0r v+kjlSkh+tCYs737HF8d+XWwGywcm8fOalYZnkRYchR20Y0AeyRedlTHttNwsPPV b1iQtlnXT0nDxP8WHCvnmaUdr2HCdZBMxl5yC0c7+uo6CVAs6mFUUGFYnYLCDmMK Emesprhz/XXSo22Ym/c2jBc2FNpuS2/9ivwqQ4s2jXpRD5F3udMgZJck4D/KY/EB Coy7ZKxp2LofnHoBjbth5kgiY4pWPuL5GiRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:message-id:in-reply-to:references :date:from:to:subject:content-type; s=arcseal; t=1591541334; bh= /x05JR181oLb3B1nbBlxsaYRSAZZAEnUoIZ11HSBni0=; b=ZYjyUV7QW4kgWPOe dDNK6gSyH5yaf2iOrLM6oF8OSfFjOHwwc7CkHkRfaYEz66TBIaAsD8B2ILulGCuB qHBA9XzpXNGSEWnWjhWvHpQopi/kKFBp1QX+sZ6R/nWnwJ86gZkeJNND4cySLbkD VAz0VANNFgpMPg06IoA+NdEqZd5XeF4IpYsVaMhcC8xCGeZL3LMkczxW0Q1R5GAs yzoIcGpGBQ7eEbyaZLXywJRPufSXA2egMfbTKZPUJwXIT1jhgj7BOEsKiDqv1q+t 7YD0Jlsbml54QeUL5umKBoUXf4pWfNqHnO7PKJB/P+pxUKE3qt1CI7k5V35iH9D2 SYSGqw== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=fastmail.fm header.i=@fastmail.fm header.b=O0B3y+AO header.a=rsa-sha256 header.s=fm3 x-bits=2048; dkim=pass (2048-bit rsa key sha256) header.d=messagingengine.com header.i=@messagingengine.com header.b=CUqxDtKk header.a=rsa-sha256 header.s=fm3 x-bits=2048; 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=fastmail.fm; iprev=pass smtp.remote-ip=64.147.123.21 (wout5-smtp.messagingengine.com); spf=pass smtp.mailfrom=eekee57@fastmail.fm smtp.helo=wout5-smtp.messagingengine.com; x-aligned-from=pass (Address match); x-ptr=pass smtp.helo=wout5-smtp.messagingengine.com policy.ptr=wout5-smtp.messagingengine.com; x-return-mx=pass header.domain=fastmail.fm policy.is_org=yes (MX Records found: in1-smtp.messagingengine.com,in2-smtp.messagingengine.com); x-return-mx=pass smtp.domain=fastmail.fm policy.is_org=yes (MX Records found: in1-smtp.messagingengine.com,in2-smtp.messagingengine.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=fastmail.fm header.i=@fastmail.fm header.b=O0B3y+AO header.a=rsa-sha256 header.s=fm3 x-bits=2048; dkim=pass (2048-bit rsa key sha256) header.d=messagingengine.com header.i=@messagingengine.com header.b=CUqxDtKk header.a=rsa-sha256 header.s=fm3 x-bits=2048; 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=fastmail.fm; iprev=pass smtp.remote-ip=64.147.123.21 (wout5-smtp.messagingengine.com); spf=pass smtp.mailfrom=eekee57@fastmail.fm smtp.helo=wout5-smtp.messagingengine.com; x-aligned-from=pass (Address match); x-ptr=pass smtp.helo=wout5-smtp.messagingengine.com policy.ptr=wout5-smtp.messagingengine.com; x-return-mx=pass header.domain=fastmail.fm policy.is_org=yes (MX Records found: in1-smtp.messagingengine.com,in2-smtp.messagingengine.com); x-return-mx=pass smtp.domain=fastmail.fm policy.is_org=yes (MX Records found: in1-smtp.messagingengine.com,in2-smtp.messagingengine.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduhedrudegledgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredtreertden ucfhrhhomhepfdfgthhhrghnucfirghruggvnhgvrhdfuceovggvkhgvvgehjeesfhgrsh htmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepffdvtdehgeekfeefgfeufeejudet vdfggfffkefgjefhteekgeevjedvfeeuueeinecukfhppeeigedrudegjedruddvfedrvd dunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepieegrddugeej rdduvdefrddvuddphhgvlhhopeifohhuthehqdhsmhhtphdrmhgvshhsrghgihhnghgvnh hgihhnvgdrtghomhdpmhgrihhlfhhrohhmpeeovggvkhgvvgehjeesfhgrshhtmhgrihhl rdhfmhequcfukfgkgfepieduhedvpdhmrghilhhfrhhomhepvggvkhgvvgehjeesfhgrsh htmhgrihhlrdhfmh X-ME-VSScore: -100 X-ME-VSCategory: clean Received-SPF: pass (fastmail.fm: Sender is authorized to use 'eekee57@fastmail.fm' in 'mfrom' identity (mechanism 'include:spf.messagingengine.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="eekee57@fastmail.fm"; helo=wout5-smtp.messagingengine.com; client-ip=64.147.123.21 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (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>; Sun, 7 Jun 2020 10:48:54 -0400 (EDT) (envelope-from eekee57@fastmail.fm) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 39951417; Sun, 7 Jun 2020 10:48:53 -0400 (EDT) Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Sun, 07 Jun 2020 10:48:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=/x05JR181oLb3B1nbBlxsaYRSAZZAEn UoIZ11HSBni0=; b=O0B3y+AOOWPURJGjo2fDcat3F7KBOrfEIrCz8fdVZwkX4sr vQJuBylvwZHjACo70a+rB6nEvlfgO3H9F1gHyAd+y82Q9G4CljkXwCipftnn4JqI syRq9POFYtXSm4QnAUkbYFwYj8sH5Cb6kJsKL2ypsc+vVTngW6eDyPBUaMr7+8s4 nvHn6MRgYi55tpZnqg+9YjMVOa4jiEGcS9MaUpzqXPKz82HXFLJB8E+XelJ0qOl3 i6D8+yDtdctvcP1wWUuP1lhUIfCYFfaK5NrrS3RDPmx5/u1DLehwUdrbHZVkgkTM mA71w8VOa+NXrGgWhlKvuDbSgYVxdAsQjLKtr8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=/x05JR 181oLb3B1nbBlxsaYRSAZZAEnUoIZ11HSBni0=; b=CUqxDtKknEVSNPFOQ6oZgf JuA7GL5kO2Idkkye8mBN3J5Rf3/lxfODDpKrgoSkdtd1oi7uZHJ0iguaPFPKKqMm kRO7jYmR9dclznDSIxCkE8DGi42P6zuFUoDXB4v++AVJ3t7hgzYbukS3eWzHXM75 xcSKSV4t6OVuT9HKvwLuMwTTbLhoKLB9saoFisy86+F9Yi65cWs7Xb7ckB3ZBsVz 3pAoVs/iVKSc1QeFHCoed7hSr7YEqQL+UUH3QdRoHOWOGOO5TO+83EaoLLqVX3bW FDwhBGIfIbKX5P7KrZZngXekaGjR6eKn9hBdLGs7DvHGyYMTKApre3DZYjkSR+tQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudegledgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfgthhh rghnucfirghruggvnhgvrhdfuceovggvkhgvvgehjeesfhgrshhtmhgrihhlrdhfmheqne cuggftrfgrthhtvghrnhepffdvtdehgeekfeefgfeufeejudetvdfggfffkefgjefhteek geevjedvfeeuueeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepvggvkhgvvgehjeesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6580214C007C; Sun, 7 Jun 2020 10:48:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-519-g0f677ba-fm-20200601.001-g0f677ba6 Mime-Version: 1.0 Message-Id: <309c60a4-29cb-4789-ae18-9388bd8b60b3@www.fastmail.com> In-Reply-To: <58181689FAB504813F509082A0F70248@eigenstate.org> References: <58181689FAB504813F509082A0F70248@eigenstate.org> Date: Sun, 07 Jun 2020 15:48:33 +0100 From: "Ethan Gardener" To: ori , "g_patrickb via 9fans" <9fans@9fans.net> Subject: Re: [9fans] `test -x` returns wrong results for directories Content-Type: text/plain Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 055bf762-a8ce-11ea-b9a0-d015d5c361b4 On Sat, Jun 6, 2020, at 10:13 PM, ori@eigenstate.org wrote: > > 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. sarcasm? i've been confused about search permission since my earliest linux use where i experimented with permissions to see what, exactly, they did. it made no sense then, even without plan 9 leaving permission checks up to the individual filesystems. (this would have been linux 2.0.0) > > 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. thanks for your analysis too, although you didn't say what filesystem you're using. i had to laugh at that trap; doesn't software get ridiculous sometimes? but it made me think, because charles said fossil doesn't handle the execute bit properly. perhaps once plan 9 went open source & had a public contrib, someone made just such a trap in contrib and fossil's permission handling was changed to stop it happening again. regardless of the cause, fossil just moved up another notch in my estimation because directory search restriction is so broken. i just checked linux 2.6.30. (old vm i had handy.) it's much like you describe except there is no trap. cd is indeed prevented and if you're in the directory when "search" permission is revoked, you can't list it but you can `cd ..`. "search" is exactly the wrong word for what this bit does, because if you don't have "search" permission, the one thing you can still do is look at the names... which lets you search them! it's more like "permission to open the display case and touch the things inside" or "permission to step over the museum's rope barriers".