Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38831 - games-action/clanbomber-1.04 won't build with "userpriv"
Summary: games-action/clanbomber-1.04 won't build with "userpriv"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-20 10:07 UTC by TGL
Modified: 2004-01-29 04:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TGL 2004-01-20 10:07:14 UTC
Here is what I get with "usepriv" feature flag enabled:


if g++ -DPKGDATADIR=\"/usr/share/games/clanbomber/\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I..    -mcpu=pentium3 -O3 -pipe -MT Bomb.o -MD -MP -MF ".deps/Bomb.Tpo" \
  -c -o Bomb.o `test -f 'Bomb.cpp' || echo './'`Bomb.cpp; \
then mv -f ".deps/Bomb.Tpo" ".deps/Bomb.Po"; \
else rm -f ".deps/Bomb.Tpo"; exit 1; \
fi
g++  -mcpu=pentium3 -O3 -pipe   -o clanbomber  Disease_Fast.o MapTile_Trap.o Controller_Keyboard.o Controller_Joystick.o MapEditor.o MapTile_Arrow.o Credits.o Controller_AI_MIC.o MapTile_Ice.o MapEntry.o Corpse_Part.o Disease_PutBomb.o Extra_Koks.o Extra_Viagra.o MapSelector.o MapTile_Wall.o MapTile_Box.o MapTile_Ground.o MapTile_None.o MapTile.o Resources.o Extra_Joint.o Disease_Stoned.o Disease_Frozen.o Disease.o GameStatus_Team.o PlayerSetup.o Controller_AI.o Timer.o Extra_Bomb.o Controller.o Extra_Glove.o Bomber_Corpse.o GameStatus.o Observer.o ClanBomber.o Menu.o Extra_Skateboard.o Extra_Kick.o Debug.o Config.o GameObject.o Map.o Extra_Power.o Extra.o Explosion.o Bomber.o Bomb.o  -lclanSound -lclanDisplay -lclanApp -lclanCore -lHermes -lz  -lclanMikMod
Xlib: connection to ":0.0" refused by server

Xlib: No protocol specified



Exception caught from ClanLib:
Failed to open display. No XWindow display available.
make[3]: *** [clanbomber.dat] Segmentation fault
make[3]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04/clanbomber'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04/clanbomber'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04'
make: *** [all] Error 2


Building with `FEATURES="-userpriv" emerge clanbomber` works fine.

My installed clanlib version is 0.6.5-r1, with this flags: +X +alsa -arts +directfb +esd -joystick +jpeg +mikmod +oggvorbis +opengl +oss +png +truetype

Reproducible: Always
Steps to Reproduce:
Comment 1 TGL 2004-01-20 10:23:36 UTC
I forgot to say that I was using emerge in an xterm, in a "su -" root session, and that the X session was the one of a normal user.

I've also tried from a linux console, and it is worst: it becomes interactive, asking me what kind of display I want to use:

g++  -mcpu=pentium3 -O3 -pipe   -o clanbomber  Disease_Fast.o MapTile_Trap.o Controller_Keyboard.o Controller_Joystick.o MapEditor.o MapTile_Arrow.o Credits.o Controller_AI_MIC.o MapTile_Ice.o MapEntry.o Corpse_Part.o Disease_PutBomb.o Extra_Koks.o Extra_Viagra.o MapSelector.o MapTile_Wall.o MapTile_Box.o MapTile_Ground.o MapTile_None.o MapTile.o Resources.o Extra_Joint.o Disease_Stoned.o Disease_Frozen.o Disease.o GameStatus_Team.o PlayerSetup.o Controller_AI.o Timer.o Extra_Bomb.o Controller.o Extra_Glove.o Bomber_Corpse.o GameStatus.o Observer.o ClanBomber.o Menu.o Extra_Skateboard.o Extra_Kick.o Debug.o Config.o GameObject.o Map.o Extra_Power.o Extra.o Explosion.o Bomber.o Bomb.o  -lclanSound -lclanDisplay -lclanApp -lclanCore -lHermes -lz  -lclanMikMod

Please select a display target by entering its abbreviation: 
	[x11] X Window
	[directfb] DirectFB
Your choice: 

I answered x11, and then:

Exception caught from ClanLib:
Failed to open display. No XWindow display available.
make[3]: *** [clanbomber.dat] Segmentation fault
make[3]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04/clanbomber'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04/clanbomber'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04'
make: *** [all] Error 2

I tried again answering directfb, and I got this:

       ---------------------- DirectFB v0.9.20 ---------------------
             (c) 2000-2002  convergence integrated media GmbH  
             (c) 2002-2003  convergence GmbH                   
        -----------------------------------------------------------

(*) Single Application Core. (with MMX support) (2003-10-29 11:37)
(*) DirectFB/misc/memcpy: using SSE optimized memcpy()
[31;01mACCESS DENIED[0m  open_wr:   /dev/fb0
(!) DirectFB/core/fbdev: Error opening `/dev/fb0'!
    --> Permission denied
(!) DirectFB/Core: Could not initialize 'system' core!
    --> Access denied!
(!) DirectFB/Core: Error during initialization (Access denied!)
(#) DirectFBError [CL_DirectFBTarget - DirectFBCreate]: Access denied!
make[3]: *** [clanbomber.dat] Aborted
make[3]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04/clanbomber'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04/clanbomber'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/clanbomber-1.04/work/clanbomber-1.04'
make: *** [all] Error 2
Comment 2 TGL 2004-01-22 11:50:21 UTC
I came back on this today and more or less got a fix.

The bug is because of this clanbomber/Makefile statement:

  clanbomber.dat: clanbomber.scr pics/*.pcx pics/*.tga wavs/*.wav maps/*.map music/bud.mod
  	@./clanbomber -datafile

That's how it generates the data files, using the freshly compiled game binary. I've straced this call and obviously it tries to initialize a display, framebuffer or X depending on what is available. And sure, this is not allowed for the "portage" user. But it is not something we can really remove or replace. 

With a RESTRICT="nouserpriv", I can emerge it from an xterm without issue. It doesn't solve the issue for emerging from a fb console though...

 - first, when you emerge from console, clanbomber ask you for what display to open (x11 or framebuffer). We can give it a default answer with something like this, in src_unpack():

	sed -i \
		'/\t@/s:\(\./clanbomber \-datafile\):echo directfb | \1:' \
		clanbomber/Makefile.in

 - second, with this answer, it will try to open /dev/fb0. Sandbox doesn't like it, but an "addpredict /dev/fb0" does the trick, at least for sandbox. 
But then, I had some permissions error on this device, which was owned by a user with some very restrictive permissions. This may be a configuration mistake on my side though, so maybe it will work for other users.
Comment 3 SpanKY gentoo-dev 2004-01-29 01:41:49 UTC
ok i added a patch so we dont have to go around hacking on the video/sound stuff

sync up and you should be good
Comment 4 TGL 2004-01-29 04:17:21 UTC
Thanks, that's a much better solution than mine :)