From: deraadt Date: Thu, 19 Dec 1996 21:02:35 +0000 (+0000) Subject: toast shell escape code X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f30ed81a6ae2cce985201e4cbf7d13ef43e97a6c;p=openbsd toast shell escape code --- diff --git a/games/atc/input.c b/games/atc/input.c index b932d47f9eb..4eec8410001 100644 --- a/games/atc/input.c +++ b/games/atc/input.c @@ -64,7 +64,6 @@ static char rcsid[] = "$NetBSD: input.c,v 1.4 1995/04/27 21:22:24 mycroft Exp $" #define CRTOKEN '\r' #endif #define REDRAWTOKEN '\014' /* CTRL(L) */ -#define SHELLTOKEN '!' #define HELPTOKEN '?' #define ALPHATOKEN 256 #define NUMTOKEN 257 @@ -309,56 +308,8 @@ noise() gettoken() { - while ((tval = getAChar()) == REDRAWTOKEN || tval == SHELLTOKEN) + while ((tval = getAChar()) == REDRAWTOKEN) { - if (tval == SHELLTOKEN) - { -#ifdef BSD - struct itimerval itv; - itv.it_value.tv_sec = 0; - itv.it_value.tv_usec = 0; - setitimer(ITIMER_REAL, &itv, NULL); -#endif -#ifdef SYSV - int aval; - aval = alarm(0); -#endif - if (fork() == 0) /* child */ - { - char *shell, *base, *getenv(), *strrchr(); - - setuid(getuid()); /* turn off setuid bit */ - done_screen(); - - /* run user's favorite shell */ - if ((shell = getenv("SHELL")) != NULL) - { - base = strrchr(shell, '/'); - if (base == NULL) - base = shell; - else - base++; - execl(shell, base, 0); - } - else - execl(_PATH_BSHELL, "sh", 0); - - exit(0); /* oops */ - } - - wait(0); - tcsetattr(fileno(stdin), TCSADRAIN, &tty_new); -#ifdef BSD - itv.it_value.tv_sec = 0; - itv.it_value.tv_usec = 1; - itv.it_interval.tv_sec = sp->update_secs; - itv.it_interval.tv_usec = 0; - setitimer(ITIMER_REAL, &itv, NULL); -#endif -#ifdef SYSV - alarm(aval); -#endif - } redraw(); }