pub struct ShellMetaRule { /* private fields */ }Expand description
Rejects input containing shell metacharacters.
Default denied characters: ;, |, &, $, `, (, ), {, },
<, >, !, #, \, ', ", ~, \n, \r.
§Rationale
These characters enable:
- Command chaining (
;,&&,||) - Piping (
|) - Subshell / command substitution (
$(),`) - Redirection (
<,>) - Backgrounding (
&) - Comment injection (
#) - Home directory expansion (
~)
Implementations§
Source§impl ShellMetaRule
impl ShellMetaRule
Sourcepub fn with_denied(denied: Vec<char>) -> Self
pub fn with_denied(denied: Vec<char>) -> Self
Create a rule with a custom set of denied characters.
Sourcepub fn with_extra_denied(extra: &[char]) -> Self
pub fn with_extra_denied(extra: &[char]) -> Self
Create a rule with additional denied characters on top of defaults.
Trait Implementations§
Source§impl Default for ShellMetaRule
impl Default for ShellMetaRule
Auto Trait Implementations§
impl Freeze for ShellMetaRule
impl RefUnwindSafe for ShellMetaRule
impl Send for ShellMetaRule
impl Sync for ShellMetaRule
impl Unpin for ShellMetaRule
impl UnsafeUnpin for ShellMetaRule
impl UnwindSafe for ShellMetaRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more