Commit Graph

12 Commits

Author SHA1 Message Date
Joachim Nilsson
fe3066f4c2 Connect to syslogd using SYSLOG_UNIX_PATH variable, if set
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 15:52:13 +01:00
Joachim Nilsson
ec9c92987f Add support for logger -u /tmp/foo to log to alternate socket
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 10:43:14 +01:00
Joachim Nilsson
176ba2d095 Support for logging to a file/stdout using syslog API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 09:08:37 +01:00
Joachim Nilsson
f6e17bd6b3 Update syslog.c, add syslog.h from NetBSD to get new syslogp() API
This patch merges the upstream NetBSD syslog.[ch], which adds syslogp()
family of APIs to support RFC5424.  This API will first go into use in
the logger tool, klogd, and syslog_tst, then it will also be exposed
as libsyslog and syslog/syslog.h for end-users.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-25 14:45:16 +02:00
Joachim Nilsson
6c23333feb Add wrapper for GLIBC __syslog_chk(), used for fortification
When a user links with syslog.c, or the future libsyslog, they may still
use the standard GLIBC header files.  GLIBC redirects syslog() to the
__syslog_chk() definition early on, but a user may not notice when a
simple non-optimized (-O0 or none) program is compiled.

This currently does not affect musl libc.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-24 10:51:04 +02:00
Joachim Nilsson
6fa899db38 Misc, initial cleanup of syslog testing framework
- Let syslog_tst.c use local syslog.c API, for wrapping
- Add -DTESTING to build of syslog_tst & C:o
- Enable CLOEXEC on each opened log file in syslog.c
- Simplify code for readability

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-24 10:51:04 +02:00
Joachim Nilsson
4fcebdb03c Add SPDX license identifiers to all source files, BSD-3 & GPL-2
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-13 12:07:38 +02:00
Joachim Nilsson
290c11d0d9 Sync. BSD license change with FreeBSD upstream
From upstream FreeBSD Subversion r165903:

  "Per Regents of the University of Calfornia letter,
   remove advertising clause."

This patch also includes the renumbering of the clauses, making
this codebase truly 3-clause BSD licensed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-13 11:35:42 +02:00
Joachim Nilsson
2e84a34758 Refctor, simplify return statements, no parenthesis needed
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-05 18:59:50 +02:00
Joachim Nilsson
f1f1ee3563 Reindent to Linux KNF
Most of the code base seemed to follow Linux style, loosely.  This patch
brings it all together.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-05 18:55:56 +02:00
Joachim Nilsson
53c4dd817d Fix archaic #include statements, for building with musl libc
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-05 16:51:13 +02:00
Joachim Nilsson
880cb2aa4d Relocate files to man/ and src/ and change to GNU configure & build
- Relocate all source files to src/ and manual pages to man/
- Replace static Makefile with GNU configure and build system

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-02 22:52:40 +02:00