Path resolution
Path resolution interprets a pathname's components to select the filesystem object or creation location addressed by an operation.
On Linux, an absolute path normally starts at the process root; a relative path starts at the working directory or the directory descriptor supplied to an *at() API. Intermediate components require directory lookup and search permission. Final-component treatment depends on the operation. [1]
For open(), O_NOFOLLOW controls only the final component. Earlier directory symlinks may still be followed. O_PATH with O_NOFOLLOW can instead obtain a descriptor for the final link itself. [2]
For openat2(), RESOLVE_NO_SYMLINKS blocks symlink traversal throughout the path and implies RESOLVE_NO_MAGICLINKS. It does not alone confine lookup beneath a directory. RESOLVE_BENEATH or RESOLVE_IN_ROOT supply different containment policies; RESOLVE_NO_XDEV separately blocks mount traversal, including bind mounts. These controls apply to that open, not a later pathname operation. [3]
Relations
Limitations
- Resolving a name does not freeze its contents or provide a snapshot of later namespace changes.
Citations
- Linux man-pages: path_resolution(7), lookup start and component handling
- Linux man-pages: open(2), O_NOFOLLOW and O_PATH
- Linux man-pages: openat2(2), resolve flags and their scope
Sources & caveats
- API review scoped to Linux; path-resolution flags are separate from persistence, application authorization and multi-operation concurrency protocols.