Skip to content

cask/uninstall: fix HOME references in uninstall stanzas for multi-user installs #19813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

carlocab
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Uninstall stanzas (e.g. zap) don't work correctly on multi-user
installations where the user's UID might differ from the EUID.

Let's try to fix that by ensuring that ~ is resolved to the running
user's HOME (instead of the HOME of the EUID user).

@carlocab carlocab requested review from Bo98 and MikeMcQuaid April 23, 2025 14:25
@carlocab carlocab self-assigned this Apr 23, 2025
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

…user installs

Uninstall stanzas (e.g. `zap`) don't work correctly on multi-user
installations where the user's UID might differ from the EUID.

Let's try to fix that by ensuring that `~` is resolved to the running
user's `HOME` (instead of the `HOME` of the EUID user).
@carlocab carlocab force-pushed the cask-home-uninstall branch from 00dfc69 to b623341 Compare April 24, 2025 10:50
This seems more reliable than using `trash.swift`.
@carlocab carlocab force-pushed the cask-home-uninstall branch from 554832f to ac0dd6d Compare April 25, 2025 11:59
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, like the /usr/bin/trash usage!

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants