sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
814 stars 40 forks source link

Automatic Updater breaks file permissions on update in multi user systems #1989

Open OdatNurd opened 7 years ago

OdatNurd commented 7 years ago

Summary

The Sublime Text Installer installs the application to e.g. C:\Program Files\ with permissions that allow all users on the machine to access and run it, but when a new version is released and Sublime auto updates itself, it modifies the permissions on the installation folder to only allow the user that performed the update to access it, which blocks all other users on the machine from running it.

Expected behavior

The permissions on the installation folder would remain as they were at install time (i.e. accessible to all users) even after an automatic upgrade.

Actual behavior

The permissions on the installation location are modified to only allow access to user that was running Sublime when it detected a new version, blocking other users on the same machine from even opening it.

Steps to reproduce

The following is using Dev Build 3145 on Windows 10, although I also verified that the same thing appears to also occur on Windows 7 as well (I have no screen shots for that platform however).

From a state in which there is no Sublime installed, run the installer and select the default location for the install. Once done, check the permissions on the installation folder. On my Windows 10 machine, that looks something like this:

win10_initial_install

The full list of permissions includes the following:

ALL APPLICATION PACKAGES
ALL RESTRICTED APPLICATION PACKAGES
CREATOR OWNER
SYSTEM
Administrators(ZOOM\Administrators)
Users (ZOOM\Users)
TrustedInstaller (Selected in the image above)

In this state, all users on the machine (ZOOM\Users) have permission to access the folder and run Sublime.

Now perform a check for updates, and Sublime finds a new version (as of right now, build 3147). Select to install the update. Once this is done, the permissions on the installation folder are changed:

win10_updated

Now the list of users with permission is just Administrators and my specific user account. Switching to an alternate account on the machine, that user is not allowed to run Sublime (they can't even see the icon for the application in the start menu or in the task bar if it was previously pinned).

In this case, the user here (Terence Martin) is a member of the administrators group. As a test, I uninstalled Sublime completely, then repeated the above steps, only the update was checked for and installed by an alternate user account.

In this case I was prompted for an Administrator password to be able to perform the update, and when the update was finished the permissions on the install folder were this:

win10_update_as_user

As seen here, the permissions now say that only this alternate user can access Sublime, and indeed swapping back to the original user shows that the Terence Martin user can no longer start Sublime.

For completeness I also tested this on MacOS 10.10.5, but no matter which user installs the application and which one performs the update, the permissions remain unchanged and Sublime remains accessible for all users.

This particular problem dates back to at least build 3126, although until recently I didn't realize what had caused it.

Environment

cylkee commented 2 years ago

Just hit this bug 😢 ST build 4126 Windows 10 64-bit, standard user local account.

cylkee commented 2 years ago

And again. Sublime Text 4 Build 4142 on Windows 10 64-bit, standard user local account.

ghlecl commented 1 year ago

+1 for the problem with Sublime Text 4 Build 4143.

michaelblyons commented 1 year ago

I ended up telling the users on the shared computer to install Sublime for just their user account. There's enough disk space for us to do it that way. It would be nice to have a single install, but this is the easiest path for now. Be careful to avoid #2783.

cylkee commented 3 months ago

Hit again by this on build 4180.

Although, I think I found a quick workaround. Try to navigate the installation folder while logged in as the affected user (e.g. C:\Program Files\Sublime Text). For my local user account it threw a UAC prompt for admin password (luckily I'm also the admin on my computer, but others may need to call tech support). This then seems to grant perpetual access to the folder after reboots etc. and Sublime Text loads and works as normal. Until the next time Sublime Text is updated or this issue is fixed...

michaelblyons commented 3 months ago

Although, I think I found a quick workaround.

Yes, that's what we had been doing before multiple installs. I'm sorry it didn't occur to me to mention.