In newsgroup: comp.os.linux.setup
> : Hey everyone out there. I run LinuxSDoom and it runs great! The
> : problem is, I can only run it as root. If I run it as anyone else, I
> : don't have either write or executable access to a few files. The
> : error messages don't help much. Does anyone know what files svgalib
> : uses that I may have to chmod to get it to work for anyone?
> Well - this could be a security hole, but it seems the only way to do it.
> You must set the "linuxsdoom" and "sndserver" as suid root:
> chmod 04711 linuxsdoom (-rws--x--x)
> chmod 04711 sndserver (-rws--x--x)
> If you are worried about this (who isn't!), you can set up a group of
> "trusted" people who you will allow to run linuxsdoom, and chgrp the above
> executables (and set -rws--x--- for them aswell).
> Hope that's what you want. I don't think the wad file needs to be suid (I
> think doom picks this up (in suid root mode).
Only linuxsdoom needs to be root. I use the following script to play
DOOM! in a multi-user setup. Install it in /usr/games/bin as "doom",
with a symlink to "doom2" in case you have doom2.wad, and install all
the DOOM! files in /usr/games/lib/doom (with linuxsdoom being setuid
root).
#!/bin/bash
#
# This script makes DOOMWADDIR work as advertised, and also implements
# an environment variable DOOMSAVEDIR, where your DOOM! saved games appear.
#
# Symbolic links saves the day...
#
# This version also supports sndcvt for sound on 8-bit sound cards
# and PC speakers (using pcsndrv driver).
#
# Finally, if the DOOMLIBDIR contains a file "system.doomrc" and the
# user does not have a .doomrc file, it is copied to the user's home
# directory, since the defaults have been known to lock up the console
# on some systems.
#
# Last modified: 1995-02-27
#
# Where DOOM lives.
DOOMLIBDIR=/usr/games/lib/doom
# Hostname
HOSTNAME=`/bin/hostname`
allow_null_glob_expansion=Yes
DOOMSAVES="doomsav0.dsg doomsav1.dsg doomsav2.dsg \
doomsav3.dsg doomsav4.dsg doomsav5.dsg"
OLDDIR=`/bin/pwd`
mkdir /tmp/doom.$$
cd /tmp/doom.$$
if [ "$DOOMSAVEDIR" = "" ]; then
DOOMSAVEDIR="$OLDDIR"
fi
for dsg in $DOOMSAVES; do
ln -s $DOOMSAVEDIR/$dsg .
done
ln -s $DOOMLIBDIR/*.wad .
rm -f ./doom.wad ./doom2.wad
if [ -r $DOOMLIBDIR/`basename $0`.wad ]; then
ln -s $DOOMLIBDIR/`basename $0`.wad .
fi
if [ "$DOOMWADDIR" = "" ]; then
DOOMWADDIR="$OLDDIR"
fi
ln -sf $DOOMWADDIR/*.wad . 2>/dev/null
if [ ! -f $HOME/.doomrc -a -r $DOOMLIBDIR/system.doomrc ]; then
cp $DOOMLIBDIR/system.doomrc $HOME/.doomrc
fi
if [ -r /etc/sound ]; then
SOUND=`grep -v '^#' /etc/sound`
elif [ -r $DOOMLIBDIR/sound.$HOSTNAME ]; then
SOUND=`grep -v '^#' $DOOMLIBDIR/sound.$HOSTNAME`
elif [ -r $DOOMLIBDIR/sound ]; then
SOUND=`grep -v '^#' $DOOMLIBDIR/sound`
else
SOUND=none
fi
case $SOUND in
stereo16)
ln -s $DOOMLIBDIR/sndserver ./sndserver
;;
stereo8)
mkfifo /tmp/dsp
$DOOMLIBDIR/sndcvt -s -P > ./sndcvt.pid &
ln -s $DOOMLIBDIR/sndserver.8bit ./sndserver
;;
mono8)
mkfifo /tmp/dsp
$DOOMLIBDIR/sndcvt -m -P > ./sndcvt.pid &
ln -s $DOOMLIBDIR/sndserver.8bit ./sndserver
;;
pcspeaker)
mkfifo /tmp/dsp
$DOOMLIBDIR/sndcvt -p -P > ./sndcvt.pid &
ln -s $DOOMLIBDIR/sndserver.8bit ./sndserver
;;
none)
# Don't do anything!
;;
*)
echo "$DOOMLIBDIR/sound: Unknown sound type \"$SOUND\""
;;
esac
if [ "$DISPLAY" != "" ]; then
else
fi
cd /tmp
rm -rf doom.$$ dsp