49 Commits

Author SHA1 Message Date
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Bo Anderson
2d929b8a9f
cask/quarantine: avoid xcrun when executing Swift 2024-03-02 19:31:38 +00:00
Douglas Eichelberger
eb7c3e52a0 Require SystemInclude only where needed 2024-01-31 11:42:01 -08:00
Edward
f21af1e3eb
fix: xattr check in download quarantine 2023-10-25 21:22:06 +08:00
Mike McQuaid
58df7885e6
cask/quarantine: sudo correctly during tests.
Use `NeverSudoSystemCommand` and pass it through to
`Quarantine.copy_xattrs` so `brew tests` doesn't try to `sudo`.

Fixes #15958

Co-authored-by: Bo Anderson <mail@boanderson.me>
Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-09-06 10:03:45 -04:00
Mike McQuaid
eadac2fb2a
cask/quarantine: tweak wording. 2023-07-06 14:10:13 +01:00
Marcin Floryan
1b474a508d
App Management message updated
With the update of MacOS from Monterey (12) to Ventura (13) the appearance of the System Settings has changes and the "Security & Privacy" category has been renamed to "Privacy & Security".

I am aware that currently Ventura has a very low adoption rate so this change could be premature.
2023-07-06 14:43:36 +02:00
Ismayil Mirzali
8a52ae2933
cask/quarantine: fix exception not being caught
Changes the rescue clause to also handle EPERM.

This fixes the issue of cask upgrades/reinstalls to failing due to
permissions [1]. It's worth noting though, the prompt for allowing App
Management permissions does not seem to occur, so that's something else
to be investigated.

1. https://github.com/Homebrew/homebrew-cask/issues/148253

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
2023-06-05 18:54:44 +03:00
Mike McQuaid
89dfe4fc5b
Merge pull request #15483 from JBYoshi/cask-prompt-permissions
Check for App Management permissions before updating apps.
2023-05-29 09:15:22 +01:00
Mike McQuaid
98dd8610ae
Tweak code style and documentation wording 2023-05-29 08:59:35 +01:00
JBYoshi
97b9b61061
Change permission failure from fatal to warning. 2023-05-26 11:13:23 -05:00
JBYoshi
40352cb2da
Make Homebrew check for App Management permissions before updating apps. 2023-05-24 22:11:16 -05:00
Markus Reiter
43c6b0ab61
Use sudo for copying xattrs when necessary. 2023-05-24 23:39:18 +02:00
JBYoshi
ad8ce82673
Fix typing on revert_upgrade().
Also adds several type signature checks to test for these errors.
2023-05-12 14:53:27 -05:00
JBYoshi
3e249a9428
Improve styling. 2023-05-03 11:29:01 -05:00
JBYoshi
a1571702d3
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-25 15:44:29 -05:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
JBYoshi
f97bce040f
Update for feedback. 2023-04-24 10:50:01 -05:00
JBYoshi
3f8998a4fc
Reset extended attributes of the base directories. 2023-04-03 20:21:37 -05:00
Douglas Eichelberger
abfe29040b Enable types in Library/Homebrew/cask 2023-03-18 16:03:10 -07:00
Bo Anderson
9c3359afa1
cask/quarantine: fix quarantine not working under some setups 2022-06-02 18:53:46 +01:00
Mike McQuaid
1bb44979ee
Disable and delete code for 3.5.0
The next planned release will be 3.5.0 so let's fix things up for there.
2022-05-30 14:59:14 +01:00
ylht
75a38b7187 refactor the format 2021-07-19 10:02:19 +08:00
ylht
e5986dba6c cmd/doctor: repair xattr not find 2021-07-19 09:55:30 +08:00
EricFromCanada
2ed324ebc0 use backticks around suggested input, flags, and binaries 2021-01-26 16:19:47 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
ad74b96dd8 Document Quarantine. 2020-08-26 03:13:59 +02:00
Markus Reiter
8a32954940 Move cask/all to just cask. 2020-08-09 01:34:07 +02:00
Markus Reiter
16b3cb0d71 Skip quarantining symlinks. 2019-10-15 18:32:37 +02:00
L. E. Segovia
ed7327296a
Cask: only quarantine working symlinks
Fixes Homebrew/homebrew-cask#70796
2019-10-14 15:38:41 +00:00
ytqh
24ef7fa5c8 remove xattr unsupported option in macOS 10.15 2019-10-11 21:18:53 +08:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter
9b84b2404a
Merge pull request #5087 from amyspark/xattr-fail
Cask: fix quarantine check when xattr is broken
2018-10-13 23:52:41 +02:00
L. E. Segovia
1707caf968
Cask: fix quarantine check when xattr is broken 2018-10-13 01:27:36 +00:00
L. E. Segovia
2c9b599c0a
Cask: simplify chmod +w passes 2018-10-08 18:23:21 +00:00
L. E. Segovia
59fcaa3674
Cask: set write permissions on symlinks 2018-10-08 01:39:52 +00:00
Viktor Szakats
a0d971a0d0 secure/fix URLs 2018-10-03 21:21:05 +00:00
L. E. Segovia
6d7e49b02b
Cask: check if xattr works before quarantining
Fixes Homebrew/homebrew-cask#52128.
2018-09-26 20:55:54 +00:00
L. E. Segovia
123dda09f0
Cask: constrain quarantine support status
Quarantine is available ONLY if the script exits with '2'.
It is definitely NOT available if Swift doesn't exist or if
it exits with '5' (incompatible SDK). All other cases are
from now on treated as unsupported.

Also print to standard error only when explictly required (via an
exception).
2018-09-14 15:48:16 +00:00
L. E. Segovia
124a8109ce
Cask: rename no-translocation-bit changer function 2018-09-08 20:20:55 +00:00
L. E. Segovia
c7c14e1333
Cask: split quarantine/release functions 2018-09-08 14:00:44 +00:00
L. E. Segovia
53b95c6260
Cask: use native chmod to set write permissions
Ruby chmod follows symlinks, which can point to non-existent files. This
should fix quarantining Casks e.g. disk-inventory-x.
2018-09-07 16:57:00 +00:00
L. E. Segovia
ab31af2b4b
Cask: fixes for quarantining
Gatekeeper's Path Randomization is currently making automated
installation a nightmare. Let's manually toggle the (undocumented) app
translocation bit in the `com.apple.quarantine` extended attribute.

While we're at it, let's also toss in some fixes:

- zip downloads with improper permissions that prevent us from
quarantining
- quarantine/release/skip downloads as requested by the user
2018-09-07 15:37:31 +00:00
Mike McQuaid
132aa14320
Merge pull request #4838 from reitermarkus/cask-module
Rename `Hbc` module to `Cask`.
2018-09-06 09:15:44 +01:00
Markus Reiter
a84a1c63db Rename Hbc module to Cask. 2018-09-06 09:30:52 +02:00
L. E. Segovia
ed6f2829b1
Cask: check support of quarantine's tools
- In some cases (usually old CLT versions) Swift is available but needs an
extra guard to use the quarantine API.
- xattr's native filesystem recursion is an Apple extension which is
not available in Mojave; so let's use xargs.
- Insert a quarantine support check in brew cask doctor.

Fixes Homebrew/homebrew-cask#51554, and fixes Homebrew/homebrew-cask#51538.
2018-09-04 21:11:29 +00:00
Mike McQuaid
90b3a13909
cask: move cask/lib/hbc/* to cask/*.
Fix the load path, requires and some filenames accordingly.
2018-09-04 09:56:57 +01:00