Commit graph

14 commits

Author SHA1 Message Date
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