summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2000-11-18 03:21:36 +0000
committerderaadt <deraadt@openbsd.org>2000-11-18 03:21:36 +0000
commit6d76091fe83852b4914074127857a233fcf7b5a7 (patch)
tree99aade64b78775eafdb7cc5517c99d3e2bba7827
parentUpdate list of algorithms (hshoexer@rommelwood.de) (diff)
downloadwireguard-openbsd-6d76091fe83852b4914074127857a233fcf7b5a7.tar.xz
wireguard-openbsd-6d76091fe83852b4914074127857a233fcf7b5a7.zip
avoid SIGHUP log issues, pr 1511, dean@bullock.net. It is still a signal
race, but I do not at the moment feel like rewriting a call to svc_run() to handle it syncronously ...
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/ypserv/ypserv/ypserv.c b/usr.sbin/ypserv/ypserv/ypserv.c
index c48cf6ecf4a..71ca31730f1 100644
--- a/usr.sbin/ypserv/ypserv/ypserv.c
+++ b/usr.sbin/ypserv/ypserv/ypserv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypserv.c,v 1.13 2000/06/28 23:58:48 deraadt Exp $ */
+/* $OpenBSD: ypserv.c,v 1.14 2000/11/18 03:21:36 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypserv.c,v 1.13 2000/06/28 23:58:48 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ypserv.c,v 1.14 2000/11/18 03:21:36 deraadt Exp $";
#endif
#include "yp.h"
@@ -521,9 +521,20 @@ sig_child()
errno = save_errno;
}
+/*
+ * XXX
+ * This is calling illegal functions inside a signal routine.
+ * It's a massive race.
+ */
void
sig_hup()
{
+ int save_errno = errno;
+
+ /* Handle the log. */
+ ypcloselog();
+ ypopenlog();
+
acl_reset();
if (aclfile != NULL) {
yplog("sig_hup: reread %s",aclfile);
@@ -532,4 +543,6 @@ sig_hup()
yplog("sig_hup: reread %s",YP_SECURENET_FILE);
(void)acl_securenet(YP_SECURENET_FILE);
}
+
+ errno = save_errno;
}