Page MenuHomeFreeBSD

realpath: Report correct path on failure
ClosedPublic

Authored by des on Oct 10 2025, 2:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 30, 6:12 AM
Unknown Object (File)
Tue, Nov 25, 12:08 AM
Unknown Object (File)
Sun, Nov 23, 11:25 PM
Unknown Object (File)
Sun, Nov 23, 2:31 PM
Unknown Object (File)
Sun, Nov 23, 4:04 AM
Unknown Object (File)
Fri, Nov 21, 12:29 PM
Unknown Object (File)
Wed, Nov 19, 4:05 AM
Unknown Object (File)
Tue, Nov 18, 7:11 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.