Go to file
Joshua Kwan 86fa150941 blah blah blha
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@8 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
2003-12-30 23:34:13 +00:00
.cvsignore blah blah blha 2003-12-30 23:34:13 +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 initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
Makefile Puts dgamelaunch in /usr/sbin 2003-12-30 22:58:55 +00:00
README initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
dgamelaunch.c Honor case in login name. Also fix ttyrec path, probably lost in 2003-12-30 23:33:58 +00:00
dgamelaunch.h make it pretty and make LOC_DGLROOT customizable to customize everything else 2003-12-30 22:41:35 +00:00
dgl-create-chroot Puts dgamelaunch in /usr/sbin 2003-12-30 22:58:55 +00:00
dgl-default-rcfile initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
io.c initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
io.h initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
last_char_is.c initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
stripgfx.c initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
stripgfx.h initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
ttyplay.c initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
ttyrec.c Honor case in login name. Also fix ttyrec path, probably lost in 2003-12-30 23:33:58 +00:00
ttyrec.h initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +00:00
virus.c initial commit of new dgamelaunch to CVS 2003-12-30 21:30:32 +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.

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)

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.