b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
48cef29504b1ffc0df9929f2d8b2af2ad74d2b4a |
|
08-Jan-2016 |
Vito Caputo <vito.caputo@coreos.com> |
journal: normalize priority of logging sources
The stream event source has a priority of SD_EVENT_PRIORITY_NORMAL+5,
and stdout source +10, but the native and syslog event sources are left
at the default of 0.
As a result, any heavy native or syslog logger can cause starvation of
the other loggers. This is trivially demonstrated by running:
dd if=/dev/urandom bs=8k | od | systemd-cat & # native spammer
systemd-run echo hello & # stream logger
journalctl --follow --output=verbose --no-pager --identifier=echo &
... and wait, and wait, the "hello" never comes.
Now kill %1, "hello" arrives finally. |
6355e75610a8d47fc3ba5ab8bd442172a2cfe574 |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
selinux: split up mac_selinux_have() from mac_selinux_use()
Let's distuingish the cases where our code takes an active role in
selinux management, or just passively reports whatever selinux
properties are set.
mac_selinux_have() now checks whether selinux is around for the passive
stuff, and mac_selinux_use() for the active stuff. The latter checks the
former, plus also checks UID == 0, under the assumption that only when
we run priviliged selinux management really makes sense.
Fixes: #1941 |
1e603a482f57edb1fb863dbf23b868cf5854e004 |
|
10-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
journald: never accept fds from file systems with mandatory locking enabled
This is pretty much a work-around for a security vulnerability in
kernels that allow unprivileged user namespaces.
Fixes #1822. |
709f6e46a35ec492b70eb92943d82a8d838ce918 |
|
05-Nov-2015 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use the negative error codes returned by our functions
Our functions return negative error codes.
Do not rely on errno being set after calling our own functions. |
c3753458fc30f35b7c2d2c5d5873198cd18131d8 |
|
05-Nov-2015 |
Michal Schmidt <mschmidt@redhat.com> |
journal: fix incorrect errno reporting
pread() returns -1 on error and sets errno. Do not use the -1 as errno. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
afc5dbf37fd2399d37976388d9dd9ab470ecf446 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
io-util.h: move iovec stuff from macro.h to io-util.h |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
1f6b411372076426c0faf0bb350437fb4d82931f |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: update empty-if coccinelle script to cover empty-while and more
Let's also clean up single-line while and for blocks. |
4a61c3e51e96a747c30598d78ee3a24e7c569e9f |
|
13-Apr-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: use (void) to silence coverity
This shouldn't really fail and anyway not much we can do about it.
CID #996292, #996294, #996295. |
8531ae707d4d0203e83304d4af948b8169a5fce1 |
|
05-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
journald: prefix exported calls with "server_", unexport unnecessary calls |
92ee6447b1deef7c79962a8121fdf8e58acb3a83 |
|
26-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journald: always allocate space for object fields
If OBJECT_PID= came as the last field, we would not reallocate the iovec to bigger size,
and fail the assertion later on in dispatch_message_real(). |
12a717f8347f3daf0ae46a2b71c7d011d9c12fea |
|
26-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journald: fix off by one in native transport
https://bugzilla.redhat.com/show_bug.cgi?id=1177184 |
ae6c3cc009a21df4b51851fb8fe3fde0b7d6d8f0 |
|
12-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
util: when using basename() for creating temporary files, verify the resulting name is actually valid
Also, rename filename_is_safe() to filename_is_valid(), since it
actually does a full validation for what the kernel will accept as file
name, it's not just a heuristic. |
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications". |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
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. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
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(). |
3b3154df7e2773332bb814e167187367a0ccae4a |
|
03-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
journald: constify all things! |
a09abc4ae0bdc0200324eaa0416f23ff2170ec4e |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
memfd: rename memfd.h to memfd-util.h to avoid any confusion with any libc provided headers |
73843b52585d42cc1a970a1c664818ece6942e9e |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
memfd: always use our internal utility functions where we have them |
c79e98eadd3056a36a662699fa650db5b1bca0c3 |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
journal: when sending huge log messages prefer memfds over temporary files in /dev/shm
Previously when a log message grew beyond the maximum AF_UNIX/SOCK_DGRAM
datagram limit we'd send an fd to a deleted file in /dev/shm instead.
Because the sender could still modify the file after delivery we had to
immediately copy the data on the receiving side.
With memfds we can optimize this logic, and also remove the dependency
on /dev/shm: simply send a sealed memfd around, and if we detect the
seal memory map the fd and use it directly. |
6baa7db00812437bbc87e73faa1a11b6cf631958 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention |
8c0b803b97bb0ee6603d9be85fb6b69cd6081eaf |
|
05-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
journald: remove redundant newlines |
a174f94d529c7ae9be589867308b669ec9b4dcc0 |
|
05-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
journald: properly sum up entry size counter
We should read the entry size before moving to the next iovec, not
after. |
fa1c4b518ec7d8ec2d647213ee651cde4d6c9d7e |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Fix misuse of uint64_t as size_t
They have different size on 32 bit, so they are really not interchangable. |
f7a5bb2842037fa27dbc99d92c3fee7fe1bbbc2a |
|
19-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Small modernizations |
6b9732b2bf0499c5e4ea8a9d4f6051d98033f680 |
|
19-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Be more verbose when bind or listen fails
Also be more verbose in devnode_acl_all(). |
874bc134ac6504c45e94174e37af13ff21a6bfe2 |
|
16-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Clear up confusion wrt. ENTRY_SIZE_MAX and DATA_SIZE_MAX
Define DATA_SIZE_MAX to mean the maximum size of a single
field, and ENTRY_SIZE_MAX to mean the size of the whole
entry, with some rough calculation of overhead over the payload.
Check if entries are not too big when processing native journal
messages. |
d18d46ecea80a7f07415edb9264af6a254fd70bb |
|
17-Mar-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: export valid_user_field and size defines
In preparation for use elsewhere. |
40b71e89bae4e51768db4dc50ec64c1e9c96eec4 |
|
14-Mar-2014 |
Sebastian Thorarensen <sebth@naju.se> |
journald: add support for wall forwarding
This will let journald forward logs as messages sent to all logged in
users (like wall).
Two options are added:
* ForwardToWall (default yes)
* MaxLevelWall (default emerg)
'ForwardToWall' is overridable by kernel command line option
'systemd.journald.forward_to_wall'.
This is used to emulate the traditional syslogd behaviour of sending
emergency messages to all logged in users. |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
f9a810bedacf1da7c505c1786a2416d592665926 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: port to sd-event and enable watchdog support |
d682b3a7e7c7c2941a4d3e193f1e330dbc9fae89 |
|
10-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
security: rework selinux, smack, ima, apparmor detection logic
Always cache the results, and bypass low-level security calls when the
respective subsystem is not enabled. |
2a0e0692565f0435657c93498e09cbb2d3517152 |
|
22-Aug-2013 |
Shawn Landden <shawnlandden@gmail.com> |
remove hasprefix(), use startswith() |
968f319679d9069af037240d0c3bcd126181cdac |
|
21-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: allow callers to specify OBJECT_PID=
When journald encounters a message with OBJECT_PID= set
coming from a priviledged process (UID==0), additional fields
will be added to the message:
OBJECT_UID=,
OBJECT_GID=,
OBJECT_COMM=,
OBJECT_EXE=,
OBJECT_CMDLINE=,
OBJECT_AUDIT_SESSION=,
OBJECT_AUDIT_LOGINUID=,
OBJECT_SYSTEMD_CGROUP=,
OBJECT_SYSTEMD_SESSION=,
OBJECT_SYSTEMD_OWNER_UID=,
OBJECT_SYSTEMD_UNIT= or OBJECT_SYSTEMD_USER_UNIT=.
This is for other logging daemons, like setroubleshoot, to be able to
augment their logs with data about the process.
https://bugzilla.redhat.com/show_bug.cgi?id=951627 |
fd59d9f29838c3888168554c774003e7ad6d33b0 |
|
21-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add hasprefix macro to check prefixes of fixed length |
f6422def2c10aa0dea1b872d2f187853e61bd015 |
|
16-Apr-2013 |
Michal Schmidt <mschmidt@redhat.com> |
journal: fix off-by-one error in native message iovec counting
Thanks to Cristian Ciupitu for a reproducer.
https://bugzilla.redhat.com/show_bug.cgi?id=924359 |
c4aa09b06f835c91cea9e021df4c3605cff2318d |
|
08-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: bring max coredump size in sync with max entry size |
be2155ce705c1c1a25fa5b2927e2e02f4b3c7a35 |
|
23-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: fix SO_PASSSEC invocation
Spotted by Lukas Nykryn |
d025f1e4dca8fc1436aff76f9e6185fe3e728daa |
|
14-Nov-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
build-sys: store journald code in a noinst library
The point is to allow the use of journald functions by other binaries.
Before, journald code was split into multiple files (journald-*.[ch]),
but all those files all required functions from journald.c. And
journald.c has its own main(). Now, it is possible to link against
those functions, e.g. from test binaries.
This constitutes a fix for https://bugzilla.redhat.com/show_bug.cgi?id=872638.
The patch does the following:
1. rename journald.h to journald-server.h and move corresponding code
to journald-server.c.
2. add journald-server.c and other journald-*.c parts to
libsystemd-journal-internal.
3. remove journald-syslog.c from test_journal_syslog_SOURCES, since
it is now contained in libsystemd-journal-internal.
There are no code changes, apart from the removal of a few static's,
to allow function calls between files. |
0b507b17a760b21e33fc52ff377db6aa5086c680 |
|
03-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
dbus: add some more safety checks before accepting data from bus clients |
1dfa7e79a60de680086b1d93fcc3629b463f58bd |
|
03-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
journald: only accept fds from certain directories |
505b6a61c22d5565e9308045c7b9bf79f7d0517e |
|
19-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journald: don't accept arbitrarily sized journal data fields
https://bugzilla.redhat.com/show_bug.cgi?id=858746 |
4871690d9e32608bbd9b18505b5326c2079c9690 |
|
24-Aug-2012 |
Allin Cottrell <cottrell@wfu.edu> |
journald: add missing includes |
0153028ae379eb7c9a463c548ef73ea392c6cdb0 |
|
22-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journald: split off native protocol support into its own .c file |