Annotation of dgamelaunch-openbsd/README, Revision 1.5
1.3 rubenllo 1: dgamelaunch-openbsd
2: ===================
1.1 rubenllo 3:
4: dgamelaunch is a network-based game shell where anyone can sign up for an
5: account and start playing any game which suits your fancy - games known to
6: work with dgamelaunch are for example NetHack (http://www.nethack.org) and
7: Crawl (http://crawl.develz.org).
8:
1.3 rubenllo 9: WARNING: This version of dgamelaunch in intended to run on OpenBSD, leveraging
10: its capabilities. It is still a work in progress.
1.1 rubenllo 11:
12: DGAMELAUNCH VERSIONS
13: ====================
14:
1.3 rubenllo 15: Development version can be fetched from the source repository with cvs:
1.1 rubenllo 16:
1.3 rubenllo 17: cvs -d :extssh:anoncvs@operationalsecurity.es:/cvs checkout -P
18: dgamelaunch-openbsd
1.1 rubenllo 19:
1.3 rubenllo 20: Releases are downloadable at gopher://gopher.operationalsecurity.es/1/Software
1.1 rubenllo 21:
22:
23: REQUIREMENTS
24: ============
25:
26: - normal development tools (make, etc)
27: - autotools (autogen, autoconf, automake)
28: - ncurses library and development files
29: - bison (or yacc or byacc)
30: - flex (or lex)
31: - optionally sqlite3 library and development files
32:
33:
34: COMPILING
35: =========
36:
1.3 rubenllo 37: When compiling for OpenBSD, ensure the adecuate environment variables are set:
38:
39: export CC=cc
40: export CPATH=/usr/local/include
1.4 rubenllo 41: export LIBRARY_PATH=/usr/local/lib
1.3 rubenllo 42: export AUTOMAKE_VERSION=1.15
43: export AUTOCONF_VERSION=2.69
44:
1.1 rubenllo 45: Basically all you have to do is:
46:
1.4 rubenllo 47: ./autogen.sh && gmake
1.1 rubenllo 48:
49: Some options you might want give to autogen:
50:
51: --with-config-file=/absolute/path/to/dgamelaunch.config
52: --enable-sqlite
53:
1.3 rubenllo 54: WARNING: The current development build has only been tested with the options
55: above and may lead to unpredictable results if used with a different set of
56: options.
1.1 rubenllo 57:
1.3 rubenllo 58: Dgamelaunch should compile without issue on Linux, Solaris, OpenBSD, FreeBSD 4
59: and 5. (Whether it _runs_ on all of these platforms is a different issue. We'd
1.1 rubenllo 60: like to hear about it.)
61:
62: dgamelaunch was originally developed by M. Drew Streib <dtype@dtype.org> but
63: is now a collaborative project. Copyright and contact information is in the
64: COPYING file, included with this package.
65:
66: BASIC SETUP INSTRUCTIONS
67: ========================
68:
69: These instructions are not current. For a more up-to-date ones, see
70: http://nethackwiki.com/wiki/User:Paxed/HowTo_setup_dgamelaunch
71:
72: 1) Setup a chroot jail. There is a helpful script included to accomplish this,
73: called dgl-create-chroot, in the source directory. The default settings are
74: viewable by editing the script; to customize the installation, look at
75: dgl-create-chroot.conf.example.* (also in the source directory) and edit it to
76: suit your needs, and save it into the same directory as dgl-create-chroot as
77: dgl-create-chroot.conf. It's very likely you need to run the script as root.
78: The script will not work with the very limited System V /bin/sh, such found on
79: Solaris; start it with ksh instead.
80:
81: If you decide to not use dgl-create-chroot, you're on your own and we assume
82: you have enough clue to figure out exactly what's needed for the chroot to
83: operate correctly.
84:
85: 2) Compile nethack. Make sure the directories in the chroot match up with
86: where nethack thinks everything is. You may need to edit the VAR_PLAYGROUND
87: variable in include/unixconf.h and/or the HACKDIR variable in include/config.h.
88:
89: (Note: Try not to, for security, to put anything else in the chroot. You may
90: need to put gzip in there though if you compile nethack to use it for
91: compression.)
92:
93: 3) Make a copy of dgamelaunch.conf and edit it. This will contain information
94: for dgamelaunch about what uid/username, gid/group to shed privileges to at
95: runtime. It must also contain the path to nethack, and needs to know certain
96: aspects of your chroot.
97:
98: Note that using a username in dgamelaunch.conf will cause (part of) your
99: passwd database to be loaded into dgamelaunch's memory space. If you use BSD,
100: this will also include encrypted passwords. Therefore, it's recommended to
101: put the uid in the dgamelaunch.conf. The same applies to groups, but openpty(3)
102: often looks up the tty group anyway.
103:
104: 4) Setup dgamelaunch as one of the following:
105: a) The shell for a single login.
106: b) An (x)inetd service.
107:
108: If you choose a login shell make sure dgamelaunch is setuid root. (that is,
109: chmod 4755 dgamelaunch.) It will shed privs right after entering the chroot
110: jail though.
111:
112: Example xinetd lines:
113:
114: service telnet
115: {
116: socket_type = stream
117: protocol = tcp
118: wait = no
119: user = root
120: server = /usr/sbin/in.telnetd
121: server_args = -h -L /opt/nethack/nethack.dtype.org/dgamelaunch -q -f /etc/dgamelaunch.conf
122: rlimit_cpu = 3600
123: bind = 64.71.163.206
124: }
125:
126: A classic inetd line would look like this:
127:
128: telnet stream tcp nowait root.root /usr/sbin/tcpd /usr/sbin/in.telnetd -h -L /usr/sbin/dgamelaunch -q -f /etc/dgamelaunch.conf
129:
130: In both cases, the -L specifies an alternate login program (telnetlogin is
131: invoked by default) and -h prevents revealing of a login banner (for
132: example, "Debian GNU/Linux testing/unstable influx") before starting the
133: login shell.
134:
135: It goes without saying that the argument after -L must point to dgamelaunch's
136: exact location. Also, the location of dgamelaunch.conf is variable and of
137: course should be customized by you.
138:
139: NOTE: It appears that the -L option is not very widely supported. FreeBSD's
140: telnetd uses -p instead, and you can't give arguments (arguments appropriate
141: to standard login are used). Some other telnetds do not support anything
142: like this at all.
143:
144: The -f option, followed by a filename, specifies the path to the config file
145: to use for dgamelaunch. If you specify the right path for DEFCONFIG in the
146: Makefile, you may be able to omit this.
147:
148: For dgamelaunch, the -q option will silence errors pertaining to the server
149: configuration. This is recommended for use within inetd to prevent spamming
150: the clients, but when testing and setting up we strongly suggest you leave it
151: off until running dgamelaunch produces no error output on stderr.
152:
153: 5) Test your compilation of dgamelaunch by running it as root. If this
154: works, a shell login or (x)inetd will work with the correct configuration.
155: If you have problems with dgamelaunch's display make sure that your chroot's
156: /etc/terminfo directory (or whatever directory your ncurses uses) is
157: populated.
158:
159:
160: COMMANDLINE PARAMETERS
161: ======================
162:
163: -a Ignored.
164: -c Shows error message and exits. (login shell command)
165: -e Ignored.
166: -h Ignored.
167: -i user Autologin and run the register -command hook for "user"
168: (with password "user").
169: -p Ignored.
170: -q Be quiet, suppress errors.
171: -s Show players currently playing.
172: -W user:msg Send message "msg" to all players. The message seems
173: to come from "user".
174: -S Free the shared memory block.
175: -D Show contents of the shared memory block.
176:
177:
178: ENVIRONMENT VARIABLES
179: =====================
180:
181: Linux telnetd allows importing the USER environment variables via telnet,
182: while FreeBSD does not. FreeBSD, on the other hand, does allow the LOGNAME
183: environment variable. Dgamelaunch will first check USER, then LOGNAME,
184: for "username:password", and tries autologin if either exists.
185: Dgamelaunch-specific DGLAUTH is checked before either of those.
186:
187:
188: ERROR CODES
189: ===========
190:
191: 1 Could not terminate stale processes
192: 2 Cannot chroot()
193: 3 Cannot chdir()
194: 4 Cannot setgroups()
195: 5 Cannot setgid()
196: 6 Cannot setuid()
197: 7 Caught HUP
198: 8 Cannot run as root: Config file has shed_user = "root"
199: 9 Cannot run as root: Config file has shed_user set to UID 0 user.
200: 10 Could not setup player
201: 11 Cannot run as root: Config file has shed_uid = 0
202: 12 Config file has an unrecognized token
203: 13 Config file: Negative value not accepted
204: 15 dgamelaunch called with -c (login shell command); exited
205: 20 No menu defined, or no banner found for menu
206: 60 Cannot create a new terminal, or no termcap files.
207: 61 Cannot openpty()
208: 62 Cannot open /dev/ptmx
209: 65 Cannot open master ptsname
210: 68 Cannot fcntl inprogress-lock
211: 70 Cannot write to inprogress-lock
212: 71 ftok() error for shm_key, no "dgamelaunch" file found?
213: 72 ftok() error for shm_sem_key, no "dgamelaunch" file found?
214: 73 shmget() error, cannot connect to shared memory
215: 74 smat() error, cannot attach to shared memory
216: 75 Nothing in shared memory?
217: 76 sem_init() error, could not initialize shared memory
218: 77 sem_wait() error
219: 78 sem_post() error
220: 95 Cannot fnctl lockfile
221: 96 sqlite3_open() failed when checking user existence: could not open login database
222: 97 sqlite3_open() failed in writefile()
223: 98 sqlite3_exec() failed in writefile()
224: 99 Could not open password file
225: 100 Username field too long in login file
226: 101 Email field too long in login file
227: 102 password field too long in login file
228: 103 env field too long in login file
229: 104 Cannot read config file
230: 105 Cannot read default config file
231: 106 Cannot open lockfile or password file
232: 107 fcntl failed on login database in writefile()
233: 108 sqlite3_exec() failed when checking user existence.
234: 109 Too many registered users. (see maxusers setting in config file)
235: 110 Login failed
236: 111 Two users trying to register at the same time
237: 112 Error changing password: cannot have ':' in password
238: 113 Error parsing configuration file
239: 114 exec-command fork failed
240: 115 could not read lock file in writefile()
241: 116 Too many registered users. (see maxusers setting in config file)
242: 117 wall error: no message to send
243: 118 wall error: no players
244: 119 User has a retarded terminal
245: 120 wall error: message too long
246: 121 wall error: "from" username is too short
247: 122 Error changing password: struct "me" does not exist
248: 123 chdir() failed in dgl commands.
249: 140 populate_games(): Cannot open inprogress-dir
250: 145 populate_games(): Inprogress-filename does not have ':' in it
251: 146 populate_games(): Inprogress-filename does not have ': in it (pt. 2)
252: 200 purge_stale_locks(): could not open inprogress-dir
253: 201 purge_stale_locks(): inprogress-file did not have ':' in it
254: 202 purge_stale_locks(): could not read inprogress-file
255: 203 purge_stale_locks(): could not get inprogress-file contents
1.3 rubenllo 256: 300 crypt_newhash(): failed to save password hash to allocated memory
1.5 ! rubenllo 257: 301 pledge(): failed to leverage OpenBSD's pledge()
CVSweb