AppImageCommunity / libappimage

Implements functionality for dealing with AppImage files
https://appimage.org
Other
46 stars 29 forks source link

Only try setting the execution permissions if the file doesn't have them already #110

Closed azubieta closed 5 years ago

azubieta commented 5 years ago

I'm also thinking on a way on creating a uni-test for this scenario. Any ideas @probonopd

probonopd commented 5 years ago

Run the function on an AppImage that is already executable, and have the test fail if libappimage tries to set the executable bit again despite that it is already there?

azubieta commented 5 years ago

fail if libappimage tries to set the executable

I have no way of intercept this without modifying the libappimage code.

probonopd commented 5 years ago

Why do you think the libappimage code should not be modified?

azubieta commented 5 years ago

Why do you think the libappimage code should not be modified?

I guess that I didn't explain it properly. To the set execution permissions is performed by a single function call inside the register method. It would be required to extract that call and put it inside some kind of weird wrapper to be able to know from the tests environment whether it has been called or not. All of that will also reduce performance and will increase the complexity or our code base.

In this scenario the relation effort vs gain is really bad. That's why I don't want to do such modification on libappiimage.

The ideal use case will be having an AppImage file without execution permission that doesn't belongs to the current user. We cold create such file but once we do chown on it we will lose control and this may just lead to weird things.