diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-05 09:51:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-05 09:51:14 +0000 |
commit | bd5703e2f8166b05c0b64920900e3121f8ae4063 (patch) | |
tree | 28b9321a7c9a824da8d166b7e1d05fb415bdc0ba /libexec | |
parent | bb15117655d43d4d96ee568fb49eae49a88916be (diff) |
more signal marks, and some syslog_r in handlers
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 8 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 16 |
2 files changed, 15 insertions, 9 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 1ec6ab95af2..ea8a0614168 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpcmd.y,v 1.24 2000/11/14 20:27:01 itojun Exp $ */ +/* $OpenBSD: ftpcmd.y,v 1.25 2001/11/05 09:51:13 deraadt Exp $ */ /* $NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $ */ /* @@ -47,7 +47,7 @@ #if 0 static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94"; #else -static char rcsid[] = "$OpenBSD: ftpcmd.y,v 1.24 2000/11/14 20:27:01 itojun Exp $"; +static char rcsid[] = "$OpenBSD: ftpcmd.y,v 1.25 2001/11/05 09:51:13 deraadt Exp $"; #endif #endif /* not lint */ @@ -1164,11 +1164,13 @@ void toolong(signo) int signo; { + struct syslog_data sdata = SYSLOG_DATA_INIT; + /* XXX signal races */ reply(421, "Timeout (%d seconds): closing control connection.", timeout); if (logging) - syslog(LOG_INFO, "User %s timed out after %d seconds", + syslog_r(LOG_INFO, &sdata, "User %s timed out after %d seconds", (pw ? pw -> pw_name : "unknown"), timeout); dologout(1); } diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 68f93e9e114..b035ad50078 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.105 2001/10/02 17:43:47 wilfried Exp $ */ +/* $OpenBSD: ftpd.c,v 1.106 2001/11/05 09:51:13 deraadt Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -73,7 +73,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94"; #else -static char rcsid[] = "$OpenBSD: ftpd.c,v 1.105 2001/10/02 17:43:47 wilfried Exp $"; +static char rcsid[] = "$OpenBSD: ftpd.c,v 1.106 2001/11/05 09:51:13 deraadt Exp $"; #endif #endif /* not lint */ @@ -620,21 +620,23 @@ static void lostconn(signo) int signo; { + struct syslog_data sdata = SYSLOG_DATA_INIT; sigprocmask(SIG_BLOCK, &allsigs, NULL); if (debug) - syslog(LOG_DEBUG, "lost connection"); - dologout(1); + syslog_r(LOG_DEBUG, &sdata, "lost connection"); + dologout(1); /* XXX signal race? */ } static void sigquit(signo) int signo; { + struct syslog_data sdata = SYSLOG_DATA_INIT; sigprocmask(SIG_BLOCK, &allsigs, NULL); - syslog(LOG_ERR, "got signal %s", sys_signame[signo]); - dologout(1); + syslog_r(LOG_ERR, &sdata, "got signal %s", sys_signame[signo]); + dologout(1); /* XXX signal race? */ } /* @@ -2112,6 +2114,8 @@ myoob(signo) char *cp; int save_errno = errno; + /* XXX signal races GALORE */ + /* only process if transfer occurring */ if (!transflag) return; |