rvm / executable-hooks

Other
21 stars 12 forks source link

Commit 90c553ca526ef971f1e4adebb8252589a6c89c8e causes file permission bug #33

Closed webzakimbo closed 6 years ago

webzakimbo commented 6 years ago

I've just come across this:

Where RVM is installed system wide and ruby_executable_hooks is owned by rvm, the File.chmod(0775, destination) call fails with a permissions error when called by a user other than rvm.

Previously this code block wasn't executed as prior to this commit it was skipped if the destination file - i.e. the target for the chmod - already existed.

krwenholz commented 6 years ago

FWIW, we ran into this too (had installed ruby_executable_hooks as root) and worked around it with rvm fix-permissions USER where user was the one we wanted to use the gem with later. Not perfect, but it was fairly clean in our build process and hasn't seemed to have any other unintended side effects.

derekgottlieb commented 6 years ago

This change breaks our multi-user ruby environments where the rvm fix-permissions USER approach won't work for us. Can we get it reverted @mpapis?

mpapis commented 6 years ago

Version 1.6.0 will check first if the file differs and only then writes new version, it still will be problem when the wrapper will be updated, thankfully it happened only once in the 5 years history of this project.