chmod issue on 3.1.7.

Ken Brown kbrown@cornell.edu
Sat Oct 10 19:41:28 GMT 2020


On 10/10/2020 12:32 PM, 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.

FWIW, I can't reproduce this on my system:

$ uname -a
CYGWIN_NT-10.0-WOW XXX 3.1.7(0.340/5/3) 2020-08-22 19:03 i686 Cygwin

$ touch tempfile

$ ls -l tempfile
-rw-r--r-- 1 kbrown None 0 2020-10-10 15:16 tempfile

$ chmod 03777 tempfile

$ ls -l tempfile
-rwxrwsrwt 1 kbrown None 0 2020-10-10 15:16 tempfile

$ chmod u= tempfile

$ ls -l tempfile
----rwsrwt 1 kbrown None 0 2020-10-10 15:16 tempfile

Ken


More information about the Cygwin mailing list