Hi all.
Crawl is not correctly working because of lack of directory permissions. How can i correctly/safely set that permissions for saving data files of Crawl?
Bugzilla ticket: https://bugzilla.redhat.com/show_bug.cgi?id=1458489 Affected package: https://admin.fedoraproject.org/pkgdb/package/rpms/crawl/
Hi,
On 03-06-17 18:46, Antonio Trande wrote:
Hi all.
Crawl is not correctly working because of lack of directory permissions. How can i correctly/safely set that permissions for saving data files of Crawl?
Bugzilla ticket: https://bugzilla.redhat.com/show_bug.cgi?id=1458489 Affected package: https://admin.fedoraproject.org/pkgdb/package/rpms/crawl/
See: https://fedoraproject.org/wiki/SIGs/Games/Packaging
Starting at "If necessary, a game can be made setgid 'games' in order to allow a shared scoreboard file..." note that for games like this you will typically want to use a game specific user and a crawl directory under /var/games, so that you get /var/games/crawl which is owned by the group crawl and then make the crawl binary sgid crawl. Actually if you do that you can skip the dropping rights dance described since a rogue-ish game like crawl properly will have multiple places where it opens files and thus will be hard to get right wrt dropping sgid rights.
Alternatively you could just make it access all shared files on a per user basis putting them in $HOME/.config/crawl you can user getenv("HOME") from C to get the users homedir, in that case don't forget to call mkdir to create the $HOME/.config and again for $HOME/.config/crawl (and ignore error returns since if the dirs exist mkdir will give an error).
Regards,
Hans
Hans,
can you check if the permissions in this spec file are correctly set, please? https://paste.fedoraproject.org/paste/5CP27jxdYtG9DY2FXO6X0A/raw
Scratch builds: https://koji.fedoraproject.org/koji/taskinfo?taskID=20188500
It would help a *lot* if you would say the name of the game. I see that it is "crawl", from https://crawl.develz.org/ . And I'm not a big packager for Fedora, but do have some experience.
A casual review shows that you're using "install -D" in some places, "mkdir" in others, not a biggie, just a consistency issue.
Where does the game save its files? Does it need to be in a shared game repository, or does it save them in the user's home directory? If the games need to be saved into a common space, then does the binary need 2755 permissions in order to write to a shard directory? Not sure, can't tell.
On Mon, Jun 26, 2017 at 1:05 PM, Antonio Trande sagitter@fedoraproject.org wrote:
Hans,
can you check if the permissions in this spec file are correctly set, please? https://paste.fedoraproject.org/paste/5CP27jxdYtG9DY2FXO6X0A/raw
Scratch builds: https://koji.fedoraproject.org/koji/taskinfo?taskID=20188500 _______________________________________________ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-leave@lists.fedoraproject.org
2017-06-27 14:01 GMT+02:00 Nico Kadel-Garcia nkadel@gmail.com:
It would help a *lot* if you would say the name of the game. I see that it is "crawl", from https://crawl.develz.org/ . And I'm not a big packager for Fedora, but do have some experience.
A casual review shows that you're using "install -D" in some places, "mkdir" in others, not a biggie, just a consistency issue.
Where does the game save its files? Does it need to be in a shared game repository, or does it save them in the user's home directory? If the games need to be saved into a common space, then does the binary need 2755 permissions in order to write to a shard directory? Not sure, can't tell.
For what it's worth, on Mageia I have no permission problems whatsoever with crawl. This spec file works just fine:
http://svnweb.mageia.org/packages/cauldron/crawl/current/SPECS/crawl.spec?vi...
Files are saved in the user dir, as expected of any modern game.
Cheers, Rémi
On 27/06/17 14:13, Rémi Verschelde wrote:
2017-06-27 14:01 GMT+02:00 Nico Kadel-Garcia nkadel@gmail.com:
Where does the game save its files? Does it need to be in a shared game repository, or does it save them in the user's home directory? If the games need to be saved into a common space, then does the binary need 2755 permissions in order to write to a shard directory? Not sure, can't tell.
Although I cannot find a reference at a glance, I'd say that files under /usr/share are not expected to change during ordinary conditions. E. g., what if there are two users sharing the same data? If user needs to modify it, I'd think it might be better to copy the shared stuff to the user's home and change the private copy. Might be a problem if the data is big enough to make two copies unfeasible.
For what it's worth, on Mageia I have no permission problems whatsoever with crawl. This spec file works just fine:
http://svnweb.mageia.org/packages/cauldron/crawl/current/SPECS/crawl.spec?vi...
Files are saved in the user dir, as expected of any modern game.
Actually, the spec stores them in %_gamesdatadir a. k. a. /usr/share/games on mageia. IMHO, that's not a user directory.
as expected of any modern game.
Indeed. Perhaps there is some magic copying as described above. Or, the game is actually sane and the game data is read-only as it should be.
Cheers!
--alec
2017-06-27 15:04 GMT+02:00 Alec Leamas leamas.alec@gmail.com:
On 27/06/17 14:13, Rémi Verschelde wrote:
For what it's worth, on Mageia I have no permission problems whatsoever with crawl. This spec file works just fine:
http://svnweb.mageia.org/packages/cauldron/crawl/current/SPECS/crawl.spec?vi...
Files are saved in the user dir, as expected of any modern game.
Actually, the spec stores them in %_gamesdatadir a. k. a. /usr/share/games on mageia. IMHO, that's not a user directory.
Yes, I mean "user files" are saved in the user dir. The game's original data are in /usr/share/%{?mageia:games}/crawl and should be accessed read-only.
I guess there is something broken due to `SAVEDIR="~/.crawl" SHAREDDIR=%{_datadir}/%{name}` which is defined in the Fedora spec file and not in Mageia's. Maybe it can't parse `~` as expected and thus overrides its *correct* default userdir value and defaults instead to the datadir?
as expected of any modern game.
Indeed. Perhaps there is some magic copying as described above. Or, the game is actually sane and the game data is read-only as it should be.
Cheers!
--alec
devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-leave@lists.fedoraproject.org
2017-06-27 15:19 GMT+02:00 Rémi Verschelde rverschelde@gmail.com:
2017-06-27 15:04 GMT+02:00 Alec Leamas leamas.alec@gmail.com:
On 27/06/17 14:13, Rémi Verschelde wrote:
For what it's worth, on Mageia I have no permission problems whatsoever with crawl. This spec file works just fine:
http://svnweb.mageia.org/packages/cauldron/crawl/current/SPECS/crawl.spec?vi...
Files are saved in the user dir, as expected of any modern game.
Actually, the spec stores them in %_gamesdatadir a. k. a. /usr/share/games on mageia. IMHO, that's not a user directory.
Yes, I mean "user files" are saved in the user dir. The game's original data are in /usr/share/%{?mageia:games}/crawl and should be accessed read-only.
Confirmed, crawl on Mageia works just fine with the default options, and the permissions are the usual ones (755 for directories and 644 for files).
My (numerous) saves are in ~/.crawl:
[akien@cauldron ~]$ ll /usr/share/games/crawl/ total 8 drwxr-xr-x 9 root root 4096 mai 25 21:49 dat/ drwxr-xr-x 3 root root 4096 mai 26 08:00 settings/ [akien@cauldron ~]$ ll /usr/share/games/crawl/dat/ total 28 drwxr-xr-x 2 root root 4096 mai 26 08:00 clua/ drwxr-xr-x 4 root root 4096 mai 26 08:00 database/ drwxr-xr-x 2 root root 4096 mai 26 08:00 defaults/ drwxr-xr-x 13 root root 4096 mai 26 08:00 des/ drwxr-xr-x 22 root root 4096 mai 26 08:00 descript/ drwxr-xr-x 3 root root 4096 mai 26 08:00 dlua/ drwxr-xr-x 2 root root 4096 mai 26 08:00 tiles/ [akien@cauldron ~]$ ll /usr/share/games/crawl/settings/ total 88 -rw-r--r-- 1 root root 722 mai 25 21:49 0.12_monster_glyphs.txt -rw-r--r-- 1 root root 251 mai 25 21:49 0.13_monster_glyphs.txt -rw-r--r-- 1 root root 3543 mai 25 21:49 0.14_monster_glyphs.txt -rw-r--r-- 1 root root 369 mai 25 21:49 0.16_monster_glyphs.txt -rw-r--r-- 1 root root 155 mai 25 21:49 0.17_monster_glyphs.txt -rw-r--r-- 1 root root 223 mai 25 21:49 0.18_monster_glyphs.txt -rw-r--r-- 1 root root 792 mai 25 21:49 034_command_keys.txt -rw-r--r-- 1 root root 1323 mai 25 21:49 052_monster_glyphs.txt -rw-r--r-- 1 root root 466 mai 25 21:49 060_monster_glyphs.txt -rw-r--r-- 1 root root 436 mai 25 21:49 071_monster_glyphs.txt -rw-r--r-- 1 root root 241 mai 25 21:49 080_monster_glyphs.txt -rw-r--r-- 1 root root 479 mai 25 21:49 0.9_monster_glyphs.txt -rw-r--r-- 1 root root 1532 mai 25 21:49 advanced_optioneering.txt -rw-r--r-- 1 root root 2041 mai 25 21:49 colemak_command_keys.txt -rw-r--r-- 1 root root 1440 mai 25 21:49 dec_glyphs.txt -rw-r--r-- 1 root root 3021 mai 25 21:49 dvorak_command_keys.txt -rw-r--r-- 1 root root 1450 mai 25 21:49 ibm_glyphs.txt -rw-r--r-- 1 root root 3676 mai 25 21:49 init.txt drwxr-xr-x 2 root root 4096 mai 26 08:00 mac/ -rw-r--r-- 1 root root 943 mai 25 21:49 no_vi_command_keys.txt -rw-r--r-- 1 root root 1451 mai 25 21:49 old_unicode_glyphs.txt -rw-r--r-- 1 root root 317 mai 25 21:49 safe_move_shift.txt [akien@cauldron ~]$ ll ~/.crawl/ total 32 drwxrwxr-x 2 akien akien 24576 juin 10 23:01 morgue/ drwxrwxr-x 7 akien akien 4096 juin 10 23:01 saves/
I guess there is something broken due to `SAVEDIR="~/.crawl" SHAREDDIR=%{_datadir}/%{name}` which is defined in the Fedora spec file and not in Mageia's. Maybe it can't parse `~` as expected and thus overrides its *correct* default userdir value and defaults instead to the datadir?
2017-06-26 19:05 GMT+02:00 Antonio Trande sagitter@fedoraproject.org:
Hans,
can you check if the permissions in this spec file are correctly set, please? https://paste.fedoraproject.org/paste/5CP27jxdYtG9DY2FXO6X0A/raw
Unrelated, but Crawl upstream provides nice source tarballs without bundled dependencies, it would be cleaner to use those than to rely on GitHub tags. http://crawl.develz.org/release/0.20/stone_soup-0.20.0-nodeps.tar.xz
Rémi
On 06/03/2017 06:46 PM, Antonio Trande wrote:
Hi all.
Crawl is not correctly working because of lack of directory permissions. How can i correctly/safely set that permissions for saving data files of Crawl?
Bugzilla ticket: https://bugzilla.redhat.com/show_bug.cgi?id=1458489 Affected package: https://admin.fedoraproject.org/pkgdb/package/rpms/crawl/
I have updated and modified data directory permissions of Crawl. This problem does not occur on my pc, Crawl packages need additional tests of someone else.
Packages in testing on F >=24: https://bodhi.fedoraproject.org/updates/?packages=crawl