diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-26 01:04:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-26 01:04:47 +0000 |
commit | 959f20497708ba4bb64bbbeb7561b6cf694316ec (patch) | |
tree | fdffe8fd62b29a4aa2d461e4dccf9268bcf714d0 /games/adventure | |
parent | 729a9d7ceffba9e7e741540048479eed9907601e (diff) |
sync 0521
Diffstat (limited to 'games/adventure')
-rw-r--r-- | games/adventure/init.c | 7 | ||||
-rw-r--r-- | games/adventure/main.c | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/games/adventure/init.c b/games/adventure/init.c index 663e267fe63..e16daa943a9 100644 --- a/games/adventure/init.c +++ b/games/adventure/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.2 1995/03/21 12:05:04 cgd Exp $ */ +/* $NetBSD: init.c,v 1.3 1996/05/21 10:48:09 mrg Exp $ */ /*- * Copyright (c) 1993 @@ -42,13 +42,14 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93"; #else -static char rcsid[] = "$NetBSD: init.c,v 1.2 1995/03/21 12:05:04 cgd Exp $"; +static char rcsid[] = "$NetBSD: init.c,v 1.3 1996/05/21 10:48:09 mrg Exp $"; #endif #endif /* not lint */ /* Re-coding of advent in C: data initialization */ #include <sys/types.h> +#include <sys/signal.h> #include <stdio.h> #include "hdr.h" @@ -203,7 +204,7 @@ linkdata() /* secondary data manipulation */ trapdel() /* come here if he hits a del */ { delhit++; /* main checks, treats as QUIT */ - signal(2,trapdel); /* catch subsequent DELs */ + signal(SIGINT,trapdel); /* catch subsequent DELs */ } diff --git a/games/adventure/main.c b/games/adventure/main.c index 7bb25c2c1a4..ce502092b17 100644 --- a/games/adventure/main.c +++ b/games/adventure/main.c @@ -48,17 +48,17 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93"; #else -static char rcsid[] = "$NetBSD: main.c,v 1.3 1996/02/06 22:47:06 jtc Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.4 1996/05/21 10:48:07 mrg Exp $"; #endif #endif /* not lint */ /* Re-coding of advent in C: main program */ #include <sys/file.h> +#include <sys/signal.h> #include <stdio.h> #include "hdr.h" - main(argc,argv) int argc; char **argv; @@ -68,8 +68,12 @@ char **argv; struct text *kk; extern trapdel(); + /* adventure doesn't need setuid-ness, so, just get rid of it */ + if (setuid(getuid()) < 0) + perror("setuid"); + init(); /* Initialize everything */ - signal(2,trapdel); + signal(SIGINT,trapdel); if (argc > 1) /* Restore file specified */ { /* Restart is label 8305 (Fortran) */ |