Page MenuHomeFreeBSD

realpath: Report correct path on failure
ClosedPublic

Authored by des on Oct 10 2025, 2:05 PM.
Tags
None
Referenced Files
F152669321: D53025.id164082.diff
Thu, Apr 16, 10:14 AM
Unknown Object (File)
Tue, Apr 14, 10:00 PM
Unknown Object (File)
Sun, Apr 12, 11:15 AM
Unknown Object (File)
Sun, Apr 12, 4:21 AM
Unknown Object (File)
Sun, Apr 12, 2:31 AM
Unknown Object (File)
Sat, Apr 11, 11:19 PM
Unknown Object (File)
Fri, Apr 10, 9:19 AM
Unknown Object (File)
Tue, Apr 7, 9:50 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.