Bug 1820722

Summary: Missing lchmod support for symlinks
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aoliva, arjun.is, codonell, dj, fweimer, law, mfabian, pfrankli, rth, siddhesh, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-03 17:01:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vít Ondruch 2020-04-03 16:52:19 UTC
Description of problem:
It seems that the newly implemented lchmod in glibc 2.31.9000 is missing symlinks support. Is that deliberate or unintentional?

https://bugs.ruby-lang.org/issues/16756


Version-Release number of selected component (if applicable):
$ rpm -q glibc
glibc-2.31.9000-6.fc33.x86_64


How reproducible:
Always


Steps to Reproduce:
1.
2.
3.

Actual results:
Missing lchmod support for symlinks.


Expected results:
Working support for symlinks.


Additional info:

Comment 1 Florian Weimer 2020-04-03 17:01:21 UTC
This is deliberate because Linux does not support changing the mode of a symbolic link (except for file systems with bugs). The error code ENOTSUP is mandated by POSIX for this case. You can still use lchmod to avoid following symbolic links even in the presence of races, so it's still useful.

I will also update the upstream bug.

Comment 2 Vít Ondruch 2020-04-03 17:04:33 UTC
(In reply to Florian Weimer from comment #1)
> This is deliberate because Linux does not support changing the mode of a
> symbolic link (except for file systems with bugs). The error code ENOTSUP is
> mandated by POSIX for this case. You can still use lchmod to avoid following
> symbolic links even in the presence of races, so it's still useful.

Thank you for the explanation.

> I will also update the upstream bug.

And thank you million times for the upstream response. That is outstanding!