X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 10268385783E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anrdaemon AT yandex DOT ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1617933002; bh=lnzv8FBSAzjwIpatiNLe+3YSFZfpYWMjG7y+2M/Mp7M=; h=In-Reply-To:Subject:To:From:Message-ID:References:Date:Reply-To; b=i2k0wgwmj4gZLpYaenyM0dGU4au0/2NmClDObOhoJtI1+Et7OBR+4hdWihOEVSxvt 6kC/7XAa+ldyV9yYVzflgsexmx7LDA+yaT0BJqAGOexWCmWw/IqzLzA3hBV3kvWywe VGJJeKwFqpOOULnP2lny/OBR9IoUsJbpxl2jFefQ= Authentication-Results: iva8-def7434e1e2c.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Date: Fri, 9 Apr 2021 04:45:12 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home X-Priority: 3 (Normal) Message-ID: <1462778363.20210409044512@yandex.ru> To: Orgad Shaneh , cygwin AT cygwin DOT com Subject: Re: A problem with noacl+umask+chmod result In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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 AT cygwin DOT 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: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" Greetings, Orgad Shaneh! > 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: The expectation is that you subscribe to the list of interest. >> 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. Yet again: using chmod on noacl filesystem is likely to cause more harm than good. You may very well end up with an unusable filesystem until you fix permissions by hands. -- With best regards, Andrey Repin Friday, April 9, 2021 4:43:01 Sorry for my terrible english... -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple