First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 93604
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Games <games@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Stewart Martin <stewartmartin@sbcglobal.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
heroes3-1.3.1a-r2.ebuild heroes3-1.3.1a-r2.ebuild text/plain Alex Linke 2005-05-27 01:45 0000 3.60 KB Details
heroes3-wrapper.sh heroes3-wrapper.sh text/plain Alex Linke 2005-05-27 01:46 0000 199 bytes Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 93604 depends on: Show dependency tree
Bug 93604 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-05-22 13:12 0000
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

------- Comment #1 From Alex Linke 2005-05-27 01:41:11 0000 -------
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,

------- Comment #2 From Alex Linke 2005-05-27 01:45:45 0000 -------
Created an attachment (id=59929) [edit]
heroes3-1.3.1a-r2.ebuild

------- Comment #3 From Alex Linke 2005-05-27 01:46:51 0000 -------
Created an attachment (id=59930) [edit]
heroes3-wrapper.sh

------- Comment #4 From Stefan Huszics 2005-06-15 04:25:13 0000 -------
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

------- Comment #5 From Chris Gianelloni (RETIRED) 2005-06-15 06:18:37 0000 -------
No.

We must find a workaround instead, as /opt should be able to be non-writeable.

------- Comment #6 From Stewart Martin 2005-06-15 09:07:56 0000 -------
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.

------- Comment #7 From Alex Linke 2005-06-15 09:40:41 0000 -------
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.

------- Comment #8 From Stewart Martin 2005-07-15 11:45:39 0000 -------
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.

------- Comment #9 From Chris Gianelloni (RETIRED) 2005-07-15 12:44:06 0000 -------
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.

------- Comment #10 From Stewart Martin 2005-08-04 03:28:05 0000 -------
"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.


------- Comment #11 From Chris Gianelloni (RETIRED) 2006-10-05 15:55:40 0000 -------
Fixed in CVS... sorry it took so long... I had to find my stupid CD...

First Last Prev Next    No search results available      Search page      Enter new bug