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)
Sat, Jan 10, 2:05 PM
Unknown Object (File)
Wed, Jan 7, 5:16 PM
Unknown Object (File)
Tue, Jan 6, 11:12 AM
Unknown Object (File)
Sun, Jan 4, 12:09 PM
Unknown Object (File)
Fri, Jan 2, 3:48 PM
Unknown Object (File)
Tue, Dec 30, 11:14 PM
Unknown Object (File)
Dec 28 2025, 3:47 PM
Unknown Object (File)
Dec 15 2025, 9:46 AM
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.