FS#73353 - [nethack] setgid nethack can't write game files

Attached to Project: Community Packages
Opened by Joost Molenaar (j0057_1) - Thursday, 13 January 2022, 21:52 GMT
Last edited by Ivy Foster (escondida) - Tuesday, 27 September 2022, 15:40 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jakob Gruber (schuay)
Ivy Foster (escondida)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 8
Private No

Details

Description:

As it currently is, the game won't start, because all the files in /var/games/nethack are owned by root:root,
and the game needs them to be owned by root:nethack.

Additional info:
* package version: 3.6.6-2 -- it looks like uninstalling 3.6.6-2, removing /var/games and then installing 3.6.6-1 fixes the problem.

Steps to reproduce:
* Install and run


This task depends upon

Closed by  Ivy Foster (escondida)
Tuesday, 27 September 2022, 15:40 GMT
Reason for closing:  Fixed
Comment by Joost Molenaar (j0057_1) - Thursday, 13 January 2022, 21:53 GMT
s/root:nethack/root:games/
Comment by Joost Molenaar (j0057_1) - Friday, 14 January 2022, 21:04 GMT
Looks like the idea was to set the permissions using systemd-tmpfiles,
attached is a patch that does so. Second patch fixes a compilation
warning about a define being set twice.
Comment by Matthew T. Hoare (Head_on_a_Stick) - Friday, 10 June 2022, 11:49 GMT
The patches haven't fixed the problem.

The /var/games/ directory is now owned by the games group but the nethack directory inside is not:

$ ls -ld /var/games
drwxrwxr-x 1 root games 14 Jun 10 12:31 /var/games
$ ls -l /var/games
total 0
drwxrwxr-x 1 root root 110 Jun 10 12:34 nethack
$

So the game still won't start under a normal user.

This gets it working:

chgrp -R games /var/games/nethack
Comment by Kuan-Yen Chou (kyechou) - Tuesday, 06 September 2022, 23:49 GMT
I can confirm that Molenaar's patches do fix the problem.
Comment by Ivy Foster (escondida) - Tuesday, 27 September 2022, 15:40 GMT
Yup, they sure do. Updated version uploaded to [community]

Loading...