Skip to content
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

Fix uninstall for Warp and Box #23652

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Fix uninstall for Warp and Box #23652

merged 5 commits into from
Nov 11, 2024

Conversation

dantecatalfamo
Copy link
Member

@dantecatalfamo dantecatalfamo commented Nov 8, 2024

#22773

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.
  • Manual QA for all new/changed functionality

@dantecatalfamo dantecatalfamo marked this pull request as ready for review November 8, 2024 16:10
@dantecatalfamo dantecatalfamo requested a review from a team as a code owner November 8, 2024 16:10
@dantecatalfamo
Copy link
Member Author

The box uninstaller still misses one step that's required as part of the uninstall process listed on the box website due to it needing an interactive terminal, but it won't fail spectacularly like it did before

mna
mna previously approved these changes Nov 11, 2024
Copy link
Member

@mna mna left a comment

Choose a reason for hiding this comment

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

Couple comments / questions but overall LGTM.

changes/22773-fma-uninstall-fix Outdated Show resolved Hide resolved
"(cd /Users/$LOGGED_IN_USER; sudo -u $LOGGED_IN_USER /Applications/Box.app/Contents/MacOS/fpe/streem --remove-fpe-domain-and-archive-unsynced-content Box)",
"(cd /Users/$LOGGED_IN_USER; sudo -u $LOGGED_IN_USER /Applications/Box.app/Contents/MacOS/fpe/streem --remove-fpe-domain-and-preserve-unsynced-content Box)",
"(cd /Users/$LOGGED_IN_USER; defaults delete com.box.desktop)",
"echo \"${LOGGED_IN_USER} ALL = (root) NOPASSWD: /Library/Application\\ Support/Box/uninstall_box_drive_r\" >> /etc/sudoers.d/box_uninstall"
Copy link
Member

Choose a reason for hiding this comment

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

That's so that an explicit sudo is not required to run the uninstall_box_drive_r binary? We can't do the explicit sudo in the uninstall script itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's done because there's a sudo in the /Library/Application Support/Box/uninstall_box_drive script that the brew artifact runs. The problem is that without that line sudo fails because the user can't be asked for a password.

Here's an excerpt from the script:

if [ 0 -eq "$user_level_uninstall" ]; then
    # Do the work that requires sudo - this work is placed in a separate script to support
    # developers. On Jenkins passwordless sudo is enabled. But on developer machines we
    # shouldn't require a blanket password-less sudo. This is an issue because developers
    # run Chimp locally and Chimp executes these uninstall scripts and it's often the case
    # that there's no STDIN for sudo to use to get the password. Thus, by placing all the
    # logic that requires sudo in a script called uninstall_box_drive_r... the developers
    # can add an password-exemption for just that script in /etc/sudoers that looks like:
    #     <username> ALL = (root) NOPASSWD: /Library/Application\ Support/Box/uninstall_box_drive_r
    #
    sudo "${0%/*}/"uninstall_box_drive_r $fuse_failure_quits $delete_logs
fi

Copy link
Member Author

Choose a reason for hiding this comment

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

It passes in some arguments from the main uninstall script. In the _r script, it asks that you don't call it independently

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, thanks!

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
"installer_format": "pkg"
"installer_format": "pkg",
"pre_uninstall_scripts": [
"(cd /Users/$LOGGED_IN_USER; sudo -u $LOGGED_IN_USER fileproviderctl domain remove -A com.box.desktop.boxfileprovider)",
Copy link
Member Author

Choose a reason for hiding this comment

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

We should probably have a function that does this as part of our other toolbox, calling sudo -u $user from /root will make the shell freak out

@dantecatalfamo dantecatalfamo merged commit 915213a into main Nov 11, 2024
10 of 14 checks passed
@dantecatalfamo dantecatalfamo deleted the fma-uninstall-warp-box branch November 11, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants