{
  "slug": "path-resolution",
  "term": "Path resolution",
  "aliases": [
    "pathname resolution",
    "pathname lookup"
  ],
  "definition": "Path resolution interprets a pathname's components to select the filesystem object or creation location addressed by an operation.",
  "note": "On Linux, absolute paths normally start at the process root; relative paths start at the working directory or an *at() directory descriptor. Intermediate components require search permission; final-component handling depends on the operation. [linux-path-resolution-7]\n\nO_NOFOLLOW affects only the final component. O_PATH | O_NOFOLLOW can obtain a descriptor for that link itself. [linux-open-2]\n\nopenat2() RESOLVE_NO_SYMLINKS prevents symlink traversal throughout the path and implies RESOLVE_NO_MAGICLINKS, but does not confine lookup. RESOLVE_NO_XDEV separately blocks mount crossings, including bind mounts. [linux-openat2-2]\n\nRESOLVE_BENEATH rejects escapes from dirfd, including absolute paths and absolute symlink targets; it does not ban every relative symlink or '..'. RESOLVE_IN_ROOT instead roots absolute paths and absolute symlink targets at dirfd and keeps '..' there at that root. Linux v6.12 rejects combining these policies with EINVAL. [linux-openat2-2] [linux-openat2-source]\n\nWith either rooted policy, EAGAIN can mean a race prevented proving confinement. RESOLVE_CACHED can also return EAGAIN when lookup needs revalidation or I/O. A cache fallback may drop only RESOLVE_CACHED, retaining containment and link restrictions. Retry within a bounded budget or report failure, not through an unconstrained open. These rules govern that open, not a later rename. [linux-openat2-2] [linux-path-lookup]\n\nRESOLVE_CACHED also rejects otherwise valid O_CREAT, O_TRUNC and O_TMPFILE requests before lookup in Linux v6.12. EAGAIN therefore does not uniquely identify an uncached name. [linux-openat2-source]",
  "advantages": [],
  "limitations": [
    "Resolving a name does not freeze its contents or provide a snapshot of later namespace changes."
  ],
  "related": [
    "symbolic-link",
    "inode",
    "hard-link",
    "open-file-description",
    "atomic-rename",
    "o-path",
    "dentry",
    "resolve-cached",
    "directory",
    "directory-search-permission"
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-16",
  "citations": [
    {
      "id": "linux-path-resolution-7",
      "title": "Linux man-pages: path_resolution(7), lookup start and component handling",
      "url": "https://man7.org/linux/man-pages/man7/path_resolution.7.html",
      "accessed": "2026-11-03"
    },
    {
      "id": "linux-open-2",
      "title": "Linux man-pages: open(2), O_NOFOLLOW and O_PATH",
      "url": "https://man7.org/linux/man-pages/man2/open.2.html",
      "accessed": "2026-11-03"
    },
    {
      "id": "linux-openat2-2",
      "title": "Linux man-pages: openat2(2), resolve flags and their scope",
      "url": "https://man7.org/linux/man-pages/man2/openat2.2.html",
      "accessed": "2026-11-07"
    },
    {
      "id": "linux-openat2-source",
      "title": "Linux v6.12: build_open_flags and mutually exclusive rooted lookup policies",
      "url": "https://github.com/torvalds/linux/blob/v6.12/fs/open.c",
      "accessed": "2026-11-07"
    },
    {
      "id": "linux-path-lookup",
      "title": "Linux v6.12 pathname lookup: rename_lock and scoped lookup races",
      "url": "https://www.kernel.org/doc/html/v6.12/filesystems/path-lookup.html#rename-lock",
      "accessed": "2026-11-07"
    }
  ],
  "provenance": [
    "API review scoped to Linux; path-resolution flags are separate from persistence, application authorization and multi-operation concurrency protocols.",
    "Rooted lookup and retry guidance combines the Linux API contract with v6.12 implementation review; bounded retries are an application policy, not a kernel retry limit."
  ]
}
