Commit Graph

352 Commits

Author SHA1 Message Date
Joachim Nilsson
8f66822b2a Check for getprogname() et al, and use config.h for #ifndefs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 10:55:52 +01:00
Joachim Nilsson
ad70b49790 Minor, whitspace alignment
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 06:21:50 +01:00
Joachim Nilsson
17f43903b6 Document how to use -lsyslog
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 06:00:18 +01:00
Joachim Nilsson
30d26f1d6d Add RFC flair to logo
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 00:51:54 +01:00
Joachim Nilsson
8101365ecf Minor adjustment to top
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 22:31:16 +01:00
Joachim Nilsson
b55dc9d37d Adjust logo, add RFCs on the right hand side
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 22:28:52 +01:00
Joachim Nilsson
1bc8e9f366 Fix spacing
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 22:24:16 +01:00
Joachim Nilsson
781a5cd246 Prototype logo ...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 22:23:01 +01:00
Joachim Nilsson
024dde00c2 Remove unused files
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 21:14:45 +01:00
Joachim Nilsson
eb37e7a20c docs/: Add help for contributors and a code of conduct for project
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 21:10:34 +01:00
Joachim Nilsson
c35f4de7fc Travis-CI: Build all test programs as regular user, or clang fails
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:52:37 +01:00
Joachim Nilsson
dca48d8b7d test: Extend API test with three more phases
- with/without openlog()
- setlogmask()
- syslogp() API

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:51:39 +01:00
Joachim Nilsson
f07d00f910 test: Enable syslogd debug mode, log in test/start.log
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:51:02 +01:00
Joachim Nilsson
11a16e16b8 syslogd: Strip whitespace in rule between action and option
Terminate action filename/pipe/host so we don't get any trailing tab or
space character in file or host names.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:48:22 +01:00
Joachim Nilsson
ff27d39cca syslogd: Fix double free() warning after SIGHUP
This cleanup section has moved to *after* cfparse()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:47:54 +01:00
Joachim Nilsson
07475f60a1 Travis-CI: Disable silent build to figure out why clang goes missing
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 18:14:56 +01:00
Joachim Nilsson
94afe95a25 Travis-CI: Simplify build script, skip parallel build
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 18:07:19 +01:00
Joachim Nilsson
53a4ea735f Add Coverity badge
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:59:51 +01:00
Joachim Nilsson
10f904bf79 Travis-CI: Initial test with Coverity Scan
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:47:55 +01:00
Joachim Nilsson
7446255827 Silence autoconf, use an m4/ sub-directory for macros
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:30:59 +01:00
Joachim Nilsson
b2940cade1 Remove old Makefile, not needed anymore
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:30:12 +01:00
Joachim Nilsson
ea565153bc Remove last remnants of TESTING define
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:29:52 +01:00
Joachim Nilsson
ab621e189b Travis-CI: Debug automake + autoconf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:28:27 +01:00
Joachim Nilsson
3a825cf0da Update GPL license headers, wrong address for FSF
- Update last paragraph, with FSF address
- Drop gratuitous "this file is part of the sysklogd package"
- Fix indentation
- Update copyright years for my own contributions

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 17:21:06 +01:00
Joachim Nilsson
b1548e7c73 Add simple API test, syslog() no call to openlog()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 15:55:25 +01:00
Joachim Nilsson
c05956010c Make sure libsyslog.la, incl. strlcpy.o, is built with -fPIC
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 15:55:25 +01:00
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
cedff49662 Minor change to ingress
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:23:05 +01:00
Joachim Nilsson
8f582259d8 Document difference in log formats between RFC3164 and RFC5424
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:19:57 +01:00
Joachim Nilsson
d63b2e68f6 Update example syslog.conf with relevant and modern defaults
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:19:37 +01:00
Joachim Nilsson
cebec1202b Update man pages with new per-rule options and fix old paths
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:19:06 +01:00
Joachim Nilsson
84aa897628 Consolidate option parsing for syslog.conf rules
This patch changes the syntax for per-rule log rotation and makes it
possible to have enable log rotation and RFC5424 output formatting.

The new syntax looks like this:

    	EXPR		ACTION			;OPT,OPT,...

Example:

	*.notice	-/var/log/messages	;rotate=1M:5,RFC5424

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:15:05 +01:00
Joachim Nilsson
4066a1e9bf Add FreeBSD facilities: LOG_NTP, LOG_SECURITY, LOG_CONSOLE, ...
This patch is a major refactor of the priority and facility parsing in
syslogd.  The "new" facilities are taken from FreeBSD and are de facto
interpretations of facilities otherwise "reserved for system use", as
GLIBC syslog.h puts it.

___
... and LOG_CRON_SOL, but only for completness.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 08:21:44 +01:00
Joachim Nilsson
ff4f2cdb31 Replace homegrown PID file functions with std BSD pidfile()
- Import pidfile() v1.11 from OpenBSD and libite (-lite) project
- Import utimensat() replacement, for systems that don't have it
- Simplify syslogd and klogd program start and PID file creation
- Rip out -i and -I from klogd, uses old PID file functions, and
  they're only kill(1) wrappers anyway

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 21:03:28 +01:00
Joachim Nilsson
1236334c39 Fix some memory leaks, found by Valgrind
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 21:03:28 +01:00
Joachim Nilsson
8c0304a977 Remember to document libsyslog API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 14:14:12 +01:00
Joachim Nilsson
b0a3d5cdd9 Document new include /etc/syslog.d/*.conf support
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 14:13:34 +01:00
Joachim Nilsson
dc2e7c013c TODO before v2.0
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 11:49:43 +01:00
Joachim Nilsson
62c651a979 Adapt unit tests to leverage and test /etc/syslog.d/*.conf support
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 11:47:45 +01:00
Joachim Nilsson
917ef4ed1d Add support for include /etc/syslog.d/*.conf in /etc/syslog.conf
- Massive refactor of the .conf file parsing
- Add queue.h v1.43 from OpenBSD, has _SAFE versions unlike GLIBC queue.h
- Use queue.h list macros instead of homegrown linked list
- Adopt NetBSD reconf style; on failure to reload keep old config

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 11:46:29 +01:00
Joachim Nilsson
ddaa0a1a82 Factor out ConfFile parsing to separate function
Also, fix segfault when syslogd is started without a .conf file.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 19:37:37 +01:00
Joachim Nilsson
c6a19049dc Trim remote test, restore startup/log sleep 2
Even on my laptop it sometimes takes a bit too long for tshark to start
up and syslogd to actually FWD the $MSG to remote.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 12:07:52 +01:00
Joachim Nilsson
3ef86e98b1 Import NetBSD syslog.3 v1.33 as syslogp.3
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 11:00:15 +01:00
Joachim Nilsson
892ee80e59 Trim test times now that we've fixed the root cause on Travis-CI
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:52:27 +01:00
Joachim Nilsson
3f5ae0e861 Travis-CI: Run test suite as super user, avoid sudo from within test
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:46:49 +01:00
Joachim Nilsson
1c14168558 Travis-CI: Require sudo to be able to run tshark on loopback
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:43:08 +01:00
Joachim Nilsson
cd7d2ca0be sudo do what I mean
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:35:19 +01:00
Joachim Nilsson
ef00787c5c Show any errors from tshark/tcpdump in error log
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:15:01 +01:00
Joachim Nilsson
aad95082fb Drop -fno-strength-reduce from default CFLAGS not supported by Clang
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:13:36 +01:00
Joachim Nilsson
ba9e494db2 Travis-CI: Debug networking capabilities
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:09:46 +01:00