Commit Graph

9 Commits

Author SHA1 Message Date
Joachim Nilsson
54edca09d9 syslogd: Close open UNIX and inet sockets on SIGTERM
When creating Inet sockets we may get multiple struct addrinfo records.
With this patch we support up to 16 records per Internet peer.  When
closing we iterate over all peers and all records.

Refactor socket_close() to clean up any lingering socket path when
closing UNIX socket.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-13 19:11:34 +01:00
Joachim Nilsson
6350bf2474 syslogd: Fix invalid free(), found by Valgrind
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-13 18:44:01 +01:00
Joachim Nilsson
0555e0989f Fix suspicius code for allocating a sockaddr_un to a sockaddr ptr
Remarked on by Coverity Scan.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-13 08:14:48 +01:00
Joachim Nilsson
823bb4cf2a Support for building the project w/o separate klogd (default)
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 16:42:44 +01:00
Joachim Nilsson
2f72a17b8e syslogd: If system has SO_REUSEPORT, use it
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 13:28:02 +01:00
Joachim Nilsson
f606667038 syslogd: Add support for FreeBSD -s, secure mode
- Update man page
- Enable -s in default systemd service settings
- Add support for SecureMode, with shutdown()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 13:28:02 +01:00
Joachim Nilsson
07677c78a5 Graft struct addrinfo support on top of new socket API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 13:28:01 +01:00
Joachim Nilsson
c66411e8c2 Use new log macros and err.h fns
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 08:56:06 +01:00
Joachim Nilsson
90fb520c06 Add socket helper functions from SMCRoute, licesened as 3-clause BSD
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-10 11:22:14 +01:00