lookpath

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lookpath resolves executables by PATH within a root directory, following symlinks confined to that root via openat2(RESOLVE_IN_ROOT).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InRoot

func InRoot(root, name string, env []string) (string, error)

InRoot resolves name to a path that can be exec'd after chrooting into root.

A name containing a slash is returned unchanged (treated as an explicit path). Otherwise the PATH entry from env is searched, and each candidate is resolved under root with RESOLVE_IN_ROOT: absolute symlink targets (e.g. Nix profile links pointing into /nix/store, which may live on a sub-mount of root) are interpreted relative to root, and resolution can never escape it. The returned path is the PATH-relative candidate, valid once the caller chroots into root. Returns an error if name is not found as an executable file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL