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:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=URQxOTVDYseMm9ckxyRcNu4+F0vWd jM1NWulPIBovcd2h+DbiXZeeGCbsjw/YO1Gc+Iw1WqFza3JUQ84e9V0UUhKeUuEV ozGWa4ZwoL1IhWVyitTeICvqKx1GojUXbtljkfyOORqvOx0V5CVsGgm2ZFov7Ndk 9r6bCo6JAS2WnM= 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:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=syYI9/Cw04PgV74S5Q6FQqx4ASU=; b=fdc tK4Da5oiB+Thw++emMSuO0gSyeVZBr2iN4M5B68oN7X4+prW6EBrkJo/SWO23rlc AnlQUIR3/XthkRdmMDAglBmCAipEIyYldqyVw42eHjkVIdirpECuSMUvoQz3beIo GzVgeCH89RGrnXWbZlLmChDhazaoO+Sdec20oHmI= 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-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*M:local, help!, HTo:D*edu, HAccept-Language:en-GB X-HELO: outmail148109.authsmtp.co.uk From: David Allsopp To: Ken Brown , "cygwin AT cygwin DOT com" Subject: RE: umask not working? Date: Wed, 21 Mar 2018 15:32:52 +0000 Message-ID: References: <000f01d3bf80$a2e0d8c0$e8a28a40$@cl.cam.ac.uk> <21cc08fa-d68f-619f-5c11-ff1c903c74d0 AT cornell DOT edu> In-Reply-To: <21cc08fa-d68f-619f-5c11-ff1c903c74d0@cornell.edu> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-Server-Quench: 1f439c41-2d1d-11e8-9f3c-9cb654bb2504 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZ5RRob BmUtCCtbTh09DhZI RxQKKE1TKxwUVhJU L0JGL0JXPR1GBEcD Anl2ChZLUl1wUXN0 bgBSbw9YYQRMXgZ0 UUhMXFBTFhtpABge BBsBU1c1dXkwHz8z IEZqWnJcWwp7dUN9 RgBVQ2kFbDRkaX0d BEEMagJVJQtXd0lG OU12ByELZGFVNHhl R1MlBR1jdShaIT9W CgcKMRoNRlwIHzgz EHgA X-Authentic-SMTP: 61633634383431.1039:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 213.105.212.114/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w2LFXCQH016719 Ken Brown wrote: > On 3/21/2018 6:36 AM, David Allsopp wrote: > > Ken Brown > >> On 3/19/2018 8:48 AM, David Allsopp wrote: > >>> Is this expected behaviour: > >>> > >>> OPAM+DRA AT 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 > >> > >> See if this helps: > >> > >> https://cygwin.com/faq/faq.html#faq.using.same-with-permissions > > > > Thanks for the pointer. I wonder from it if this could be to do with > the Cygwin installation being old (but upgraded). I tried on the same > machine creating another installation to C:\cygwin2 (which behaves as > Roger Wells noted) and then ran getfacl /tmp on each: > > > > Old installation: > > > > # file: /tmp > > # owner: OPAM+DRA-Admin > > # group: OPAM+None > > user::rwx > > user:OPAM+DRA:rwx > > group::r-x > > mask:rwx > > other:r-x > > default:user::rwx > > default:user:OPAM+DRA:rwx > > default:group::r-x > > default:mask:rwx > > default:other:r-x > > > > Fresh installation: > > > > # file: /tmp > > # owner: OPAM+DRA-Admin > > # group: OPAM+None > > # flags: --t > > user::rwx > > group::rwx > > other:rwx > > default:user::rwx > > default:group::r-x > > default:other:r-x > > > > I expect that the extra OPAM+DRA:rwx on the old installation was > manually added by me, years ago. What are the "mask" entries all about? > > > > The default:mask entry seems to be the crucial one, as if I do setfacl > default:mask:rwx /tmp on the fresh installation, then I get the same > behaviour as on the old installation. > > > > However, I'm struggling to find references for either what these mask > entries are, or how they ever appeared? > > If you search the web for "Posix acl mask" you'll find lots of > information. Here's one that seems pretty good: > > https://cs.unc.edu/help-article/posix-acls-in-linux/ Indeed, I got a lot further once I stopped looking for Cygwin-specific info. The most useful part was eventually finding this in the umask(2) man page (http://man7.org/linux/man-pages/man2/umask.2.html): "Alternatively, if the parent directory has a default ACL (see acl(5)), the umask is ignored". Which explains why I was seeing that behaviour, and it was owing to having added my user account (the OPAM+DRA) to the ACL as that of course added w to the mask. Thanks for the help! David -- 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