games/xbill: Updated for version 2.1
This commit is contained in:
parent
a69ecfc87b
commit
e6c6e9aa4f
|
@ -10,8 +10,11 @@ which obviously allows cheating ones hi-score :-(
|
||||||
Probably this came about since GTK+ doesn't allow setgid?
|
Probably this came about since GTK+ doesn't allow setgid?
|
||||||
|
|
||||||
In the install-script we move xbill to xbill-bin and install
|
In the install-script we move xbill to xbill-bin and install
|
||||||
a wrapper thingy as xbill instead, with setuid and video group
|
a wrapper thingy as xbill instead. In the resulting package
|
||||||
executable filesystem perms. There we change groups to games.
|
/var/games/xbill is group-writable for 'games' only...
|
||||||
|
|
||||||
In the resulting package /var/xbill is group-writable only...
|
|
||||||
|
|
||||||
|
Note on capabilities: FCAPS=true
|
||||||
|
This is the default now. It maybe disabled by feeding a 'false'
|
||||||
|
value to the build script and the wrapper will be installed with
|
||||||
|
setuid and video group executable filesystem perms. As before.
|
||||||
|
Just comment it out, if you don't care for any of this stuff :-)
|
||||||
|
|
|
@ -18,7 +18,3 @@ config var/games/xbill/scores.new
|
||||||
chgrp -R games var/games/xbill
|
chgrp -R games var/games/xbill
|
||||||
chmod -R g+w,o-w var/games/xbill
|
chmod -R g+w,o-w var/games/xbill
|
||||||
|
|
||||||
# Change privs on our little wrapper
|
|
||||||
chgrp video usr/bin/xbill
|
|
||||||
chmod 4750 usr/bin/xbill
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Written by Menno E. Duursma for use with xbill */
|
/* Written by Menno Duursma for use with xbill */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This program is free software. It comes without any warranty.
|
* This program is free software. It comes without any warranty.
|
||||||
|
@ -62,7 +62,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
getuid(),
|
getuid(),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tell the viewers wat is going to happen */
|
/* tell the viewers wat is going to happen */
|
||||||
fprintf(stderr, "Starting %s with uid = %d, gid = %d\n",
|
fprintf(stderr, "Starting %s with uid = %d, gid = %d\n",
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Slackware build script for XBill
|
# Slackware build script for XBill
|
||||||
# Written by Menno E. Duursma <druiloor@zonnet.nl>
|
|
||||||
|
# Written by Menno Duursma <druiloor@zonnet.nl>
|
||||||
|
|
||||||
# This program is free software. It comes without any warranty.
|
# This program is free software. It comes without any warranty.
|
||||||
# Granted WTFPL, Version 2, as published by Sam Hocevar. See
|
# Granted WTFPL, Version 2, as published by Sam Hocevar. See
|
||||||
|
@ -12,7 +13,7 @@
|
||||||
PRGNAM=xbill
|
PRGNAM=xbill
|
||||||
VERSION=${VERSION:-2.1}
|
VERSION=${VERSION:-2.1}
|
||||||
ARCH=${ARCH:-i486}
|
ARCH=${ARCH:-i486}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-2}
|
||||||
TAG=${TAG:-_SBo}
|
TAG=${TAG:-_SBo}
|
||||||
|
|
||||||
CWD=$(pwd)
|
CWD=$(pwd)
|
||||||
|
@ -20,13 +21,19 @@ TMP=${TMP:-/tmp/SBo}
|
||||||
PKG=$TMP/package-$PRGNAM
|
PKG=$TMP/package-$PRGNAM
|
||||||
OUTPUT=${OUTPUT:-/tmp}
|
OUTPUT=${OUTPUT:-/tmp}
|
||||||
|
|
||||||
|
# On capability enabled filesystems this may be enabled,
|
||||||
|
# i'd guess if this box runs x-apps, it probably has...
|
||||||
|
FCAPS=${FCAPS:-true}
|
||||||
|
|
||||||
if [ "$ARCH" = "i486" ]; then
|
if [ "$ARCH" = "i486" ]; then
|
||||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||||
elif [ "$ARCH" = "i686" ]; then
|
elif [ "$ARCH" = "i686" ]; then
|
||||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||||
|
elif [ "$ARCH" = "x86_64" ]; then
|
||||||
|
SLKCFLAGS="-O2 -fPIC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e # Exit on most errors
|
||||||
|
|
||||||
rm -rf $PKG
|
rm -rf $PKG
|
||||||
mkdir -p $TMP $PKG $OUTPUT
|
mkdir -p $TMP $PKG $OUTPUT
|
||||||
|
@ -59,7 +66,7 @@ make install DESTDIR=$PKG
|
||||||
mv $PKG/var/games/xbill/scores $PKG/var/games/xbill/scores.new
|
mv $PKG/var/games/xbill/scores $PKG/var/games/xbill/scores.new
|
||||||
|
|
||||||
# Do a little trick to disallow cheating, hopefully
|
# Do a little trick to disallow cheating, hopefully
|
||||||
# Note: we do the privs stuff in doinst.sh for target system
|
# Note: we do the privs stuff below at doinst.sh
|
||||||
cp -a $PKG/usr/bin/xbill $PKG/usr/bin/xbill-bin
|
cp -a $PKG/usr/bin/xbill $PKG/usr/bin/xbill-bin
|
||||||
gcc -Wall $SLKCFLAGS $CWD/xbill-wrapper.c -o $PKG/usr/bin/xbill
|
gcc -Wall $SLKCFLAGS $CWD/xbill-wrapper.c -o $PKG/usr/bin/xbill
|
||||||
|
|
||||||
|
@ -87,5 +94,14 @@ mkdir -p $PKG/install
|
||||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||||
|
|
||||||
|
if [ "$FCAPS" != "false" ]; then
|
||||||
|
chmod 0751 $PKG/usr/bin/xbill
|
||||||
|
echo 'setcap "cap_setgid=ep" usr/bin/xbill' >> $PKG/install/doinst.sh
|
||||||
|
else
|
||||||
|
# Install setuid-root
|
||||||
|
chgrp video usr/bin/xbill
|
||||||
|
chmod 4750 $PKG/usr/bin/xbill
|
||||||
|
fi
|
||||||
|
|
||||||
cd $PKG
|
cd $PKG
|
||||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
|
||||||
|
|
|
@ -5,4 +5,4 @@ DOWNLOAD="http://www.xbill.org/download/xbill-2.1.tar.gz"
|
||||||
MD5SUM="585e4866b15255a24203db9959407b2f"
|
MD5SUM="585e4866b15255a24203db9959407b2f"
|
||||||
MAINTAINER="Menno E. Duursma"
|
MAINTAINER="Menno E. Duursma"
|
||||||
EMAIL="druiloor@zonnet.nl"
|
EMAIL="druiloor@zonnet.nl"
|
||||||
APPROVED="David Somero"
|
APPROVED="dsomero"
|
||||||
|
|
Loading…
Reference in New Issue