From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 04DA13857033 for ; Thu, 8 Apr 2021 20:28:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04DA13857033 Received: by mail-pj1-x102d.google.com with SMTP id t23so1760780pjy.3 for ; Thu, 08 Apr 2021 13:28:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G88XDScMLLaQ3NVFSneG/fU5wKsXl1YM4fZz5rB5hXI=; b=HZk0kRWiEWNs0cf+fuhySa8/AB60f7BF6gqYtpAmAunvGWltwX2LcZ7UyQLJMAsDcR +q84xeb7AnqaIR3bkH4ro2TYvfHNXZMqHdq7kLv0340LR/8hA1NAoeaY8Q0B2COgO+pm 7cQTSFbi4A1DzWJDSl9mJRD7gZHR6woJ57qTg9KmaGylZqfex4FbQhZkTNfHzVhgBrke 6TJAR7hRQ0tNw4Ry58WY7ky6Xu8JVmqND4ni2i3J4ePJ8YuIWP21VU0nUvA9rwxrIcFg vv4NXPIX/YrVRcHNFkQde/glaIvwgx47nu3wtaBeX9QP5c1YNFqa84LWKDad06OX5Q/H IxrA== X-Gm-Message-State: AOAM531wNynIqPwazdUb9DIiWAeFK8g8q9mnkgIIPEATYF3iw9m+UIUg hFRcU5gOKzpud7n0oqFoo041dcExqoH1W8u/4Xl37tdmSw7tQQ== X-Google-Smtp-Source: ABdhPJxin9kQ08PTzNJ5Bzfu+863aFKzIMt4cOVkv1E544bUlR0RnL7W9Ko8j8y3dYesT8VZcDehlcTMftRUb4N+sJk= X-Received: by 2002:a17:903:2082:b029:e9:f75:d0ce with SMTP id d2-20020a1709032082b02900e90f75d0cemr9502201plc.24.1617913717550; Thu, 08 Apr 2021 13:28:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Orgad Shaneh Date: Thu, 8 Apr 2021 23:28:26 +0300 Message-ID: Subject: Re: A problem with noacl+umask+chmod result To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2021 20:28:41 -0000 On Wed, Apr 7, 2021 at 11:47 PM Orgad Shaneh wrote: > > Hi, > > If a filesystem is mounted with noacl, calling chmod to add write > permissions after umasking this permission doesn't work. Demonstrated > with command-line and C++. > > Did I miss something or is this a real bug? According to umask man, it > should only affect newly created files and directories, but I didn't > find anything that relates to chmod. > > Command-line: > touch foo > ls -l foo > # -rw-r--r-- ... foo > umask 200 > chmod 0 foo > ls -l foo > # -r--r--r-- ... foo > chmod 200 foo > ls -l foo > # -r--r--r-- ... foo > # Expected to have rw Marco Atzeri replied to the mailing list but did not CC me, so I didn't receive it: > without ACL you can not expect the POSIX scheme to properly work. > see > https://cygwin.com/cygwin-ug-net/ntsec.html > to understand how Cygwin uses ACL to mimic POSIX permissions Thanks Marco! I'm well aware of that. I don't expect it to work properly. From what I know, it can only set/unset user write bit. Read bits are always enabled, even on chmod 0. What I do expect is that the write bit will not be affected by umask. umask should only affect newly created files, not direct chmod commands. - Orgad