When I run the game as a non-root user, and play a campaign game, the game seg faults after completing a level. When playing as root this doesn't happen. After completing a level of a campaign, a file is created or altered called "outpool00.txt" in the games installation directory, and there may be other "outpoolxx.txt" files, but completing a level takes a long time so I haven't tested it. Running as a user without write privileges to the installation directory, therefore causes the game to seg fault when it cannot create the file. Reproducible: Always Steps to Reproduce: Reproducible: Always Steps to Reproduce: 1. Start a campaign game as a user without write privileges to the directory where the game was installed 2. Complete a level of the campaign
hi, <strace> open("/home/alex/.loki/heroes3/games/CAMP1_1_end.cgm", O_RDWR|O_CREAT|O_TRUNC, 0666) = 18 fstat(18, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb756e000 open("outpool00.txt", O_RDWR|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied) --- SIGSEGV (Segmentation fault) @ 0 (0) --- </strace> heroes3 tries to write a file called 'outpool00.txt' (in general: outputXX.txt') that contains all information about the heroes that shall be carried over to the next campaign's level to CWD, which is - through the 'heroes3'-wrapper-script that got installed to /usr/games/bin/ - determined to be ${GAMES_PREFIX_OPT}/heroes3/, what comes out to be /opt/heroes3/ in my setup. This directory is not user-writeable and so the game crashes while trying to write the file to disk. Solution: Modify the wrapper to change CWD to ${HOME}/.loki/heroes3 before executing /${GAMES_PREFIX_OPT}/heroes3/heroes3. I updated the ebuild and added a new wrapper-script. Have fun,
Created attachment 59929 [details] heroes3-1.3.1a-r2.ebuild
Created attachment 59930 [details] heroes3-wrapper.sh
This bug affects me too and chmod /opt/heroes3 to 770 solves this (which I assume means the fixed ebuild would work too). Someone with access, please add this fix to portage. It's not good when users learn you should run games as root for things to work... TIA / Stefan
No. We must find a workaround instead, as /opt should be able to be non-writeable.
What do you mean, "no"? If I'm not mistaken, the new wrapper is a workaround that leaves /opt/ non-writeable, and therefore this fix should be added to portage.
yes, you are right: 'heroes3-wrapper.sh' takes care of that so you don't need write-access to /opt/heroes3 in order to play a campaign-game. the CWD is changed to $HOME/.loki/heroes3/, so every 'outpoolXX.txt'-file can be dumped there without a trouble or harm.
Is this ebuild and wrapper ever going to get submitted so this bug report can get closed? It would be nice. No rush. This fix keeps /opt from having to be made writeable in order for the game to work, not the opposite.
http://www.gentoo.org/proj/en/desktop/games/#doc_chap5_sect10 *sigh* I've assigned this to myself. I will get to it when I have time, as I have not even had the chance to look at this.
"When is it appropriate to ask when a bug will be resolved/a new ebuild will be added? Never. " I figured that. Sorry. My intent was actually to make sure it was clear that this wrapper was good and that all it needs now is to be added to portage. Maybe that was already clear, I just wanted to further clarify.
Fixed in CVS... sorry it took so long... I had to find my stupid CD...