From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) by sourceware.org (Postfix) with ESMTPS id E4A873858D37 for ; Sat, 10 Oct 2020 21:51:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E4A873858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca Received: from [192.168.1.104] ([24.64.172.44]) by shaw.ca with ESMTP id RMm9kGzGWs3D6RMmAkkUIK; Sat, 10 Oct 2020 15:51:38 -0600 X-Authority-Analysis: v=2.4 cv=bZHV7MDB c=1 sm=1 tr=0 ts=5f822cea a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17 a=IkcTkHD0fZMA:10 a=2KUf1mbJAAAA:8 a=uYT-Tk0qkVT609LjNaIA:9 a=QEXdDO2ut3YA:10 a=LME9DoRMzU6P72L8X6EC:22 Reply-To: cygwin@cygwin.com Subject: Re: chmod issue on 3.1.7. To: cygwin@cygwin.com References: <7cb8ee6c7e9a36a3c1ee73def342bcb6@mail.kylheku.com> From: Brian Inglis Autocrypt: addr=Brian.Inglis@SystematicSw.ab.ca; prefer-encrypt=mutual; keydata= mDMEXopx8xYJKwYBBAHaRw8BAQdAnCK0qv/xwUCCZQoA9BHRYpstERrspfT0NkUWQVuoePa0 LkJyaWFuIEluZ2xpcyA8QnJpYW4uSW5nbGlzQFN5c3RlbWF0aWNTdy5hYi5jYT6IlgQTFggA PhYhBMM5/lbU970GBS2bZB62lxu92I8YBQJeinHzAhsDBQkJZgGABQsJCAcCBhUKCQgLAgQW AgMBAh4BAheAAAoJEB62lxu92I8Y0ioBAI8xrggNxziAVmr+Xm6nnyjoujMqWcq3oEhlYGAO WacZAQDFtdDx2koSVSoOmfaOyRTbIWSf9/Cjai29060fsmdsDLg4BF6KcfMSCisGAQQBl1UB BQEBB0Awv8kHI2PaEgViDqzbnoe8B9KMHoBZLS92HdC7ZPh8HQMBCAeIfgQYFggAJhYhBMM5 /lbU970GBS2bZB62lxu92I8YBQJeinHzAhsMBQkJZgGAAAoJEB62lxu92I8YZwUBAJw/74rF IyaSsGI7ewCdCy88Lce/kdwX7zGwid+f8NZ3AQC/ezTFFi5obXnyMxZJN464nPXiggtT9gN5 RSyTY8X+AQ== Organization: Systematic Software Message-ID: Date: Sat, 10 Oct 2020 15:51:37 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfJ9upviwhC0DSH2la0KHG93n0SrwpP3JdcZXZPi5eT1Bcfk1/4Vl0nvVpHen0uI929XvvWo1KOo1zqGi2VjylUs4kvimRivdPgOnIWqWS7SM5+92VIBP UyZxGd2Jbulo2iRm95SV0gshAarGAoG45v1bex/hBzl+O0ZbJn9y2S6URCTuHSgZwvsnMmUKOgfiw914ucazXBtNJe56hVNE9ho= X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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@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: Sat, 10 Oct 2020 21:51:41 -0000 On 2020-10-10 13:41, Ken Brown via Cygwin wrote: > 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 D/ACLs on the directory could restore/maintain the permissions: could we please see the output from ls -l, getfacl, and icacls on the directory and file? -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]