X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=PXwi81WeyluS7TeK 2lG4uUF6PnVKO2J+E1q6m5O+DfZqIKqm190h1qD0DFBgz1zW06zEacC5nZ+fLjzq MrckTi8LLHaz2B+P4YTo3dH8H7QhbXxZaVShtLf46t1fSuCRM7nUMlcfaDS3aOOI 9ehiFCemSI84RrMj9/v9DrXGyhY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=pq+ADsHGSjJgXC5QtRZ4iD 5CfkQ=; b=gdI8iRXtYwtSjch/786KNNyCvq4JheUOVO+lzxKwHi8M40ZxCHWZUW urFDVnJXWU2V1D9vpUtvdqYRfx+cmsn+dpdXFcMJYLlkrj3d/03U4SPBrPBoX5Q6 HLixZRF2iZPIgjqJa3SfK4pxcDrhV7d7xrYrBg0QVHJt6nRM2pmsI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=jun, Jun, Links X-HELO: mout.kundenserver.de Subject: Re: directory without search permission is searchable? To: cygwin AT cygwin DOT com References: <06DDE076-BDA6-4877-BDD3-7F670CB38DB0 AT kba DOT biglobe DOT ne DOT jp> From: Thomas Wolff X-Tagtoolbar-Keys: D20200226084222735 Message-ID: Date: Wed, 26 Feb 2020 08:42:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <06DDE076-BDA6-4877-BDD3-7F670CB38DB0@kba.biglobe.ne.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Am 26.02.2020 um 06:29 schrieb Jun T: > It seems 'ls -l dir/file' or 'stat dir/file' succeeds even if > I don't have read/search permission for the 'dir'. > > Create a directory and a file in it: > > $ mkdir tmpdir > $ ls -ld tmpdir > drwxr-xr-x+ 1 takimoto none 0 Feb 26 12:46 tmpdir > $ touch tmpdir/afile > $ ls -l tmpdir/afile > -rw-r--r-- 1 takimoto 0 none Feb 26 12:46 tmpdir/afile > > Remove all permissions from tmpdir: > > $ chmod 0000 tmpdir > $ ls -ld tmpdir > d---------+ 1 takimoto none 0 Feb 26 12:46 tmpdir > $ getfacl tmpdir > # file: tmpdir > # owner: takimoto > # group: none > user::--- > group::--- > other::--- > default:user::rwx > default:group::r-x > default:other::r-x > > This fails as expected: > > $ ls -l tmpdir > ls: cannot open directory 'tmpdir': Permission denied > > But the followings succeed (should fail, I believe): > > $ ls -l tmpdir/afile > -rw-r--r-- 1 takimoto none 0 Feb 26 12:46 tmpdir/afile > $ stat tmpdir/afile > File: tmpdir/afile > Size: 0 Blocks: 0 IO Block: 65536 regular empty file > Device: d05d00abh/3495755947d Inode: 14636698789089092 Links: 1 > Access: (0644/-rw-r--r--) Uid: (197609/takimoto) Gid: (197121/ none) > Access: 2020-02-26 12:46:12.478966400 +0900 > Modify: 2020-02-26 12:46:12.478966400 +0900 > Change: 2020-02-26 12:46:12.464849300 +0900 > Birth: 2020-02-26 12:46:12.464849300 +0900 > > Does this happen only for me? To confirm, I noticed this before. > Should I set some ACL properly? > > I removed default ACL from tmpdir but the results are the same. > > I confirmed (by a simple C code) that the stat(3p) system call > (or library function) succeeds for 'tmpdir/afile'. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple