X-Recipient: archive-cygwin@delorie.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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=mi1xhvBhtkTQVhZn
	iCcM0o5IS3p/HEjH7ZQE7DqwH7O52ryphGDyGDiQslw59NYJTTgFSAeV5drGqUgn
	zYsDITxr4NGFHEdjcIzApVJzBheHrs+Agh+PqX4LgsmcqRtAPJCoM4TiZTvT4tqj
	dePCuLgriuAJgvBWvK/PFVZFVIg=
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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=cB0FrDfH8U1RnkRN5dExl+
	XAlWM=; b=FCFdz8urgmvKilovzo9WZiw7weiBpieXBIudSgMCIj/TLhFu0zKima
	nVYjFhee3ptnRfV3M7/ciqY8vjNnATsPTGjvLwbWTntTASpjjZj4kQ+qikNIp43h
	VXPM6ZBVFaUr3/XhfSSRIcekpC9XFyC6q+7c8GfQFQva8oId6PFzk=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,MIME_BASE64_BLANKS,MIME_BASE64_TEXT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*M:yandex, H*RU:192.168.1.10, H*r:ip*192.168.1.10, Hx-spam-relays-external:192.168.1.10
X-HELO: forward102p.mail.yandex.net
Authentication-Results: smtp2j.mail.yandex.net; dkim=pass header.i=@yandex.ru
Date: Wed, 21 Mar 2018 15:33:38 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <1787166367.20180321153338@yandex.ru>
To: David Allsopp <David.Allsopp@cl.cam.ac.uk>, cygwin@cygwin.com
Subject: Re: umask not working?
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D90189B91D4F@Remus.metastack.local>
References: <000f01d3bf80$a2e0d8c0$e8a28a40$@cl.cam.ac.uk>   <1941712084.20180319200734@yandex.ru>  <E51C5B015DBD1348A1D85763337FB6D90189B91D4F@Remus.metastack.local>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w2LCaoA4004081

Greetings, David Allsopp!

> Andrey Repin wrote:
>> Greetings, David Allsopp!
>> 
>> > Is this expected behaviour:
>> 
>> > OPAM+DRA@OPAM ~
>> > $ uname -a ; umask ; touch /tmp/foo ; ls -l /tmp/foo ; mkdir /tmp/bar
>> > ; touch /tmp/bar/foo ; ls -l /tmp/bar/foo CYGWIN_NT-6.1-WOW OPAM
>> > 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin
>> > 0022
>> > -rw-r--r-- 1 OPAM+DRA OPAM+None 0 Mar 19 13:44 /tmp/foo
>> > -rw-rw-r--+ 1 OPAM+DRA OPAM+None 0 Mar 19 13:44 /tmp/bar/foo
>> 
>> > Why does the file /tmp/bar/foo get g+w when /tmp/foo doesn't - I'm not
>> > sure what to look at on my system to diagnose what I may have
>> > inadvertently tweaked. The directory itself is:
>> 
>> > drwxr-xr-x+ 1 OPAM+DRA OPAM+None 0 Mar 19 13:44 /tmp/bar
>> 
>> Let me guess, /tmp usertemp ?

> No - it's default mounts, so /tmp = C:\cygwin\tmp, to which my
> (non-administrative) user has write access. 

>> You have extended ACL on the object. And overall, umask is not a good
>> idea in Windows.

> "umask is not a good idea in Windows" - where's that come from?

From knowledge and experience.
umask is strictly simple POSIX modes concept. In the ACL environment it is
anything from inappropriate to disastrous, but never useful.

> (In the actual scenario where I'm being bitten by this, it's because a git
> checkout is altering files which were 644 to be 664, so whether it's
> precisely umask or not, the *change* of permissions is the problem).

Use setfacl.


-- 
With best regards,
Andrey Repin
Wednesday, March 21, 2018 15:32:21

Sorry for my terrible english...
--
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


