delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/04/08/16:28:47

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD6863954C5A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1617913724;
bh=aLaXEYTye8PP6KCzSmQg4Hun26Yul2dXpRub6nS+Vg0=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=bkRkp4VGlB6NLWbWYGB9YBRkAPqSXEG+wDh97fp/i3Fr9ktxzZE8G//hNUYqoBuLf
Sz3ZcFSTylMsykmgUCaYjqxk1rLapKbnSAfcsrE0qbdD38ic+znZqQRcvxSMFT/85C
MISfJF+TDlWU1N6JsOWjPJNMm5FaTxL8ksVvQ/LU=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04DA13857033
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: <CAGHpTBLp33PD_Pa5nGaH-cyfr+0d+Tk=ffqFtBCWP+Jq9VbuPg AT mail DOT gmail DOT com>
In-Reply-To: <CAGHpTBLp33PD_Pa5nGaH-cyfr+0d+Tk=ffqFtBCWP+Jq9VbuPg@mail.gmail.com>
Date: Thu, 8 Apr 2021 23:28:26 +0300
Message-ID: <CAGHpTB+wcf_tcXo_W20CAq-3n=xBq5Ry6Tpt7WmZREvAbOkPSg@mail.gmail.com>
Subject: Re: A problem with noacl+umask+chmod result
To: cygwin AT cygwin DOT com
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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Orgad Shaneh via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Orgad Shaneh <orgads AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On Wed, Apr 7, 2021 at 11:47 PM Orgad Shaneh <orgads AT gmail DOT com> 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
--
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

- Raw text -


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