Skip to main content

Module path_jail

Module path_jail 

Source
Expand description

Path jail: keep agent-facing paths inside a source root.

Absolute paths, .. traversal, and symlink hops that leave the root are rejected.

Re-exportsยง

use std::path::Component; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’

Functionsยง

absolute_root ๐Ÿ”’
normalize_lexically ๐Ÿ”’
resolve_existing_prefix ๐Ÿ”’
Canonicalize the longest existing prefix so symlink hops are visible.
resolve_under_root
Resolve path so the result is inside root.