Commit Graph

27 Commits

Author SHA1 Message Date
Lennart Poettering d6f4302b66 journald: fix LOG_AUTH facility in audit code
Fixes: #2304
2016-01-26 14:42:04 +01:00
Lennart Poettering b5efdb8af4 util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
Lennart Poettering afc5dbf37f io-util.h: move iovec stuff from macro.h to io-util.h 2015-10-27 13:25:57 +01:00
Lennart Poettering e4e73a6325 util-lib: split out hex/dec/oct encoding/decoding into its own file 2015-10-27 13:25:55 +01:00
Lennart Poettering 3ffd4af220 util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over.
2015-10-25 13:19:18 +01:00
Lennart Poettering 07630cea1f util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.

This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.

Also touches a few unrelated include files.
2015-10-24 23:05:02 +02:00
Lennart Poettering ece174c543 tree-wide: drop {} from one-line if blocks
Patch via coccinelle.
2015-09-09 08:20:20 +02:00
Lennart Poettering 417a7fdc41 journald: handle more gracefully when bind() fails on audit sockets 2015-05-20 14:38:25 +02:00
Zbigniew Jędrzejewski-Szmek 8bb3626dac journal: use audit event names instead of numbers
<audit-1400> is replaced by AVC, etc.

A fallback mechanism is provided for unlisted event types.
Occasionally new types are added to the kernel, but not too often.

Add a simple "test", which simply prints the mapping.
2015-04-23 23:54:21 -04:00
Zbigniew Jędrzejewski-Szmek cd556b6ca8 journald: add syslog fields for audit messages
Audit messages would be displayed as "unknown[1]".

Also specify AUTH as facility... This seems to be the closest match
(/* security/authorization messages */).
2015-03-14 23:03:45 -04:00
Zbigniew Jędrzejewski-Szmek 1fa2f38f0f Assorted format fixes
Types used for pids and uids in various interfaces are unpredictable.
Too bad.
2015-01-22 01:14:52 -05:00
Lennart Poettering 8531ae707d journald: prefix exported calls with "server_", unexport unnecessary calls 2015-01-05 01:40:51 +01:00
Veres Lajos f131770b14 tree-wide: spelling fixes
https://github.com/vlajos/misspell_fixer

b6fdeb618c
Thanks to Torstein Husebo <torstein@huseboe.net>.
2014-12-30 20:07:04 -05:00
Michal Schmidt 4a62c710b6 treewide: another round of simplifications
Using the same scripts as in f647962d64 "treewide: yet more log_*_errno
+ return simplifications".
2014-11-28 19:57:32 +01:00
Michal Schmidt 56f64d9576 treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.

Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'

Plus some whitespace, linewrap, and indent adjustments.
2014-11-28 19:49:27 +01:00
Michal Schmidt 23bbb0de4e treewide: more log_*_errno + return simplifications 2014-11-28 18:24:30 +01:00
Michal Schmidt da927ba997 treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
2014-11-28 13:29:21 +01:00
Michal Schmidt 0a1beeb642 treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:

find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'

Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().
2014-11-28 12:04:41 +01:00
Lennart Poettering 124aff6251 journal: adjust audit log messages a bit 2014-11-06 14:21:10 +01:00
Lennart Poettering 25b3245fb4 journald: include audit message type number in MESSAGE= string 2014-11-04 01:00:50 +01:00
Lennart Poettering 9833a66c7e journal: also consider audit fields with '-' valid 2014-11-04 00:51:19 +01:00
Lennart Poettering 0b97208d8c journald: don't pass around SO_TIMESTAMP timestamp for audit, which we don't have anyway 2014-11-04 00:32:02 +01:00
Lennart Poettering 5034c7bcdf journald: suppress low-level audit text prefix in MESSAGE= field
Let's make the log output more readable, and the header can be
reconstructed in full from the other fields
2014-11-04 00:28:00 +01:00
Lennart Poettering 78fe420ff0 journald: properly decode audit's proctitle= field 2014-11-04 00:27:26 +01:00
Lennart Poettering 4d9ced9956 journald: enable audit in the kernel when initializing
Similar to auditd actually turn on auditing as we are starting. This way
we can operate entirely without auditd around.
2014-11-04 00:01:32 +01:00
Lennart Poettering 2b0073e1d2 journald: there's no point in turning on SO_TIMESTAMP for audit sockets, audit doesn't support timestamps anyway 2014-11-03 23:28:12 +01:00
Lennart Poettering 875c2e220e journald: if available pull audit messages from the kernel into journal logs 2014-11-03 21:51:28 +01:00