diff options
-rw-r--r-- | usr.sbin/cron/cron.c | 4 | ||||
-rw-r--r-- | usr.sbin/moused/moused.c | 10 | ||||
-rw-r--r-- | usr.sbin/pppoe/client.c | 4 | ||||
-rw-r--r-- | usr.sbin/rbootd/rbootd.c | 9 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 9 | ||||
-rw-r--r-- | usr.sbin/tcpdump/tcpdump.c | 5 |
6 files changed, 25 insertions, 16 deletions
diff --git a/usr.sbin/cron/cron.c b/usr.sbin/cron/cron.c index 19d7a9813af..59ab8b33b07 100644 --- a/usr.sbin/cron/cron.c +++ b/usr.sbin/cron/cron.c @@ -16,7 +16,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: cron.c,v 1.8 2000/09/15 07:13:50 deraadt Exp $"; +static char rcsid[] = "$Id: cron.c,v 1.9 2001/01/19 17:53:12 deraadt Exp $"; #endif @@ -352,6 +352,7 @@ sigchld_handler(x) { #else pid = wait3(&waiter, WNOHANG, (struct rusage *)0); #endif + /* XXX unsafe */ switch (pid) { case -1: Debug(DPROC, @@ -378,6 +379,7 @@ static void sighup_handler(x) { int save_errno = errno; + /* XXX unsafe */ log_close(); errno = save_errno; } diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index d23a5af153c..188752d328c 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -413,6 +413,7 @@ freedev(int sig) * own purpose. */ close(mouse.mfd); + mouse.mfd = -1; sigpause(0); errno = save_errno; } @@ -424,12 +425,12 @@ opendev(int sig) { /* re-open the mouse device */ if ((mouse.mfd = open(mouse.portname, O_RDWR | O_NONBLOCK, 0)) == -1) { - logerr(1, "unable to open %s", mouse.portname); - exit(1); + logerr(1, "unable to open %s", mouse.portname); /* XXX race */ + _exit(1); } /* re-init the mouse */ mouse_init(); - longjmp(restart_env, 1); + longjmp(restart_env, 1); /* XXX signal/longjmp re-entrancy */ } static void @@ -438,7 +439,7 @@ cleanup(int sig) char moused_flag = MOUSED_OFF; ioctl(mouse.cfd, PCVT_MOUSED, &moused_flag); - exit(0); + _exit(0); } /* @@ -2045,7 +2046,6 @@ main(int argc, char **argv) signal(SIGINT , cleanup); signal(SIGQUIT, cleanup); signal(SIGTERM, cleanup); - signal(SIGKILL, cleanup); if ((mouse.mfd = open(mouse.portname, O_RDWR | O_NONBLOCK, 0)) == -1) logerr(1, "unable to open %s", mouse.portname); diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c index d0ed24ab813..d754f75bd2e 100644 --- a/usr.sbin/pppoe/client.c +++ b/usr.sbin/pppoe/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.8 2001/01/16 05:34:15 jason Exp $ */ +/* $OpenBSD: client.c,v 1.9 2001/01/19 17:53:17 deraadt Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -541,7 +541,7 @@ recv_padt(bfd, myea, rmea, eh, ph, len, pkt) return (0); } -static volatile int timer_alarm; +sig_atomic_t timer_alarm; static struct sigaction timer_oact; void diff --git a/usr.sbin/rbootd/rbootd.c b/usr.sbin/rbootd/rbootd.c index 502ddb13ca8..649d6e94680 100644 --- a/usr.sbin/rbootd/rbootd.c +++ b/usr.sbin/rbootd/rbootd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rbootd.c,v 1.6 2001/01/17 00:33:03 pjanzen Exp $ */ +/* $OpenBSD: rbootd.c,v 1.7 2001/01/19 17:53:18 deraadt Exp $ */ /* $NetBSD: rbootd.c,v 1.5 1995/10/06 05:12:17 thorpej Exp $ */ /* @@ -55,7 +55,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)rbootd.c 8.1 (Berkeley) 6/4/93";*/ -static char rcsid[] = "$OpenBSD: rbootd.c,v 1.6 2001/01/17 00:33:03 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: rbootd.c,v 1.7 2001/01/19 17:53:18 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -365,6 +365,7 @@ void Exit(sig) int sig; { + /* XXX race */ if (sig > 0) syslog(LOG_ERR, "going down on signal %d", sig); else @@ -394,6 +395,7 @@ void ReConfig(signo) int signo; { + /* XXX race */ syslog(LOG_NOTICE, "reconfiguring boot server"); FreeConns(); @@ -421,6 +423,8 @@ void DebugOff(signo) int signo; { + /* XXX race */ + if (DbgFp != NULL) (void) fclose(DbgFp); @@ -444,6 +448,7 @@ void DebugOn(signo) int signo; { + /* XXX race */ if (DbgFp == NULL) { if ((DbgFp = fopen(DbgFile, "w")) == NULL) syslog(LOG_ERR, "can't open debug file (%s)", DbgFile); diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index b0a396636e4..35d698c3752 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.38 2001/01/16 23:58:00 deraadt Exp $ */ +/* $OpenBSD: syslogd.c,v 1.39 2001/01/19 17:53:19 deraadt Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #else -static char rcsid[] = "$OpenBSD: syslogd.c,v 1.38 2001/01/16 23:58:00 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: syslogd.c,v 1.39 2001/01/19 17:53:19 deraadt Exp $"; #endif #endif /* not lint */ @@ -193,8 +193,9 @@ int Initialized = 0; /* set when we have initialized ourselves */ int MarkInterval = 20 * 60; /* interval between marks in seconds */ int MarkSeq = 0; /* mark sequence number */ -volatile int MarkSet; -volatile int WantDie; + +sig_atomic_t MarkSet; +sig_atomic_t WantDie; int SecureMode = 1; /* when true, speak only unix domain socks */ diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c index aa18d682f52..16d07f751e3 100644 --- a/usr.sbin/tcpdump/tcpdump.c +++ b/usr.sbin/tcpdump/tcpdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdump.c,v 1.20 2000/12/10 19:05:21 provos Exp $ */ +/* $OpenBSD: tcpdump.c,v 1.21 2001/01/19 17:53:19 deraadt Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -26,7 +26,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/tcpdump.c,v 1.20 2000/12/10 19:05:21 provos Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/tcpdump.c,v 1.21 2001/01/19 17:53:19 deraadt Exp $ (LBL)"; #endif /* @@ -387,6 +387,7 @@ cleanup(int signo) /* Can't print the summary if reading from a savefile */ if (pd != NULL && pcap_file(pd) == NULL) { + /* XXX unsafe */ (void)fflush(stdout); putc('\n', stderr); if (pcap_stats(pd, &stat) < 0) |