From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23700 invoked from network); 13 Jan 2021 01:12:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Jan 2021 01:12:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1610500373; b=KsZUx7MxIVU6C6+A4HbCRNDXerkbG3dvCF+BODJ+ZierRgL4MXmvWjUixJvgizvMmjsbYZWaCR /1KzHAIh7v74ubqB3utaC0GtGwGXUl4HOWdpqD/MRths54Ht8ZPQYyq8dNxMpqGpQWZ7evVH5d xBLfj5A94b88u5PBOHMCf25zooqX+ooc+YUgonchhwz2OQ++7lvEshOZ0m5ofrPrTYf21T+2Gs LHHW+sqWbYig0aY05FQUAZXuelKLWHRqqcC+aYebFkpKDR7wWreAU0vUW/j9FWNi7ay0KkCHlk Bpau1CbwNGNlgo941wbSImc4HoXGVlMwMIxMVL2mbHkDTw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ua1-f54.google.com) smtp.remote-ip=209.85.222.54; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1610500373; bh=Vs86g+s+Ix5RYEdan5kvfEKsQnmILQrpIaCXCweRGqI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=iUvR4StB/ZtCOhxym1SRlyI4+qtnfODFlC4KVjlYvqnEMaWPNxZv51SbEIXSjFtI6he+Xa7txQ 72oAaSzLs+hctXkAcoxNDiQDz2IMeqSs4K2+f9kwm1yEkGtw9ILNLbLUHcQsc8NOyBpod65S04 1fGVqhsp20vj6Km+OfLdT7dz5whNRvnzUBJAFsJUYVNee8M2Of3FNWYOIfo1nftyUyF6lfY3zd tjD9VEzrM4rmi0/LEuo/xiT76ATKHzc/hDMhlTW6c/9upWx77eYtHIlA5nOAs4WiAP9gJhn1E9 yDpdSS3ANzoZSRKxXAovrz/GmqWXXEznSMohr/QukcQ/gg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8CLBsxhhVryMfk5AGPxWCQAHcwyoFW1J6JDpZpK1J/Y=; b=MJPfsrBdJi8Qb0toipS2CfOwg2 NYT5cu5ZIPwP+Hs8ZkCStG0U2iZq3cX51RVhqktGpaTaRDgKB7o5o/zOOxMF9tM1Br9FbpDnBrtP9 iO2gpYRSo4Mlnz8IAQbNUTQqq3bAUJNZ2n9P7axfQ4SbijkHqutRiPttGPZi4H5BAcB5xFsZ+/j2+ QMJtWb12JXUcgxk9FstQoeonIVb5zqVo9ueYoj/e0KbtoLGyCdCNr8I8n3TMnwq7MHxGa4PxrE+86 uwJxpUzK7ep7w4GJndiQj7Av4GmQUHZo2LdLsyYBmxHAD5t60tvrdgX3N+owL9u0S19zF3ZXeRcjt Y42DXJnA==; Received: from authenticated user by zero.zsh.org with local id 1kzUiO-00088A-0P; Wed, 13 Jan 2021 01:12:48 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ua1-f54.google.com) smtp.remote-ip=209.85.222.54; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ua1-f54.google.com ([209.85.222.54]:33060) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kzUi1-0007z5-8q; Wed, 13 Jan 2021 01:12:28 +0000 Received: by mail-ua1-f54.google.com with SMTP id i25so186271uat.0 for ; Tue, 12 Jan 2021 17:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8CLBsxhhVryMfk5AGPxWCQAHcwyoFW1J6JDpZpK1J/Y=; b=cnf8UZH6ZN3DomzzlU9F35xnEoFpAD1YF1ER1bFOhJYVDGbDnxtYj6ZfeDWSfLpe62 0qXD0BidsbkQs76vTSCsvu6hRYG/f/5XbDmi1i+jnOBWkP9OGWJJD4Mvi2CfVXLZTNzP RtswIBHeaOTBNO3V8MKjY9CAuohWe+Fx8LluUIzyjPLnp2ckUlafdwW5b6bvbKFqOBl0 LXU5Uxeqd26F70oqvj/JlAp3Kj7IhNWPxeqcWcznyJVVWsiUR1alOCY4FE9YEwmGXpM2 xmDkvwMLTdOToTNT1PGqNVD8i9UjO2uB8pCAMNDSGBNwWoMN+cD9kHdOBBYYhECI5j8r vTJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8CLBsxhhVryMfk5AGPxWCQAHcwyoFW1J6JDpZpK1J/Y=; b=LENzHERiD7wthtPA9oo92Q7t7sw/HbR+sojOR0KZCOkq1N2DOJOXpvx09I0iUezgrX 28bJCvn2oZENjqVOdSFxk3eoYbWf33v4uTEbgBvRHSUdzz0Z16xTXisTvssKv3fUKNx9 r4h3UGTeln1C4+9DQvVfYkkHUe4RCKhnbaaw8d5M5VlOMwNDGIrLy88ChFKHJzqC3E/2 aYy3KWsvborQrY4Y+zj+dHZgRyf7rHMyDTjA6e6P1kUbeToido3Nm4hrKcSnqBH/zVqK kWubIq/GB1PkmsJ1IhZI9iT6W+I0mufNParKTMDfyJhqDYMcF25knwG0c69dkiXJJSmv oFzA== X-Gm-Message-State: AOAM531G4Zz5FEFS16EyEb/K1WORP/zJrPGEWTomLYaLzzaK2OPQmwWq NCmEjlpxH3xoWjk6zD0WrMBu8qXHGIDUUTgma08e5LTq3ZI= X-Google-Smtp-Source: ABdhPJwbXmR64EVlZC12HU6EWhtTLkV1wU33KJXtZhzY0yHw4urIFX4wPwKzaErOJY3b19pibx3YYJnq0Bb6+TyespM= X-Received: by 2002:ab0:2348:: with SMTP id h8mr2072175uao.4.1610500343771; Tue, 12 Jan 2021 17:12:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Devin Hussey Date: Tue, 12 Jan 2021 20:12:14 -0500 Message-ID: Subject: Re: [PATCH] Ignore EACCES when doing non-pure globbing To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000e6b52805b8bdd455" X-Seq: 47817 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --000000000000e6b52805b8bdd455 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Actually, scratch that, I can confirm that Android has their permissions set to 711 on the /data folder. Otherwise we wouldn't be able to cd to them. And the 1 bit *is* the searchable bit (not the executable bit) for directories (TIL), so /data is searchable. So, both the pre-patch and post-patch behaviors are noncompliant. The first is too strict and this is too lenient (although I prefer more lenient than strict). Back to the drawing board, I guess. On Tue, Jan 12, 2021, 7:53 PM Devin Hussey wrote: > We are already violating POSIX with our globbing: > > "If the pattern does not match any existing filenames or pathnames, the > pattern string shall be left unchanged." > > Therefore, this: > > zsh:1: no matches found: /tmp/inaccessible/a/* > > is wrong, it should just print this: > > /tmp/inaccessible/a/* > > Also, at least with the implementation on my device, the glob() function > works fine as long as the folder has execute permission. (The sample was > wrong, it should be 111, not 000) > > On Tue, Jan 12, 2021, 6:47 PM Lawrence Vel=C3=A1zquez wrot= e: > >> > On Jan 12, 2021, at 5:42 PM, Devin Hussey >> wrote: >> > >> > Even if we can't access a parent folder, there is still a chance we ca= n >> > access a subdirectory. >> >> I might be mistaken (entirely possible!), but this behavior seems >> to violate POSIX volume 3 chapter 2 section 2.13.3, which states >> in part that >> >> Specified patterns shall be matched against existing filenames >> and pathnames, as appropriate. Each component that contains a >> pattern character shall require read permission in the directory >> containing that component. Any component, except the last, that >> does not contain a pattern character shall require search >> permission. >> >> ( >> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.htm= l#tag_18_13_03 >> ) >> >> vq > > --000000000000e6b52805b8bdd455 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Actually, scratch that, I can confirm that Android has th= eir permissions set to 711 on the /data folder. Otherwise we wouldn't b= e able to cd to them. And the 1 bit *is* the searchable bit (not the execut= able bit) for directories (TIL), so /data is searchable.=C2=A0

So, both the pre-patch and post-patch beha= viors are noncompliant. The first is too strict and this is too lenient (al= though I prefer more lenient than strict). Back to the drawing board, I gue= ss.

On Tue, Jan 12, 2021, 7:53 PM Devin Hussey <husseydevin@gmai= l.com> wrote:
We are already violating POSIX with our globbing:

"If the pattern does not match any = existing filenames or pathnames, the pattern string shall be left unchanged= ."

Therefore, this:=

zsh:1: no matches found: /tmp/inaccessible/a/*<= /div>

is wrong, it should just= print this:

/tmp/inacce= ssible/a/*

Also, at leas= t with the implementation on my device, the glob() function works fine as l= ong as the folder has execute permission. (The sample was wrong, it should = be 111, not 000)

On Tue, Jan 12, 2021, 6:47 = PM Lawrence Vel=C3=A1zquez <vq@larryv.me> wrote:
> On Jan 12, 2021, at 5:42 PM, Devin Hussey <husseydevi= n@gmail.com> wrote:
>
> Even if we can't access a parent folder, there is still a chance w= e can
> access a subdirectory.

I might be mistaken (entirely possible!), but this behavior seems
to violate POSIX volume 3 chapter 2 section 2.13.3, which states
in part that

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Specified patterns shall be matched against exi= sting filenames
=C2=A0 =C2=A0 =C2=A0 =C2=A0 and pathnames, as appropriate. Each component t= hat contains a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pattern character shall require read permission= in the directory
=C2=A0 =C2=A0 =C2=A0 =C2=A0 containing that component. Any component, excep= t the last, that
=C2=A0 =C2=A0 =C2=A0 =C2=A0 does not contain a pattern character shall requ= ire search permission.

(= https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#t= ag_18_13_03)

vq
--000000000000e6b52805b8bdd455--