-
Notifications
You must be signed in to change notification settings - Fork 465
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
Conversation
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 |
There was a problem hiding this 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.
"(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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)", |
There was a problem hiding this comment.
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
#22773
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.See Changes files for more information.