DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 519IRgnV3856800
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 519IRgnV3856800
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=m/f0QAhB
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7060D3858420
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1739125660;
	bh=C6guTUapaownhJOEMVKYg/UcmM8QEG6fHvIFewLANbo=;
	h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=m/f0QAhBaMxXM3Eky/OZsIvMrlzF/Hi/JQj5C3ASZVKwoI0QtC1vVXxo1JcBegOnP
	 SLSaTNk+bowQqkbA4AGEQse/NDLgRMjgDigolaapoNejtZdJZNICrzNiFXJPzu1HFv
	 ip9L3PEUgv9VqLpkmpipWVR0j+VZ8id330/uxdiY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A92FC3858CDA
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A92FC3858CDA
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739125598; cv=none;
 b=m8IHjM6l0ryPHHJdspsyRejiFvtMMe4MTHzukrjwHd5VaDETCU1L213GKj/7Mgvi2MfnDDUFDF3Wcbrai8m2ArRViP5qDHkH6OeKbRAooukTy4ofzxl/JYc8j3YYlWpEplhjU44FGu3O+hTljedMY+AE89TNsUC6HhB6q9YnOVE=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1739125598; c=relaxed/simple;
 bh=7wvPUOPfy/l8vpj8liwrnDrr+WTtvzO3UJN1waxE2+c=;
 h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature;
 b=eP+kHJDfvTniWVTzDURBxPXGjd2sxKU1/64nkoG6u/LcehHEjSjEejP9IMzWAFNcd+Tw+uftddRSnRrKcgmIxYUOhJUGE6xZAHxmnXQp/uxftihRElqJ5OZIy/wN8+F9V669XUXqWmK65A1cL6VJM61JIBYOniszCVulEThL3ns=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A92FC3858CDA
Message-ID: <89080ee5-6485-406b-b7da-d6033ce3c3e0@SystematicSW.ab.ca>
Date: Sun, 9 Feb 2025 11:26:36 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: coreutils-9.0-1: chmod -R silently returns failure if dir
 contains a symlink (regression)
Content-Language: en-CA
To: cygwin AT cygwin DOT com
References: <c671ee35-f342-c63f-b7ad-56b7508151d6 AT t-online DOT de>
Autocrypt: addr=Brian DOT Inglis AT SystematicSW DOT ab DOT ca; keydata=
 xjMEXopx8xYJKwYBBAHaRw8BAQdAnCK0qv/xwUCCZQoA9BHRYpstERrspfT0NkUWQVuoePbN
 LkJyaWFuIEluZ2xpcyA8QnJpYW4uSW5nbGlzQFN5c3RlbWF0aWNTdy5hYi5jYT7ClgQTFggA
 PhYhBMM5/lbU970GBS2bZB62lxu92I8YBQJeinHzAhsDBQkJZgGABQsJCAcCBhUKCQgLAgQW
 AgMBAh4BAheAAAoJEB62lxu92I8Y0ioBAI8xrggNxziAVmr+Xm6nnyjoujMqWcq3oEhlYGAO
 WacZAQDFtdDx2koSVSoOmfaOyRTbIWSf9/Cjai29060fsmdsDM44BF6KcfMSCisGAQQBl1UB
 BQEBB0Awv8kHI2PaEgViDqzbnoe8B9KMHoBZLS92HdC7ZPh8HQMBCAfCfgQYFggAJhYhBMM5
 /lbU970GBS2bZB62lxu92I8YBQJeinHzAhsMBQkJZgGAAAoJEB62lxu92I8YZwUBAJw/74rF
 IyaSsGI7ewCdCy88Lce/kdwX7zGwid+f8NZ3AQC/ezTFFi5obXnyMxZJN464nPXiggtT9gN5
 RSyTY8X+AQ==
Organization: Systematic Software
In-Reply-To: <c671ee35-f342-c63f-b7ad-56b7508151d6@t-online.de>
X-Stat-Signature: xmzyyxdrom6i4bad61ie6j6m7kwzzsyk
X-Rspamd-Server: rspamout08
X-Rspamd-Queue-Id: D0F2C20015
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX195nDxpCwuiLTTIpgEjC+s6doY07VJAD9M=
X-HE-Tag: 1739125596-280109
X-HE-Meta: U2FsdGVkX18z1wzd0gRecFo5ZmUrQRMl5S08g2tTsEjEmOePJldK2otyi0ki9h2809gYbE2FckT0WFOghKRvF87pmTviDRiyIHugKkeRpWudwul4fhCucdurKs7Sp9IvxbpQabkkWOWvT7Ge53w34ha4JBTF1TcyEDXpXsLVA5cDbLAO6NTSEV7sCd3SlFPwwMkGId+M4gHvf9ImaOpPoyTjxNob/Mz/kYKxkMgtBj7lbmRH12vFXr7S1ncyzpztufHGXca91ODtjZvGAA1+Nt+lMoAez11T78zISM2H/uGOXW3uktBztUzp6jg51dG8SJns3DrDrjpcD3WTUWJ1GZiWmOMglA0ioUKHd3r3bBmxrjanX7Jn+PtpLZjM9IWbUfE23Kpa99L7R4ubUttgIS0eD9itneAVzGyLPShqr/w11kd1c54XEg==
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
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: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT ab DOT ca>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 519IRgnV3856800

On 2025-02-09 08:01, Christian Franke via Cygwin wrote:
> Testcase:
> 
> $ uname -r
> 3.5.7-1.x86_64
> 
> $ cygcheck -f /bin/chmod
> coreutils-9.0-1
> 
> $ mkdir dir
> 
> $ touch dir/file
> 
> $ chmod -R -v g-w dir; echo $?
> mode of 'dir' retained as 0755 (rwxr-xr-x)
> mode of 'dir/file' retained as 0644 (rw-r--r--)
> 0
> 
> $ ln -s file dir/link
> 
> $ chmod -R -v g-w dir; echo $?
> mode of 'dir' retained as 0755 (rwxr-xr-x)
> mode of 'dir/file' retained as 0644 (rw-r--r--)
> neither symbolic link 'dir/link' nor referent has been changed
> 1
> 
> $ chmod -R g-w dir; echo $?
> 1
> 
> $ chmod -v g-w dir dir/file dir/link; echo $?
> mode of 'dir' retained as 0755 (rwxr-xr-x)
> mode of 'dir/file' retained as 0644 (rw-r--r--)
> mode of 'dir/link' retained as 0644 (rw-r--r--)
> 0
> 
> $ chmod -R -v g+w dir; echo $?
> mode of 'dir' changed from 0755 (rwxr-xr-x) to 0775 (rwxrwxr-x)
> mode of 'dir/file' changed from 0644 (rw-r--r--) to 0664 (rw-rw-r--)
> neither symbolic link 'dir/link' nor referent has been changed
> 1
> 
> $ chmod -R g-w dir; echo $?
> 1
> 
> Exit status 1 does not occur with chmod from coreutils 8.32-1.

A major change in coreutils 9 was to use the f...at() directory relative 
functions, so the error may be related to that symlink, unreported due to a bug 
(in our/my patches, underlying, or upstream):

EOPNOTSUPP	The  AT_SYMLINK_NOFOLLOW bit is set in the flag argument, path names 
a symbolic link, and the system does not support changing the mode of a symbolic 
link.

Appears that it is a known bug and should have been fixed upstream; see the test 
release announcement for many chmod fixes and changes including more options:

	https://cygwin.com/pipermail/cygwin-announce/2025-January/012042.html

"...
2022-04-15	9.1

Bug fixes

- chmod -R no longer exits with error status when encountering symlinks.
   All files would be processed correctly, but the exit status was incorrect.
   [bug introduced in coreutils-9.0]
..."

If you can, please check again with coreutils test 9.5.
I am working on updating to 9.6, will recheck as part of that, and fix or report 
a regression, if an issue.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

-- 
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