29 Commits

Author SHA1 Message Date
Bo Anderson
6a0db5035f
Fix misuse of fork in sandbox causing crashes 2024-08-28 13:53:01 +01:00
William Woodruff
9d313b23eb
sandbox: disallow backslashes in path filter names
This should really be an allowlist rather than a denylist,
but for the time being this at least prevents someone from
causing an obtuse sandbox error by naming a file something like
"foo\".

Signed-off-by: William Woodruff <william@yossarian.net>
2024-07-31 12:10:51 -04:00
Rylan Polster
7d16fd9186
Revert "sandbox: deny signal to other processes" 2024-07-15 12:22:02 -04:00
Thierry Moisan
e351cf049c
Update Library/Homebrew/test/sandbox_spec.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-07-14 11:51:52 -04:00
Thierry Moisan
6995e955b5
Update Library/Homebrew/test/sandbox_spec.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-07-14 11:51:45 -04:00
Thierry Moisan
66a479be82
sandbox: deny signal to other processes 2024-07-14 11:21:51 -04:00
William Woodruff
92ef6ef763
Merge pull request #17708 from Homebrew/sandbox-chmod 2024-07-13 16:38:44 -04:00
Rylan Polster
e054a3ccf6
Also restrict SUID/GSID writes in sandbox 2024-07-13 16:28:17 -04:00
Thierry Moisan
74bb9fb193
Add test 2024-07-13 16:14:12 -04:00
Rylan Polster
f4e5e0c716
Don't allow special characters in sandbox rule paths
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
2024-07-13 14:41:05 -04:00
Caleb Xu
4eb4c7a970
sandbox: enable strict typing 2024-04-24 21:56:25 -04:00
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Bo Anderson
9e42ddb011
sandbox: fallback to tput for winsize 2021-09-01 21:09:23 +01:00
Rylan Polster
af40e072b0
style: remove RSpec/NamedSubject violations 2021-02-01 20:30:51 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
4d8dcb1d81 Add RSpec formatter for Github Actions. 2020-09-07 23:50:44 +02:00
Mike McQuaid
40ec8e69cc
Cleanup Sandbox code
Remove unused code and methods.
2020-05-02 13:45:04 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
3821132f9e Merge pull request #2898 from MikeMcQuaid/sandbox-all-taps
sandbox: sandbox all taps by default.
2017-07-30 16:02:36 +01:00
Markus Reiter
2ad3a87045 Silence all specs by default. 2017-07-29 20:25:37 +02:00
Mike McQuaid
fb310c57b1 sandbox: sandbox all taps by default.
We've been doing this in `brew test-bot`, for our CI and for
homebrew/core long enough that this is a reasonable default that
provides more protection to our users of non-homebrew/core taps.
2017-07-14 17:00:07 +01:00
Markus Reiter
3cdf8f938a Use scoped RSpec matchers. 2017-05-15 17:23:40 +02:00
Markus Reiter
a554902380 Add mktmpdir helper method. 2017-02-28 15:06:32 +01:00
Markus Reiter
d25f949824 Convert Sandbox test to spec. 2017-02-27 17:41:28 +01:00