Skip to content

Commit

Permalink
Added a test to make sure '-w' doesn't make writing possible everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
mjg0 committed Mar 1, 2024
1 parent cb26533 commit 2e7b477
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ setup_file() {



@test "specifying one directory doesn't imply permission elsewhere" {
run ! safely -w /dev -w "$HOME" touch /tmp/safely-test-no-extra-perms
}



@test "/dev/null is always writable and behaves as expected" {
safely bash -c 'echo success >/dev/null' # make sure it doesn't deny permission
test "$(safely bash -c 'echo right; echo wrong >/dev/null')" = "right"
Expand Down

0 comments on commit 2e7b477

Please sign in to comment.