Expand description
POSIX shell tokenization for crate::constraints::Shlex.
Words end at unquoted spaces, tabs, or operators. # is an ordinary word
character, never a comment, so an operator after # is still rejected even
when a shell would not treat # as a comment. A comma, bracket, or other
non-operator character stays inside the word, so ./ls,evil is one
command name. Quoted and backslash-escaped operator characters are
literal arguments.
check is the only decision. Callers that explain a denial use its
reason instead of a second parser.
Structs§
- Shlex
Check - The core’s decision for one command.
reasonis the explanation. - Token
- A token from
tokenize.operatoris set only for an unquoted operator.
Enums§
- Shell
Error - Why
tokenizerefused the command.
Functions§
- check
- Decide whether
commandis one allowlisted binary and literal arguments. - command_
allowed - Whether
checkallows the command. - tokenize
- Split
inputthe way a POSIX shell splits words, without expansion.