public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: chmod issue on 3.1.7.
Date: Thu, 24 Dec 2020 17:56:10 -0500	[thread overview]
Message-ID: <4fe8b717-ada1-16b5-f739-7d43b2a4d56c@cornell.edu> (raw)
In-Reply-To: <dbf863dfebf0ed48ed5514d9b3b2ca64@mail.kylheku.com>

On 12/24/2020 4:13 PM, Kaz Kylheku (Cygwin) via Cygwin wrote:
> On 2020-10-10 09:32, Kaz Kylheku (Cygwin) via Cygwin wrote:
>> Hi all,
>>
>> Running this Cygwin on a Windows 10 system:
>>
>>   0:DESKTOP-K8055OB:~$ uname -a
>>   CYGWIN_NT-10.0-WOW DESKTOP-K8055OB 3.1.7(0.340/5/3) 2020-08-22 19:03
>> i686 Cygwi
>>
>> When a file is created, and permissions set as follows:
>>
>>   0:DESKTOP-K8055OB:~$ touch tempfile
>>   0:DESKTOP-K8055OB:~$ chmod 03777 tempfile
>>   0:DESKTOP-K8055OB:~$ ls -l tempfile
>>   -rwsrwsrwt 1 kaz kaz 0 Oct 10 08:59 tempfile
>>
>> Then "chmod u=" is not able to clear the owner's permissions to nothing:
>>
>>   0:DESKTOP-K8055OB:~$ chmod u= tempfile
>>   0:DESKTOP-K8055OB:~$ ls -l tempfile
>>   -rwxrwsrwt 1 kaz kaz 0 Oct 10 08:59 tempfile
>>
>> As you can see, it has no effect. The expected value is ----rwsrwt.
>>
>> I tried both with 64 and 32 bit Cygwin: same deal.
>>
>> This is not a problem with the chmod utility.  I ran into this as a failing
>> test case against a chmod library function in a programming language.
>>
>> http://www.kylheku.com/cgit/txr/tree/tests/018/chmod.tl
>>
>> The test cases pass until the "u=", which fails in the same way.
>> This does not use the chmod utility.
>>
>> It's an issue with the chmod system call.
>>
>> This used to work on my older Cygwin installation, which was around 2.5.
> 
> Anyone have a clue about this issue?
> 
> $ icacls tempfile
> tempfile NULL SID:(DENY)(Rc,S,RD,WD)
>           BLACKBOX\kaz:(F)
>           BLACKBOX\kaz:(RX,W)
>           Everyone:(RX,W)
> 
> $ getfacl tempfile
> # file: tempfile
> # owner: kaz
> # group: kaz
> # flags: -st
> user::rwx
> group::rwx
> other::rwx
> 
> $ ls -l tempfile
> -rwxrwsrwt 1 kaz kaz 0 Dec 24 13:09 tempfile
> 
> $ chmod u= tempfile
> $ ls -l tempfile
> -rwxrwsrwt 1 kaz kaz 0 Dec 24 13:09 tempfile

Could the problem be that the owner and group are the same?  You can do that on 
unix, but I'm not sure the Windows security model allows it.  For example, what 
happens when you remove permissions of the owner kaz while retaining the 
permissions of the group kaz?  As far as Windows is concerned, you're talking 
about BLACKBOX\kaz in both cases, I think.

Ken

  reply	other threads:[~2020-12-24 22:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 16:32 Kaz Kylheku (Cygwin)
2020-10-10 19:41 ` Ken Brown
2020-10-10 21:51   ` Brian Inglis
2020-10-11 16:13     ` Kaz Kylheku (Cygwin)
2020-12-24 21:13 ` Kaz Kylheku (Cygwin)
2020-12-24 22:56   ` Ken Brown [this message]
2020-12-25  9:15 Kaz Kylheku (Cygwin)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4fe8b717-ada1-16b5-f739-7d43b2a4d56c@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).