intellibrix v1.0.0
    Preparing search index...

    Function resolveJailed

    • Resolves requested (relative to root, or absolute) to an absolute path guaranteed to lie inside root.

      The lexical check alone is not enough: a symlink inside the root can point outside it. So after resolving, the deepest existing ancestor is realpath-ed and containment is checked again. Do not remove that step.

      Parameters

      • root: string
      • requested: string

      Returns Promise<string>

      if the path escapes the root, lexically or via a symlink.