Skip to main content

extract_paths_from_command

Function extract_paths_from_command 

Source
pub fn extract_paths_from_command(command: &str) -> Vec<PathBuf>
Expand description

Extract explicit paths from a shell command string.

This performs simple pattern matching to find:

  • Absolute paths starting with /
  • Home paths starting with ~/

Limitations: Cannot detect dynamic paths like $(echo /path) or command substitution. Those require kernel-level enforcement (Landlock/Bubblewrap).