delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/02/26/00:32:00

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:from:content-type:content-transfer-encoding
:mime-version:subject:message-id:date:to; q=dns; s=default; b=on
CmdIoHPGvNlWiPTZ5RK6THpNMwygvseC1joETk2jzrS8BOR+PylP4kWS058VAobf
aqWdTlr/SHXghfNhaaXF8GCh+3uJO+DpMTSa+Y3AQ1z7teGxLpZSVKTL97p5MFYM
WAbgTjXFowKZ+YRFufgzsjOarxdmp6HYAgbGlN2Ds=
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:from:content-type:content-transfer-encoding
:mime-version:subject:message-id:date:to; s=default; bh=+mXNEsh7
pOaNCIMHCPfn1PvTLSY=; b=kWEYU/cFtW71GYDMMTWvNWG5QkjQvPucztOT8mKM
sDGmexe54LZFeRpTNEc5T2zsWRIJti/vZuD4jiujnXbkv7Cj16MUHGmg/xBjL9Dc
LHo07Vn044lQLgjHAIQmKPBJvoYx+KlIcwYilYEAwaazWGdn0sJnril9D63CVwBk
DjY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-1.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=Links, Device, birth, Birth
X-HELO: rcpt-expgw.biglobe.ne.jp
X-Biglobe-Sender: <takimoto-j AT kba DOT biglobe DOT ne DOT jp>
From: Jun T <takimoto-j AT kba DOT biglobe DOT ne DOT jp>
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Subject: directory without search permission is searchable?
Message-Id: <06DDE076-BDA6-4877-BDD3-7F670CB38DB0@kba.biglobe.ne.jp>
Date: Wed, 26 Feb 2020 14:29:57 +0900
To: cygwin AT cygwin DOT com
X-Biglobe-Spnum: 4883
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 01Q5VehA002553

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? 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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019