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 21324 invoked from network); 13 Jan 2021 00:54:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Jan 2021 00:54:27 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1610499267; b=geUZOVZaWq+WRYbSRWKpzpaiE0naWYrrofv4HDokbbk043+K9+7d9EOeZRbHz1T6JQBYIy96Ug jdt8d/e5zflXpie2rFqLbK/9xHA/AoI8GixJ3nP34ZYV+e3s6dqQThE1qCwuSYd85lhgBXU8TD TRBKJ+e5x7zpNb/+GAw1RIsQC6i3UeOiQivDzAEEmoQtDizJWyNiP2kvzAZXmrBw8PNsxFSF/j gEywJ4QtVz/mXnFy5xFhfsLt0lEnO50YAbef4Wk9FRMaRI1iUvd1TvOHlCtVtGvk3w2kBVRRwC /sm9sRumZ4h575ToKEA7exDaLXq6+qTXJr5LhXCxIzKhxQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f54.google.com) smtp.remote-ip=209.85.217.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=1610499267; bh=4mSoYJAHlmUXdi7sVWyWIHP72Bg1ik/MNHw6c6W5+s8=; 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=pSrdEqYuEEA0WhkxzcoQ3sgLxYtPw6ZmFIk5cV1CqO/wqQ8G2HZkkJ2aWle6AwecEEnFuqOm9Z XG3hDGeW4VSNB8FL8OiGJOgHhcbfFwcjNfXZ0IKeTg8b9KzzuqaG1rzY7+n2BY0bJqYdmJY8Kn N06TAqxoBwCRCmqHnyx7lzl5XP8+Q5LB+L1gK9tAGR/gHUS/Lw+DApTtomkdF4JXuCadkLBbrf JcsgxO4k6XT489krDnku1K97edSriMsfBztnQGRX/4//gcWuOSH29Bzq3k5dy3IgV0kKOQZwVB WNQa8m5Vefc0nFuxnoodn4ShmM0ayUV0m1FoX1GVBhp0JA==; 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=b4/YpQ0L/ABPgHGzElkq+h/yV1rMwjYRZneOfrFdnys=; b=P7PcGQPjWVe15zNk0IrPOoTpY5 usXchpQ9SUe4I7DjL8sAUvyAoMrLZVwOP80YwAoFgeqBam7sprPmbFopY4a3cNBqcQ/K2vMBSveVe pGKoRnKIOUpdGRnkw3dt8AIaB1ZUZpKmP/kQp+2x0z8LBgwnl8asyZrOsSerd4DQnZh2kShZz6icU X16fouFXbqMH74a8Zv2jLOjEAc4R7iAc+SkkB8s+jBF9poxTh6AI1ZCKz5cFXhBQVO0baJCXyFyhX AbGs4hzB+f+9+nrcbg7zH2tlSIy7Ai9ZJ2shHYrBXq6AdguNMLvlSizEuWjBN8F4nDAYOI6T7lQoG RIDRv3/A==; Received: from authenticated user by zero.zsh.org with local id 1kzUQZ-0007QE-Dd; Wed, 13 Jan 2021 00:54:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f54.google.com) smtp.remote-ip=209.85.217.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-vs1-f54.google.com ([209.85.217.54]:39867) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kzUQG-0007GS-Ej; Wed, 13 Jan 2021 00:54:04 +0000 Received: by mail-vs1-f54.google.com with SMTP id k30so220508vsp.6 for ; Tue, 12 Jan 2021 16:54:04 -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=b4/YpQ0L/ABPgHGzElkq+h/yV1rMwjYRZneOfrFdnys=; b=bhhIKJPp2GTYvKESiq6uiZAXEnCjyfE/2BRSCsR1XpUj7y8RTWQUw2a+oEcsrP9Sc1 5r2uFCyMSddXHRp9o462xfwpxgUSmPdXJ2CsVEQPgd0zoGRJ10PmzN9mxthQgyA7odGX 9wPYfYVHOViKZ+6M9KENY3EqzW/byvb5W8ppeNi8gZY+7iE1jQGFgk5gSmw8b9wLd9ei IJBx4RASgU0TUrRmRk5ol0KWwTag6flMmf4tTWJyiEOW6hMWRU/Od7kHoQ15JHxleBkC 2kKj+ng5JXJUOGvRbebXxvhv6ZnejB/IxfHh9J+X6ydxn08mIOhW3jSJ2vpbT1cYJC/W qnwA== 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=b4/YpQ0L/ABPgHGzElkq+h/yV1rMwjYRZneOfrFdnys=; b=ocBXpMqp6GEVUfiX7x/1ZalvwThgfSbaLpoJthoyY3dAIzMRp57/yFl8kY/M5kutMn hVX6jDVRDhsGMcgqYM4c2Ya1+1k8BBEUln51uLjit83svrPu01QbiOG2JAsBLuP/Ef6Z KJPUXxRLKr+WOveuzxjsMXTKecUf8rqiNxp0TfY57zVoDrEGARPiLriHGkCuFJslYlM0 DLKVHl/GuMgOEt6QlwuoPM7e6HSfhUKj04+mIC0k4Fv2z5t6/Xsf8ENDG+QIJxL1w+rw 1Gzn9mRTZCsirgEPQOU8cLALu1MQd/Xej3A3W6yMv8eHuBUYHqxYEYR63J9WkiUAunj1 NBUw== X-Gm-Message-State: AOAM533HcRFDCd5dKtGwA57LnXgPQIPER5foXaov5pCkFXFlqykcujqR B9e/yAB21i1TFdBtIE3XiSM2k90bx+jqMWrEZNU= X-Google-Smtp-Source: ABdhPJwILQP7jz7F5MGSnZO2cip+uwEgZ2IIQG4WJGU4nmru2zpb++JYWiWCJW+oLsL7hWA8UYSxfP53Mc+O9ptgFvE= X-Received: by 2002:a67:ff04:: with SMTP id v4mr2069330vsp.35.1610499243175; Tue, 12 Jan 2021 16:54:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Devin Hussey Date: Tue, 12 Jan 2021 19:53:53 -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="0000000000004cf1e405b8bd939a" X-Seq: 47816 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: --0000000000004cf1e405b8bd939a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 wrote: > > 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 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 > > 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.html= #tag_18_13_03 > ) > > vq --0000000000004cf1e405b8bd939a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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."

Th= erefore, this:

zsh:1: no matches found: /tmp/ina= ccessible/a/*

is wrong, = it should just print this:

/tmp/inaccessible/a/*

Also, at least with the implementation on my device, the glob() function w= orks fine as long as the folder has execute permission. (The sample was wro= ng, 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 <husseydevin@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#tag_18_13_03)

vq
--0000000000004cf1e405b8bd939a--