If you have problems with dgamelaunch's display make sure that your chroot's
/etc/terminfo directory (or whatever directory your ncurses uses) is
populated.
+
+
+ERROR CODES
+===========
+
+ 1 Could not terminate stale processes
+ 2 Cannot chroot()
+ 3 Cannot chdir()
+ 4 Cannot setgroups()
+ 5 Cannot setgid()
+ 6 Cannot setuid()
+ 7 Caught HUP
+ 8 Cannot run as root: Config file has shed_user = "root"
+ 9 Cannot run as root: Config file has shed_user set to UID 0 user.
+ 10 Could not setup player
+ 11 Cannot run as root: Config file has shed_uid = 0
+ 12 Config file has an unrecognized token
+ 13 Config file: Negative value not accepted
+ 20 No menu defined, or no banner found for menu
+ 61 Cannot openpty()
+ 62 Cannot open /dev/ptmx
+ 65 Cannot open master ptsname
+ 68 Cannot fcntl inprogress-lock
+ 70 Cannot write to inprogress-lock
+ 71 ftok() error for shm_key, no "dgamelaunch" file found?
+ 72 ftok() error for shm_sem_key, no "dgamelaunch" file found?
+ 73 shmget() error, cannot connect to shared memory
+ 74 smat() error, cannot attach to shared memory
+ 75 Nothing in shared memory?
+ 76 sem_init() error, could not initialize shared memory
+ 77 sem_wait() error
+ 78 sem_post() error
+ 95 Cannot fnctl lockfile
+ 96 sqlite3_open() failed when checking user existence: could not open login database
+ 97 sqlite3_open() failed in writefile()
+ 98 sqlite3_exec() failed in writefile()
+ 99 Could not open password file
+ 100 Username field too long in login file
+ 101 Email field too long in login file
+ 102 password field too long in login file
+ 103 env field too long in login file
+ 104 Cannot read config file
+ 105 Cannot read default config file
+ 106 Cannot open lockfile or password file
+ 107 fcntl failed on login database in writefile()
+ 108 sqlite3_exec() failed when checking user existence.
+ 109 Too many registered users. (see maxusers setting in config file)
+ 110 Login failed
+ 111 Two users trying to register at the same time
+ 112 Error changing password: cannot have ':' in password
+ 113 Error parsing configuration file
+ 114 exec-command fork failed
+ 115 could not read lock file in writefile()
+ 116 Too many registered users. (see maxusers setting in config file)
+ 117 wall error: no message to send
+ 118 wall error: no players
+ 119 User has a retarded terminal
+ 120 wall error: message too long
+ 121 wall error: "from" username is too short
+ 122 Error changing password: struct "me" does not exist
+ 123 chdir() failed in dgl commands.
+ 140 populate_games(): Cannot open inprogress-dir
+ 145 populate_games(): Inprogress-filename does not have ':' in it
+ 146 populate_games(): Inprogress-filename does not have ': in it (pt. 2)
+ 200 purge_stale_locks(): could not open inprogress-dir
+ 201 purge_stale_locks(): inprogress-file did not have ':' in it
+ 202 purge_stale_locks(): could not read inprogress-file
+ 203 purge_stale_locks(): could not get inprogress-file contents
if (!strcmp($3, "root"))
{
fprintf(stderr, "%s:%d: I refuse to run as root! Aborting.\n", config, line);
- graceful_exit(1);
+ graceful_exit(8);
}
globalconfig.shed_user = strdup($3);
if ((usr = getpwnam($3)) != NULL)
else
{
fprintf(stderr, "%s:%d: I refuse to run as %s (uid 0!) Aborting.\n", config, line, $3);
- graceful_exit(1);
+ graceful_exit(9);
}
}
else
if ($3 == 0)
{
fprintf(stderr, "%s:%d: I refuse to run as uid 0 (root)! Aborting.\n", config, line);
- graceful_exit(1);
+ graceful_exit(11);
}
globalconfig.shed_uid = $3;
#ifdef HAVE_OPENPTY
if (openpty (&master, &slave, NULL, NULL, NULL) == -1) {
debug_write("cannot openpty");
- graceful_exit (62);
+ graceful_exit (61);
}
#else
if ((master = open ("/dev/ptmx", O_RDWR)) < 0) {
signals_release();
#endif
debug_write("catchup sighup");
- graceful_exit (2);
+ graceful_exit (7);
}
/* ************************************************************* */
}
if (fcntl (fileno (fpl), F_SETLKW, &fl) == -1) {
debug_write("cannot fcntl lockfile");
- graceful_exit (114);
+ graceful_exit (95);
}
}
b++;
if ((b - n) >= 1024) {
debug_write("env field too long");
- graceful_exit (102);
+ graceful_exit (103);
}
}
if (ret) {
sqlite3_close(db);
debug_write("sqlite3_open failed");
- graceful_exit(109);
+ graceful_exit(96);
}
if (userexist_tmp_me) {
{
signals_release();
debug_write("passwd file fopen failed");
- graceful_exit (104);
+ graceful_exit (99);
}
for (i = 0; i < f_num; i++)
if (ret) {
sqlite3_close(db);
debug_write("writefile sqlite3_open failed");
- graceful_exit(107);
+ graceful_exit(97);
}
sqlite3_busy_timeout(db, 10000);
if (ret != SQLITE_OK) {
sqlite3_close(db);
debug_write("writefile sqlite3_exec failed");
- graceful_exit(106);
+ graceful_exit(98);
}
sqlite3_close(db);
}
if (chroot (globalconfig.chroot))
{
perror ("cannot change root directory");
- graceful_exit (1);
+ graceful_exit (2);
}
if (chdir ("/"))
{
perror ("cannot chdir to root directory");
- graceful_exit (1);
+ graceful_exit (3);
}
/* shed privs. this is done immediately after chroot. */
if (setgroups (1, &globalconfig.shed_gid) == -1)
{
perror ("setgroups");
- graceful_exit (1);
+ graceful_exit (4);
}
if (setgid (globalconfig.shed_gid) == -1)
{
perror ("setgid");
- graceful_exit (1);
+ graceful_exit (5);
}
if (setuid (globalconfig.shed_uid) == -1)
{
perror ("setuid");
- graceful_exit (1);
+ graceful_exit (6);
}
}
}
else {
fprintf(stdout, "Setup of %s failed.\n", p);
- graceful_exit(1);
+ graceful_exit(10);
}
}
freebanner(&banner);
banner_var_free();
- graceful_exit (1);
+ graceful_exit (20);
return 1;
}