From ade29a3309dc20276557b3ef32df87bbb0c97c28 Mon Sep 17 00:00:00 2001 From: Joshua Kwan Date: Wed, 31 Dec 2003 02:39:10 +0000 Subject: [PATCH] tweaked for some Debianisms that should be default anyway git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@17 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- Makefile | 4 +++- dgamelaunch.c | 5 +++-- dgamelaunch.h | 4 ++-- dgl-create-chroot | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ea32c6d..bef98b5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ +VERSION = 1.3.10.1 CC = gcc LDFLAGS = -CFLAGS = -g3 -O0 -Wall -W -Wno-unused-parameter +CFLAGS = -g3 -O0 -Wall -W -Wno-unused-parameter $(DEFS) +DEFS = -DVERSION=\"$(VERSION)\" SRCS = virus.c ttyrec.c dgamelaunch.c io.c ttyplay.c stripgfx.c OBJS = $(SRCS:.c=.o) LIBS = -lncurses -lcrypt diff --git a/dgamelaunch.c b/dgamelaunch.c index 66394b0..59b07d8 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -30,6 +30,8 @@ * is very small. */ +#include "dgamelaunch.h" + /* a request from the author: please leave some remnance of * 'based on dgamelaunch version xxx' in any derivative works, or * even keep the line the same altogether. I'm probably happy @@ -37,7 +39,7 @@ #define VERLINES 7 /* number of lines in this vanity text */ #define VER1 "## dgamelaunch - network console game launcher\n" -#define VER2 "## version 1.3.10\n" +#define VER2 "## version " VERSION "\n" #define VER3 "## \n" #define VER4 "## (c)2001-3 M. Drew Streib. This program's source is released under the GPL.\n" #define VER5 "## Send mail to for details or a copy of the source code.\n" @@ -53,7 +55,6 @@ #define _XOPEN_SOURCE /* grantpt, etc. */ #define _BSD_SOURCE /* setenv */ -#include "dgamelaunch.h" #include #include #include diff --git a/dgamelaunch.h b/dgamelaunch.h index aa5bd7b..199dd0a 100644 --- a/dgamelaunch.h +++ b/dgamelaunch.h @@ -12,8 +12,8 @@ struct dg_user int flags; }; -#define SHED_UID 1031 /* the uid to shed privs to */ -#define SHED_GID 1031 /* the gid to shed privs to */ +#define SHED_UID 5 /* the uid to shed privs to */ +#define SHED_GID 5 /* the gid to shed privs to */ #define MAXUSERS 64000 /* solves some preallocation issues. */ #define LOC_CHROOT "/var/lib/dgamelaunch/" diff --git a/dgl-create-chroot b/dgl-create-chroot index b7400e9..851730e 100755 --- a/dgl-create-chroot +++ b/dgl-create-chroot @@ -18,8 +18,8 @@ cp -L /lib/libncurses.so.5 $CHROOT_PATH/lib cp -L /lib/ld-linux.so.2 $CHROOT_PATH/lib # Passwd file -echo "nethack:!:1031:1031::/nonexistent:/bin/sh" > $CHROOT_PATH/etc/passwd -echo "nethack:x:1031:" > $CHROOT_PATH/etc/group +echo "games:!:5:60:games:/nonexistent:/bin/sh" > $CHROOT_PATH/etc/passwd +echo "games:x:60:" > $CHROOT_PATH/etc/group # Dungeon directory setup mkdir -p $CHROOT_PATH/dgldir/inprogress