fix(fermata): a flag's value and an excluded name stop no harmless command
grep -A 2 .env a.txt, rg -t py .env, tar --exclude=.env and git --no-pager status .env pass under a rule on .env. A small list of grep's and rg's flags with a value, four exclude flags and git's quiet flags; grep -A 2 TOKEN .env and --include=.env stay stopped.
This commit is contained in:
@@ -453,27 +453,6 @@ fn a_new_file_named_to_a_verb_off_the_writing_list_is_not_checked() {
|
||||
assert!(denied(&p.bash("tool > vendor/new")), "control");
|
||||
}
|
||||
|
||||
/// Harmless commands that are stopped: a flag's value takes the pattern's place, the text
|
||||
/// after `=` counts as a path, and a flag before `git`'s command loses its class.
|
||||
#[test]
|
||||
fn a_flags_value_or_text_after_an_equals_sign_can_stop_a_harmless_command() {
|
||||
let p = ruled(RULES[0]);
|
||||
fs::write(p.dir().join("a.txt"), "x").unwrap();
|
||||
for command in [
|
||||
"grep -A 2 .env a.txt",
|
||||
"grep -m 1 .env a.txt",
|
||||
"rg -n -C 2 .env a.txt",
|
||||
"rg -t py .env",
|
||||
"grep -r TOKEN --exclude=.env .",
|
||||
"tar --exclude=.env -cf x.tar .",
|
||||
"rsync --exclude=.env a b",
|
||||
"npm test -- --grep=.env",
|
||||
"git --no-pager status .env",
|
||||
] {
|
||||
assert!(denied(&p.bash(command)), "{command}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A key file holding only certificates passes, and that is read from its armor labels:
|
||||
/// other text beside a certificate block is not looked at.
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user