You can get ENOTSUP due to the system not supporting chmod(symlink),
but you can also get ENOTSUP on any file type if the system needs
/proc to emulate AT_SYMLINK_NOFOLLOW and /proc is not available.
Before this fix we had the problematic "Silent skip" in these cases:
Build glibc Runtime Linux With /proc Without /proc
============= ============ =================== ====================
≤ 2.31 Any gnulib emulation Racy fallback
2.32–2.38 Any glibc emulation Silent skip
≥ 2.39 < 6.6 glibc emulation Silent skip
≥ 2.39 ≥ 6.6 Native fchmodat2 Native fchmodat2
After this change (and the preceding gnulib change), we have:
Build glibc Runtime Linux With /proc Without /proc
============= ============ =================== ====================
≤ 2.38 Any gnulib emulation Racy fallback
≥ 2.39 < 6.6 glibc emulation Diagnose ENOTSUP
≥ 2.39 ≥ 6.6 Native fchmodat2 Native fchmodat2
The above tables assume /proc is available at ./configure time.
Other cases like musl < 1.2.4 are not considered,
but there should at least be no silent ignoring of issues
once reported by the underlying libc.
* src/chmod.c (process_file): Check we're operating on a symlink
if we get ENOTSUP, and only ignore the error in that case.
* tests/chmod/symlink-enotsup.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-PSCKLNL1.