From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96984 invoked by alias); 26 Feb 2020 07:42:26 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 96973 invoked by uid 89); 26 Feb 2020 07:42:26 -0000 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 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.187) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Feb 2020 07:42:25 +0000 Received: from [192.168.178.45] ([95.90.246.218]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M89XH-1j2CdB38jb-005EA5 for ; Wed, 26 Feb 2020 08:42:22 +0100 Subject: Re: directory without search permission is searchable? To: cygwin@cygwin.com References: <06DDE076-BDA6-4877-BDD3-7F670CB38DB0@kba.biglobe.ne.jp> From: Thomas Wolff X-Tagtoolbar-Keys: D20200226084222735 Message-ID: Date: Wed, 26 Feb 2020 07:42:00 -0000 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 X-SW-Source: 2020-02/txt/msg00233.txt.bz2 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