Remove the old mkdir and chdir options to prevent lex collisions

with the commands mkdir and chdir


git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@395 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2008-01-01 18:13:54 +00:00
parent efcfb05f41
commit 4f95c35047
7 changed files with 14 additions and 29 deletions

View File

@ -69,8 +69,6 @@ COMMENT ^#.*
"game_name" { return TYPE_NAME_GAME; }
"short_name" { return TYPE_GAME_SHORT_NAME; }
"game_path" { return TYPE_PATH_GAME; }
"chdir" { return TYPE_PATH_CHDIR; }
"mkdir" { return TYPE_PATH_MKDIR; }
"dglroot" { return TYPE_PATH_DGLDIR; }
"spooldir" { return TYPE_PATH_SPOOL; }
"banner" { return TYPE_PATH_BANNER; }
@ -85,11 +83,11 @@ dglstart { yylval.i = DGLTIME_DGLSTART; return TYPE_CMDQUEUENAME; }
login { yylval.i = DGLTIME_LOGIN; return TYPE_CMDQUEUENAME; }
register { yylval.i = DGLTIME_REGISTER; return TYPE_CMDQUEUENAME; }
game_start { yylval.i = DGLTIME_GAMESTART; return TYPE_CMDQUEUENAME; }
cmdmkdir { yylval.i = DGLCMD_MKDIR; return TYPE_DGLCMD1; }
cmdchdir { yylval.i = DGLCMD_CHDIR; return TYPE_DGLCMD1; }
cmdcp { yylval.i = DGLCMD_CP; return TYPE_DGLCMD1; }
cmdunlink { yylval.i = DGLCMD_UNLINK; return TYPE_DGLCMD1; }
cmdsetenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; }
mkdir { yylval.i = DGLCMD_MKDIR; return TYPE_DGLCMD1; }
chdir { yylval.i = DGLCMD_CHDIR; return TYPE_DGLCMD1; }
cp { yylval.i = DGLCMD_CP; return TYPE_DGLCMD2; }
unlink { yylval.i = DGLCMD_UNLINK; return TYPE_DGLCMD1; }
setenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; }
DEFINE { return TYPE_DEFINE_GAME; }

View File

@ -33,7 +33,7 @@ static const char* lookup_token (int t);
}
%token TYPE_SUSER TYPE_SGROUP TYPE_SGID TYPE_SUID TYPE_MAX TYPE_MAXNICKLEN
%token TYPE_PATH_CHDIR TYPE_PATH_MKDIR TYPE_GAME_SHORT_NAME
%token TYPE_GAME_SHORT_NAME
%token TYPE_ALLOW_REGISTRATION
%token TYPE_PATH_GAME TYPE_NAME_GAME TYPE_PATH_DGLDIR TYPE_PATH_SPOOL
%token TYPE_PATH_BANNER TYPE_PATH_CANNED TYPE_PATH_CHROOT
@ -270,16 +270,6 @@ game_definition : TYPE_CMDQUEUE
myconfig[ncnf]->shortname = strdup($3);
break;
case TYPE_PATH_CHDIR:
if (myconfig[ncnf]->chdir) free(myconfig[ncnf]->chdir);
myconfig[ncnf]->chdir = strdup ($3);
break;
case TYPE_PATH_MKDIR:
if (myconfig[ncnf]->mkdir) free(myconfig[ncnf]->mkdir);
myconfig[ncnf]->mkdir = strdup ($3);
break;
case TYPE_RC_FMT:
if (myconfig[ncnf]->rc_fmt) free(myconfig[ncnf]->rc_fmt);
myconfig[ncnf]->rc_fmt = strdup($3);
@ -391,8 +381,6 @@ KeyType : TYPE_SUSER { $$ = TYPE_SUSER; }
| TYPE_PATH_GAME { $$ = TYPE_PATH_GAME; }
| TYPE_NAME_GAME { $$ = TYPE_NAME_GAME; }
| TYPE_GAME_SHORT_NAME { $$ = TYPE_GAME_SHORT_NAME; }
| TYPE_PATH_CHDIR { $$ = TYPE_PATH_CHDIR; }
| TYPE_PATH_MKDIR { $$ = TYPE_PATH_MKDIR; }
| TYPE_PATH_DGLDIR { $$ = TYPE_PATH_DGLDIR; }
| TYPE_PATH_SPOOL { $$ = TYPE_PATH_SPOOL; }
| TYPE_PATH_BANNER { $$ = TYPE_PATH_BANNER; }
@ -417,8 +405,6 @@ const char* lookup_token (int t)
case TYPE_MAX: return "maxusers";
case TYPE_MAXNICKLEN: return "maxnicklen";
case TYPE_PATH_CHROOT: return "chroot_path";
case TYPE_PATH_CHDIR: return "chdir";
case TYPE_PATH_MKDIR: return "mkdir";
case TYPE_PATH_GAME: return "game_path";
case TYPE_NAME_GAME: return "game_name";
case TYPE_ALLOW_REGISTRATION: return "allow_new_nicks";

View File

@ -2106,17 +2106,21 @@ main (int argc, char** argv)
myconfig[userchoice]->bin_args[i] = tmp;
}
/*
if (myconfig[userchoice]->mkdir) {
tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->mkdir));
free(myconfig[userchoice]->mkdir);
myconfig[userchoice]->mkdir = tmp;
}
*/
/*
if (myconfig[userchoice]->chdir) {
tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->chdir));
free(myconfig[userchoice]->chdir);
myconfig[userchoice]->chdir = tmp;
}
*/
/* launch program */
ttyrec_main (userchoice, me->username, gen_ttyrec_filename());

View File

@ -67,8 +67,6 @@ struct dg_config
char* game_path;
char* game_name;
char* shortname;
char* chdir;
char* mkdir;
char* rcfile;
char* spool;
/*char* savefilefmt;*/

View File

@ -22,8 +22,8 @@ struct dg_config defconfig = {
/* game_path = */ "/bin/nethack",
/* game_name = */ "NetHack",
/* shortname = */ "NH",
/* chdir = */ NULL,
/* mkdir = */ NULL,
/* chdir = */ /*NULL,*/
/* mkdir = */ /*NULL,*/
/* dglroot = *//* "/dgldir/",*/
/* lockfile = */ /*"/dgl-lock",*/
/* passwd = */ /*"/dgl-login",*/

View File

@ -165,7 +165,6 @@ game_path = "/bin/crawlss017"
game_name = "Crawl Stone Soup 0.1.7"
short_name = "Cr017"
chdir = "/crawlss017/"
game_args = "/bin/crawlss017"
game_args = "-name"
@ -197,8 +196,6 @@ game_path = "/bin/crawlss020"
game_name = "Crawl Stone Soup 0.2.0"
short_name = "Cr020"
mkdir = "/crawlss020/plr/%n"
chdir = "/crawlss020/"
game_args = "/bin/crawlss020"
game_args = "-name"

View File

@ -271,11 +271,13 @@ doshell (int game, char *username)
(void) dup2 (slave, 2);
(void) close (slave);
/*
if (myconfig[game]->mkdir)
(void) mkdir(myconfig[game]->mkdir, 0755);
if (myconfig[game]->chdir)
(void) chdir(myconfig[game]->chdir);
*/
execvp (myconfig[game]->game_path, myconfig[game]->bin_args);