Skip to main content

writes_a_file

Function writes_a_file 

Source
pub fn writes_a_file(command: &str) -> bool
Expand description

Whether command writes a file through a shell redirect.

A redirect is a file write that no tool name describes, so the caller clamps the call by the write tool’s policy rather than the shell’s alone. Without that, write_file = "deny" was bypassable with echo x > file.

Conservative on an unparseable line: a line this cannot read is treated as writing, because the alternative is deciding it does not on evidence that was already too weak to name its programs.