Go to file
Joshua Kwan 46295b2023 add Makefile deps
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@29 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
2004-01-01 19:32:48 +00:00
.cvsignore User is now prompted for their password twice at registration. 2003-12-31 18:14:07 +00:00
Bugs initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
COPYING initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
Changelog update the Changelog 2003-12-30 23:40:21 +00:00
Makefile add Makefile deps 2004-01-01 19:32:48 +00:00
README Updated documentation in README to save us time in the future. 2004-01-01 19:02:17 +00:00
TODO Updated documentation in README to save us time in the future. 2004-01-01 19:02:17 +00:00
dgamelaunch.c use strchr instead of strstr where appropriate. oops. 2004-01-01 02:06:19 +00:00
dgamelaunch.h I renamed it to 'bannerfile', 'banfile' is ambigous (perhaps for a future 2003-12-31 20:21:00 +00:00
dgl-banner I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
dgl-create-chroot I renamed it to 'bannerfile', 'banfile' is ambigous (perhaps for a future 2003-12-31 20:21:00 +00:00
dgl-default-rcfile initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
io.c I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
io.h initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
last_char_is.c I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
stripgfx.c I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
stripgfx.h initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
ttyplay.c I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
ttyrec.c I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
ttyrec.h I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00
virus.c I can't stand it anymore, reindenting with 2 spaces, 2003-12-31 19:47:49 +00:00

README

In short, there isn't an easy 'make install' option for this, as it
runs in a chroot environment and is somewhat specific to a server.

It should compile on most modern Linux distros, although there are
a couple things which do hinder total portability.

That said, it shouldn't be too hard to figure out most of the defines
in dgamelaunch.(c|h), and I'm more than happy to help out with any
questions.

Me:            M. Drew Streib <dtype@dtype.org>
Mailing list:  http://alt.org/mailman/listinfo/nethack/

BASIC SETUP INSTRUCTIONS
===========================

1) Setup a chroot area, with a bin directory, a var directory, and a
'dgldir' directory. You'll also need 'etc' and 'etc/terminfo' for
curses.

2) If using the #define's as an example, setup 'rcfiles', 'ttyrec',
and 'inprogress' directories, in the dgldir. Also touch the files
'dgl-login' and 'dgl-lock' in the main chroot directory.

3) Copy the dgl-banner and dgl-default-rcfile files into the main 
chroot directory  and optionally modify them. If these files aren't
available in the package simply touch the files in the main chroot
directory. 

Your directories/files should now look like this:

/chrootdir/bin/
/chrootdir/var/
/chrootdir/etc/
/chrootdir/etc/terminfo/
/chrootdir/dgldir/
/chrootdir/dgldir/ttyrec/
/chrootdir/dgldir/inprogress/
/chrootdir/dgldir/rcfiles/
/chrootdir/dgl-login (empty)
/chrootdir/dgl-lock (empty)
/chrootdir/dgl-banner
/chrootdir/dgl-default-rcfile

They should all be owned by the user you intend to run this as.

2) In the #define's in dgamelaunch.c and dgamelaunch.h, change the
values for those directories, sort of using my own directory setup
as an example.

3) Compile nethack, and basically tell it that /var is its playground,
since it will be in the chroot environment. There should be no need
for special nethack compilation instructions, but it will need to be 
installed to the chroot environment. A static compile will ensure that
it can run without any libraries, or you can of course place libraries
in the environment.

For security reasons, I'd avoid putting any shells, etc, in this environment
though, of course. Just whatever needs to be exec'd, which is namely,
nethack.

4) Be sure to set the user id's in the #define's of dgamelaunch to
the owner of the chroot directory, so nethack and dgamelaunch have
access to their files. This user needs a lot of write access, but
you can leave the executables owned by someone else.

5) Either setup dgamelaunch as the shell for a single login, in which
case it must be suid root (don't worry. It sheds privs right after the
immediate chroot), or set it up as an inetd service. I use the following
lines for my xinetd.conf.

service telnet
{
  socket_type     = stream
  protocol  = tcp
  wait      = no
  user      = root
  server    = /usr/sbin/in.telnetd
  server_args     = -L /opt/nethack/nethack.dtype.org/dgamelaunch
  rlimit_cpu      = 3600
  bind      = 64.71.163.206
}

6) Populate /chrootdir/etc/terminfo with terminfo files. I think that most
modern ncurses will default to terminfo when it is available. Mine seemed
to. This also makes it easy to add term types on the fly.

7) You can test your compilation of dgamelaunch by simply running
it as root, just as a shell (with suid) or inetd might do.