lookpath

package
v1.14.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MPL-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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