Page MenuHomeFreeBSD

access.2: Mention that lstat(2) should be used for symbolic links
ClosedPublic

Authored by gbe on Apr 21 2024, 9:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 12:39 AM
Unknown Object (File)
Oct 11 2024, 1:12 AM
Unknown Object (File)
Oct 10 2024, 10:12 PM
Unknown Object (File)
Oct 3 2024, 5:25 PM
Unknown Object (File)
Oct 3 2024, 5:20 PM
Unknown Object (File)
Oct 3 2024, 3:30 PM
Unknown Object (File)
Sep 19 2024, 6:56 PM
Unknown Object (File)
Sep 1 2024, 9:37 PM

Details

Summary

access(), eaccess() and faccessat() will always dereference
symbolic links.

So add a note the manual page, that stat(2) should be used in
the case of symbolic links.

PR: 262895
MFC after: 1 week

Test Plan

mandoc output review and 'mandoc -Tlint' checks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57255
Build 54143: arc lint + arc unit

Event Timeline

gbe requested review of this revision.Apr 21 2024, 9:56 AM
gbe created this revision.

There are 2 spurious ) after eaccess and faccessat in the change summary.

This revision is now accepted and ready to land.Apr 21 2024, 12:23 PM

There are 2 spurious ) after eaccess and faccessat in the change summary.

Thanks, when typing fast, auto completion can be evil. ;)

I realise that it's my fault for using the weak word "refer" in my original suggestion (I originally wrote "access, eaccess, faccessat will ALWAYS dereference symbolic links. If you need to refer to the symbolic link itself, you'll have to instead use stat(2)") but I think it looks even less suitable in your submission. Would "If the symbolic link itself needs to be referenced..." be better?

Cheers, Jamie

Oops. Suggested alternative should be "lstat(2)" not "stat(2)" !

  • Reword a sentence and recommand lstat(2) instead of stat(2)
This revision now requires review to proceed.Apr 23 2024, 2:42 PM
gbe retitled this revision from access.2: Mention that stat(2) should be used for symbolic links to access.2: Mention that lstat(2) should be used for symbolic links.Apr 23 2024, 2:43 PM

English and markup still LGTM.

This revision is now accepted and ready to land.Apr 24 2024, 1:16 AM