diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-07-05 13:23:28 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-07-05 13:23:28 +0000 |
commit | 3112ad31b534467c30c48920e224740651f4d782 (patch) | |
tree | d0d616af51c8eaa299fa316f5040966f7da420d7 /usr.sbin/syslogd/syslogd.c | |
parent | 205b4ac8569f3af792739e7f936b4279714e1dc0 (diff) |
When syslogd(8) parent process terminates, the file cleanup code
did not work anymore. unveil(2) prevented removal. Cleaning the
UNIX domain sockets is not necessary. They are harmless and unlinked
before a new bind. So delete that functionality and convert global
to local variables. Providing /var/run/syslog.pid is a common
feature that should be kept. A stale pid file is confusing. So
add a constant path to unveil(2) to allow pid file removal.
OK deraadt@
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index b84454987d9..be63e9403c8 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.261 2019/07/02 13:17:27 bluhm Exp $ */ +/* $OpenBSD: syslogd.c,v 1.262 2019/07/05 13:23:27 bluhm Exp $ */ /* * Copyright (c) 2014-2017 Alexander Bluhm <bluhm@genua.de> @@ -215,8 +215,6 @@ char *TypeNames[] = { SIMPLEQ_HEAD(filed_list, filed) Files; struct filed consfile; -int nunix; /* Number of Unix domain sockets requested */ -char **path_unix; /* Paths to Unix domain sockets */ int Debug; /* debug flag */ int Foreground; /* run in foreground, instead of daemonizing */ char LocalHostName[HOST_NAME_MAX+1]; /* our hostname */ @@ -233,7 +231,6 @@ int NoDNS = 0; /* when true, refrain from doing DNS lookups */ int ZuluTime = 0; /* display date and time in UTC ISO format */ int IncludeHostname = 0; /* include RFC 3164 hostnames when forwarding */ int Family = PF_UNSPEC; /* protocol family, may disable IPv4 or IPv6 */ -char *path_ctlsock = NULL; /* Path to control socket */ struct tls *server_ctx; struct tls_config *client_config, *server_config; @@ -372,7 +369,8 @@ main(int argc, char *argv[]) int ch, i; int lockpipe[2] = { -1, -1}, pair[2], nullfd, fd; int fd_ctlsock, fd_klog, fd_sendsys, *fd_bind, *fd_listen; - int *fd_tls, *fd_unix, nbind, nlisten, ntls; + int *fd_tls, *fd_unix, nunix, nbind, nlisten, ntls; + char **path_unix, *path_ctlsock; char **bind_host, **bind_port, **listen_host, **listen_port; char *tls_hostport, **tls_host, **tls_port; @@ -386,6 +384,7 @@ main(int argc, char *argv[]) err(1, "malloc %s", _PATH_LOG); path_unix[0] = _PATH_LOG; nunix = 1; + path_ctlsock = NULL; bind_host = listen_host = tls_host = NULL; bind_port = listen_port = tls_port = NULL; |