stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
117 stars 58 forks source link

Installed file permissions cause issue for flatpak packaging #151

Closed samtygier closed 3 years ago

samtygier commented 3 years ago

I am attempting to make a flatpak of b-em, but I am hitting an issue with installed file permissions.

The chmod calls in Makefile.am set some of the data files to 444 (read only) and directories to 555 (read and list). This upsets flatpak-builder in a number of places, e.g. during the build

Error: renameat(checkout-union-2xYf1Q, b-em.cfg): Permission denied

and when trying to build again

Couldn't empty app dir 'build-dir': unlinkat: Permission denied

I think most linux tools assume that files get installed with write set for the owner (root), i.e. 644 and 755

Just removing the 2 chmod lines from Makefile.am fixes this for me, or modifying them to 644 and 755 (probably safer). I wondered if there was a specific reason they were added? Would you accept a patch modifying them or would you prefer the flatpak build script did the modification.

SteveFosdick commented 3 years ago

I am all in favour of ways to make it easier for people to install and use b-em.

I don't remember setting these specific file permissions and I have not run into problems but then, when installing to /usr/local... I am running the install command as root so it doesn't have any problem with file permissions. Do I take it the flatpak building is installing into a temporary installation area before then packing that up into some kind of archive?

I did just check and my /usr/bin directory has files owned by root and writable by root. The important think about files in a package is that they cannot be overwritten by a normal, unprivileged user, so as long as they are owned by root, i.e. being writable does not open up a 2nd user that is able to write them then I can't see a problem with making the change.

samtygier commented 3 years ago

Do I take it the flatpak building is installing into a temporary installation area before then packing that up into some kind of archive?

Yes, I think that's right.