Page MenuHomeFreeBSD

realpath: Report correct path on failure
ClosedPublic

Authored by des on Oct 10 2025, 2:05 PM.
Tags
None
Referenced Files
F162893830: D53025.id163941.diff
Sat, Jul 18, 2:16 AM
Unknown Object (File)
Thu, Jul 16, 12:00 PM
Unknown Object (File)
Thu, Jul 16, 1:40 AM
Unknown Object (File)
Wed, Jul 15, 5:42 AM
Unknown Object (File)
Wed, Jul 15, 5:42 AM
Unknown Object (File)
Mon, Jul 13, 7:49 AM
Unknown Object (File)
Mon, Jul 13, 12:11 AM
Unknown Object (File)
Mon, Jul 6, 9:52 PM
Subscribers

Details

Summary

If lstat() fails with EACCES or ENOTDIR, the path we need to return in
the caller-provided buffer is that of the parent directory (which is
either unreadable or not a directory; the latter can only happen in the
case of a race) rather than that of the child we attempted to stat.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Oct 10 2025, 2:05 PM
This revision is now accepted and ready to land.Oct 10 2025, 7:13 PM
This revision was automatically updated to reflect the committed changes.