Documentation
¶
Overview ¶
Package securejoin joins an unsafe path to a root directory while keeping the result confined inside the root.
This is a yoke clean-room implementation written for S488.3d (remove the MPL-2.0 cyphar/filepath-securejoin dependency from the engine build). It was written from POSIX path semantics, the call sites and expectations of its permissive callers (podman pkg/util, pkg/lookup, containers/common etchosts, storage, buildah parse, cgroups — Apache-2.0, all using only SecureJoin and checking only err != nil), the one-line public signature from `go doc`, and black-box behavior observed by executing the replaced module (lexical escapes clamp inside, outside symlinks re-scope under the root, loops are an error). The replaced module's source — including vendor copies — was never opened. Only the caller-used API is provided: SecureJoin.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SecureJoin ¶
SecureJoin joins unsafePath to root, keeping the result inside root:
- Absolute unsafe paths are treated as relative to root, and ".." components that would ascend above root are clamped: they stay at root instead of escaping.
- Symlinks met while walking are expanded (absolute targets restart the walk at root, relative targets splice in place, and nested links are expanded in turn by the same walk); targets that resolve outside root are re-scoped under root, so they never yield a usable outside path.
- A symlink loop is an error.
The root itself is used as given (never symlink-resolved). A missing path component ends expansion for that branch and the remainder stays lexical, still confined under root.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pathrs is a clean-room replacement for github.com/cyphar/filepath-securejoin/pathrs-lite, implementing only the API the shipped Podman engine graph calls: podman libpod and play, containers/storage, opencontainers/selinux and runc internal/pathrs.
|
Package pathrs is a clean-room replacement for github.com/cyphar/filepath-securejoin/pathrs-lite, implementing only the API the shipped Podman engine graph calls: podman libpod and play, containers/storage, opencontainers/selinux and runc internal/pathrs. |
|
procfs
Package procfs is a clean-room replacement for the procfs API of github.com/cyphar/filepath-securejoin/pathrs-lite, implementing only what the shipped Podman engine graph calls (opencontainers/selinux, runc internal/pathrs).
|
Package procfs is a clean-room replacement for the procfs API of github.com/cyphar/filepath-securejoin/pathrs-lite, implementing only what the shipped Podman engine graph calls (opencontainers/selinux, runc internal/pathrs). |