protonscr

Ensure dist.lock management does not break system-wide installs

protonclosed Feature Request
ValveSoftware/Proton#3844 · opened 2020-05-08 by 414n · updated 2020-06-09 · 1 comments · github
4414n 2020-05-08 github

Feature Request

I confirm:

  • [x] that I haven't found another request for this feature.
  • [x] that I have checked whether there are updates for my system available that
    contain this feature already.

Description

The proton python script currently creates a lock file based on the base_dir location. This works ok for "mainstream" Proton installs, as they get installed by the Steam client in the SteamApps directory where the user must have write access to; however, this can break in Proton versions installed under system-wide compatibilitytools.d directories such as /usr/share/steam or /usr/local/share/steam, because there the user could have no write access to create that lock file.
A solution could be to check for write access in base_dir before attempting to create the lock file in there, resorting to another writable location or to directly use the /var/lock directory in all cases.
Using a directory other than base_dir poses the problem of having a unique ID for the lock file at one's disposal, but I think this can be done by using the CURRENT_PREFIX_VERSION variable.

Justification

This issue is for the proton script, that is not part of standard wine

Risks

Choosing a bogus ID for the lock file could mean possible concurrent access to the prefix that should have been blocked by the lock file.

References

https://github.com/ValveSoftware/steam-for-linux/issues/6310

4414n 2020-06-09 github

Fixed in 6e821c774fce67e35cedc2d193853c9333a1922f