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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13241 invoked from network); 25 Jan 2021 00:15:54 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Jan 2021 00:15:54 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611533754; b=Mpu5DzbIv9bYisIAk6YCyk5oXiK7SP9jf11qii/jYGN4EyHApoHVIVwiLHpo0VuJBZfG/8eUHP KPpy/emOaLnAUnRA5o4hcOAju/IUJfaYZ5TeE0DC+GwVvE2JHGarDf6KEzp6RQrENq6f5Do3rO W0ai0ZwFVhSaNGUCgVLT+3hBCmFSpi+q0cd6Q8HHxae9+n7/weAjcMKzcRDqezlCMI4qkwDiex 9Yv9dN7n5fF13v2yexf9zGpR3mw6n1EswhsUbAQHlg+AUfDu+CrWUZAjv7D+9wSf9dbudxGuO2 Hfd9MEpQxtBbHpS7ADvXOjHm9WaVYdRZ6cbC4Si4sh0Hrg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f176.google.com) smtp.remote-ip=209.85.167.176; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1611533754; bh=dbiv6nNeuCTMy1S3DWT4iXRLR83iPB+YN3Gq3nWivzk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=ZHiM6ojg0Nf+7TUIoxCZhNOGFZQxEtBFjf+DTwvVx2UH1fb8z5C/4Nozbu3h4AKpczzdOwpcrT xKCtv1aV4K2z/+gg3iG/P1R7f5tzwixsWzsIrBaX96WDHmY4hRMSAPACPRmyOBbdfHCEVv3Ebk imr6tu26TSrREzgD21kZbcvnb5rwviFaXb+ZRbpV6g5gM06eNM7RhoN2SDDbwaYzDbvccMPhvo yFrbxI4uMSxEFMbeOaS0qKzrW7+2RTHDZZsdBTus9nX9vjEiev7xZdiGJtwXvNiAnw6thZzYap ymzyrDFy4kuRqRnk6MxduvVP/Kr0OIcg7lrLvN30dQ11Dw==; 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:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=vVR7qvG7T64AdfRajsm8t8rK8eF1M4DTvdNjONVf4is=; b=b1DUOG77J6QOX2Q9KvivWumoiM d4KDsXghL8S307oqfvoc0DCv+6HwMdn6B7sdiYgds8aqH3p1MnUiHChqRuiI+xN4NIQ46SoDxME+A 6WVyUB+sRmT7m201UEevLwTozbjE9ibD+qLCbppexfy92ohU0tqgTjj2m2Q4V3FSHR02zQ6tCjiXH tSGTYDp+o1/cejk5a8cb4hlTa9iMC1Yh5Xrivdk2KICC+2ulS4W2zrfvmfhMr/frTfOPcaK3MGt7Y LVQDyc7+I1msWAOGLvfACa/yQ/CLK3xKFEnaZxrG8s91/Zg/ApxAHxt9qRvTnLP6QOuG7S74E78Zc HsaJJvoQ==; Received: from authenticated user by zero.zsh.org with local id 1l3pXs-000Hoh-W0; Mon, 25 Jan 2021 00:15:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f176.google.com) smtp.remote-ip=209.85.167.176; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oi1-f176.google.com ([209.85.167.176]:38212) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l3pXc-000Hfg-7z; Mon, 25 Jan 2021 00:15:37 +0000 Received: by mail-oi1-f176.google.com with SMTP id h6so11645915oie.5 for ; Sun, 24 Jan 2021 16:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=vVR7qvG7T64AdfRajsm8t8rK8eF1M4DTvdNjONVf4is=; b=uhvL/RYVaRzp6rkXseoR/jPUJegRltUgtiFdO0G8oYJFdWod7ozWi+6ZCUJXcN0Sox EWp5UVHvEZ25pgkm+iHVnGDVyPWir6cebfm0UELdq+a3JHDOv02wRhc7sNQaWKsei6fh 2sKhdza62NKj3Gsb6TrYy5k2NPn+rXmUU3Nh95qvd7D55nw22VE2YUU9+pdIdh2oDGs4 RK8iF5Ge4syQI3npeCmYzYn0rFGyDHpw3JoBXThmBxeSkKNhS/wgMH0WPwXOHMBE4v3/ 57Zt/KfWydiLnvRxAEiAxSIeL19YEaBkRw/jfPQqtSCku2D/Yv81hvMS/cLefhYpdNDb jQIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vVR7qvG7T64AdfRajsm8t8rK8eF1M4DTvdNjONVf4is=; b=WN5RZFuD8vpMjFsdzy5NE6+v2YOQ2K3QgvnfPW8P4Wa5c2FzEt5n03JUoI2z7qujFF hf3csbkyyQW4GNUJRYzit1o2dMnRNUwVdgZATbZgYaqvCn+gnd6ylzZdh3Xr2koHUrmp ay86gtaVewRmtDuWmKIRDN2RPYvBhh1oGACYq40D9GnBEJK8rTDwnUU5ZFN+VSUUMWFZ 4fiIBTHMAsdovg5Cds58C9Rsb5d5+4fQ9XKYs965wQ1ZGw3E8Lv9Z9myZgfHzyyxszPg xO9+h1lIdToHbt7BWWbQeOXCTC83Vo1Nt920e+6el5aaLmZ7ibJNNzg2AZWjF6KaNJ5G G/wA== X-Gm-Message-State: AOAM533oVFqxJ0xPUB5WmqkPCau253eWf2XDAJX6Z026cST5u6jSUzLd y87+mwwDG9tJdsVb4Xrdf3LZFaOZP2Q65KoQpoMyJqobGpTj/A== X-Google-Smtp-Source: ABdhPJxRJ0hm6/8Uc9oq3bcvQraVAeeCOIK6kWNW7VJKKCsfxAvzWhhUx/Ii40u7WXxZ24hW00Zb2chg+NzDap0RRWo= X-Received: by 2002:aca:6089:: with SMTP id u131mr9381702oib.84.1611533734368; Sun, 24 Jan 2021 16:15:34 -0800 (PST) MIME-Version: 1.0 From: Bart Schaefer Date: Sun, 24 Jan 2021 16:15:23 -0800 Message-ID: Subject: [PATCH] Tests for globbing below protected directories To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47865 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: Does this test look as expected? Note there are trailing spaces on the "print -raC 2" output, which surprised me but has nothing to do with the test itself. This doesn't test for the CASEGLOB issue last mentioned in workers/47832. diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst index 176846d46..d3b2e9ec2 100644 --- a/Test/D02glob.ztst +++ b/Test/D02glob.ztst @@ -741,6 +741,23 @@ >glob.tmp/secret-s111/ glob.tmp/secret-s111 >glob.tmp/secret-s444/ glob.tmp/secret-s444 + for 1 in 000 111 444 ; do + chmod 777 glob.tmp/secret-d$1 + touch glob.tmp/secret-d$1/file + mkdir -m 777 glob.tmp/secret-d$1/dir + touch glob.tmp/secret-d$1/dir/file + chmod $1 glob.tmp/secret-d$1 + done + print -raC 2 -- glob.tmp/secret-*/* glob.tmp/secret-*/file +0:names inside unreadable directories can be globbed if searchable +>glob.tmp/secret-d444/dir glob.tmp/secret-d444/file +>glob.tmp/secret-s444/dir glob.tmp/secret-s444/file +>glob.tmp/secret-d111/file glob.tmp/secret-s111/file + + print -rC 2 -- glob.tmp/secret-*/dir/* +0:glob files in readable directories inside unreadable directories +>glob.tmp/secret-d111/dir/file glob.tmp/secret-s111/dir/file + # On macOS, stat(2) allows files to be treated as directories if the calling # process has super-user privileges. e.g., stat() on /my/regular/file/. will # succeed as root but (correctly) fail otherwise. This can produce strange