Lennart Poettering [Mon, 22 Oct 2018 16:06:06 +0000 (18:06 +0200)]
logind: sort includes
Lennart Poettering [Mon, 22 Oct 2018 14:52:57 +0000 (16:52 +0200)]
bootctl: display loader features in a pretty way.
Lennart Poettering [Mon, 22 Oct 2018 14:51:29 +0000 (16:51 +0200)]
util: force time multiplications to happen in longs
Lennart Poettering [Mon, 22 Oct 2018 14:37:10 +0000 (16:37 +0200)]
locale-util: add special glyph support for check marks/cross marks
Lennart Poettering [Mon, 22 Oct 2018 11:02:50 +0000 (13:02 +0200)]
logind: also expose bool prop on bus that declares whether we are on external power
The three core variables that affect idleness handling are whether we
are docked, whether we are on AC power and whether the lid is closed,
hence let's also expose the third variable on the bus, to make things
nicely debuggable.
Lennart Poettering [Mon, 22 Oct 2018 11:02:07 +0000 (13:02 +0200)]
logind: make sure that if we can't figure out whether we are on AC we presume we are
It's safer to assume that we are on AC than to assume we are on battery,
if we can't figure it out.
Lennart Poettering [Mon, 22 Oct 2018 10:47:44 +0000 (12:47 +0200)]
logind: don't claim that RebootToFirmwareSetup was constant
It's not, after all, that's what SetRebootToFirmware() is about.
(I was wondering for a moment whether to make this EMITS_CHANGES, but
decided against it, given that the flag actually can be changed
externally to logind too, and we couldn't send out notifications for
that.)
Lennart Poettering [Mon, 22 Oct 2018 10:41:34 +0000 (12:41 +0200)]
logind: expose a boolean on the bus explaining whether logind thinks the lid is closed
This copies how we already expose a "Docked" boolean the reflects
whether we are in a docking station or not.
Evgeny Vereshchagin [Fri, 16 Nov 2018 14:09:24 +0000 (17:09 +0300)]
tests: run fuzzers four times in a row (#10794)
This should help to catch issues that are easily detectable by
bad_build_check like the one being fixed in https://github.com/systemd/systemd/pull/10793,
which would totally break the build tomorrow if I hadn't run
`helper.py check_build` manually.
Lennart Poettering [Fri, 16 Nov 2018 12:00:40 +0000 (13:00 +0100)]
sd-bus: make strict asan shut up
asan doesn't like it if we use strndup() (i.e. a string function) on a
non-NULL terminated buffer (i.e. something that isn't really a string).
Let's hence use memdup_suffix0() instead of strndup(), which is more
appropriate for binary data that is to become a string.
Fixes: #10385
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:30:53 +0000 (14:30 +0100)]
Merge pull request #10795 from poettering/generator-fixes
trivial fixes to some generators
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:29:20 +0000 (14:29 +0100)]
Merge pull request #10796 from poettering/systemd-exit-service-fixes
units: corrections for systemd-exit.service
Lennart Poettering [Fri, 16 Nov 2018 11:46:30 +0000 (12:46 +0100)]
Merge pull request #10791 from keszybz/sd-event-get-enabled
Some minor tweaks for sd_event_source_get_enabled
Evgeny Vereshchagin [Fri, 16 Nov 2018 08:23:53 +0000 (09:23 +0100)]
test: initialize syslog_fd in fuzz-journald-kmsg too
This is a follow-up to
8857fb9beb9dcb that prevents the fuzzer from crashing with
```
==220==ERROR: AddressSanitizer: ABRT on unknown address 0x0000000000dc (pc 0x7ff4953c8428 bp 0x7ffcf66ec290 sp 0x7ffcf66ec128 T0)
SCARINESS: 10 (signal)
#0 0x7ff4953c8427 in gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35427)
#1 0x7ff4953ca029 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x37029)
#2 0x7ff49666503a in log_assert_failed_realm /work/build/../../src/systemd/src/basic/log.c:805:9
#3 0x7ff496614ecf in safe_close /work/build/../../src/systemd/src/basic/fd-util.c:66:17
#4 0x548806 in server_done /work/build/../../src/systemd/src/journal/journald-server.c:2064:9
#5 0x5349fa in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-journald-kmsg.c:26:9
#6 0x592755 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:571:15
#7 0x590627 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:480:3
#8 0x594432 in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:708:19
#9 0x5973c6 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:839:5
#10 0x574541 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:764:6
#11 0x5675fc in main /src/libfuzzer/FuzzerMain.cpp:20:10
#12 0x7ff4953b382f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#13 0x420f58 in _start (/out/fuzz-journald-kmsg+0x420f58)
```
Lennart Poettering [Fri, 16 Nov 2018 10:39:27 +0000 (11:39 +0100)]
units: fix Description= of systemd-exit.service
This file was probably copied from the --user version, let's use some
more appropriate wording for the --system version.
Lennart Poettering [Fri, 16 Nov 2018 10:35:59 +0000 (11:35 +0100)]
units: use correct command to exit
Otherwise we'll end a cyclic loop.
Lennart Poettering [Fri, 16 Nov 2018 10:34:47 +0000 (11:34 +0100)]
units: add the same ordering deps for systemd-exit.service as for systemd-poweroff.service and friends
This stuff runs in containers, and should really behave the same
everywhere.
Lennart Poettering [Fri, 16 Nov 2018 10:43:49 +0000 (11:43 +0100)]
core: show error code even when debug logging
Lennart Poettering [Thu, 15 Nov 2018 21:29:23 +0000 (22:29 +0100)]
hibernate-resume-generator: fix minor memory leak on error path
Lennart Poettering [Thu, 15 Nov 2018 21:28:58 +0000 (22:28 +0100)]
debug-generator: fix minor memory leak
Yu Watanabe [Fri, 16 Nov 2018 07:02:32 +0000 (16:02 +0900)]
udev-util: read resolve_names from udev.conf
Fixes CID#1396866.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 08:08:38 +0000 (09:08 +0100)]
Merge pull request #10788 from evverx/fuzz-kmsg
tests: add a fuzzer for dev_kmsg_record
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 07:54:36 +0000 (08:54 +0100)]
journal: simplify use of sd_event_source_get_enabled()
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 07:51:17 +0000 (08:51 +0100)]
journal-file: get rid of a helper variable
It doesn't really save much in code length. Having the event source named
explicitly makes it easier to understand the code at a glance.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 07:43:43 +0000 (08:43 +0100)]
sd-event: make sd_event_source_get_enabled return more info
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 06:37:59 +0000 (07:37 +0100)]
sd-event: do not use assert_return for something that is not an error
It's totally OK for description to be unset, so let's not log about this
even at debug level.
Evgeny Vereshchagin [Fri, 16 Nov 2018 06:33:02 +0000 (07:33 +0100)]
tests: add a reproducer for a heap-buffer-overflow fixed in
937b1171378bc1000a
Evgeny Vereshchagin [Fri, 16 Nov 2018 06:20:44 +0000 (07:20 +0100)]
tests: add a reproducer for a memory leak fixed in
30eddcd51b8a472e05d3b8d1 in August
Evgeny Vereshchagin [Fri, 16 Nov 2018 06:11:06 +0000 (07:11 +0100)]
journal: fix an off-by-one error in dev_kmsg_record
Evgeny Vereshchagin [Fri, 16 Nov 2018 06:05:29 +0000 (07:05 +0100)]
basic: remove an assertion from cunescape_one
The function takes a pointer to a random block of memory and
the length of that block. It shouldn't crash every time it sees
a zero byte at the beginning there.
This should help the dev-kmsg fuzzer to keep going.
Evgeny Vereshchagin [Thu, 15 Nov 2018 16:52:57 +0000 (17:52 +0100)]
tests: add a fuzzer for dev_kmsg_record
Yu Watanabe [Thu, 15 Nov 2018 09:46:23 +0000 (18:46 +0900)]
udev-rules: fix possible assertion
On 'remove' action, event->dev_db_clone is NULL. So, `IMPORT{db}` rule
on 'remove' action triggers assertion. This fixes the issue.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Nov 2018 16:03:33 +0000 (17:03 +0100)]
Revert "units: lock down logind with fs namespacing options"
Zbigniew Jędrzejewski-Szmek [Thu, 15 Nov 2018 13:50:07 +0000 (14:50 +0100)]
basic/json: silence gcc warning about limited range of data type
With gcc-7.1.1-3.fc26.aarch64:
../src/basic/json.c: In function ‘json_format’:
../src/basic/json.c:1409:40: warning: comparison is always true due to limited range of data type [-Wtype-limits]
if (*q >= 0 && *q < ' ')
^~
../src/basic/json.c: In function ‘inc_lines_columns’:
../src/basic/json.c:1762:31: warning: comparison is always true due to limited range of data type [-Wtype-limits]
} else if (*s >= 0 && *s < 127) /* Process ASCII chars quickly */
^~
Cast to (signed char) silences the warning, but a cast to (int) for some reason
doesn't.
Zbigniew Jędrzejewski-Szmek [Thu, 15 Nov 2018 11:47:17 +0000 (12:47 +0100)]
Merge pull request #10742 from poettering/c-utf8
default to C.UTF-8 locale, and many improvements to env var file parsing/kernel cmdline parsing
Lennart Poettering [Wed, 14 Nov 2018 19:09:39 +0000 (20:09 +0100)]
Merge pull request #10753 from keszybz/pager-no-interrupt
Add mode in journalctl where ^C is handled by the pager
Lennart Poettering [Wed, 14 Nov 2018 12:00:12 +0000 (13:00 +0100)]
core: drop dbus queue recursion check
We don't dispatch the queue recursively anymore, hence let's simplify
things a bit.
As pointed out by @fbuihuu:
https://github.com/systemd/systemd/pull/10763#discussion_r233209550
Lennart Poettering [Wed, 14 Nov 2018 16:22:18 +0000 (17:22 +0100)]
tests: add some tests for cmdline args containing spaces
Lennart Poettering [Mon, 12 Nov 2018 16:00:32 +0000 (17:00 +0100)]
update NEWS
Lennart Poettering [Mon, 12 Nov 2018 12:19:07 +0000 (13:19 +0100)]
update TODO
Lennart Poettering [Mon, 12 Nov 2018 15:50:58 +0000 (16:50 +0100)]
locale-util: introduce common helper locale_variables_free() for freeing locale variable arrays
Lennart Poettering [Mon, 12 Nov 2018 13:18:03 +0000 (14:18 +0100)]
fileio: automatically add NULL sentinel to parse_env_file()
Let's modernize things a bit.
Lennart Poettering [Mon, 12 Nov 2018 13:06:22 +0000 (14:06 +0100)]
localed: be more careful with the used types
Lennart Poettering [Mon, 12 Nov 2018 13:04:47 +0000 (14:04 +0100)]
fileio: drop "newline" parameter for env file parsers
Now that we don't (mis-)use the env file parser to parse kernel command
lines there's no need anymore to override the used newline character
set. Let's hence drop the argument and just "\n\r" always. This nicely
simplifies our code.
Lennart Poettering [Mon, 12 Nov 2018 12:49:20 +0000 (13:49 +0100)]
tree-wide: replace all remaining uses of parse_env_file() for parsing /proc/cmdline
Let's always go through the proc-cmdline.c APIs.
Lennart Poettering [Mon, 12 Nov 2018 12:23:51 +0000 (13:23 +0100)]
localed: no need to log twice about reload requests
Lennart Poettering [Mon, 12 Nov 2018 12:22:48 +0000 (13:22 +0100)]
localed: show proper bus error if we can in log message
Lennart Poettering [Mon, 12 Nov 2018 12:22:36 +0000 (13:22 +0100)]
localed: don't silently eat up errors, log something
Lennart Poettering [Mon, 12 Nov 2018 12:12:39 +0000 (13:12 +0100)]
locale-setup: default to C.UTF-8
Most distributions already were shipping a C.UTF-8 locale and even Fedora
now supports the C.UTF-8 locale, and there's clear indication that this
is going upstream too. Hence, let's default to it now too, if nothing
else is set.
Note that this is only a fallback if noting else is set, and since
distros generally configure a default for this behaviour shouldn't
really change in installed systems.
On new systems this makes vconsole.conf redundant.
Lennart Poettering [Mon, 12 Nov 2018 11:53:28 +0000 (12:53 +0100)]
locale-setup: rework to use new proc_cmdline_get_key_many() API
This way we use the same code to access /proc/cmdline as everywhere
else, and thus support it in containers and the SYSTEMD_PROC_CMDLINE env
var.
Lennart Poettering [Mon, 12 Nov 2018 11:51:23 +0000 (12:51 +0100)]
locale-setup: use precise type for locale variable iterator
Lennart Poettering [Mon, 12 Nov 2018 11:50:06 +0000 (12:50 +0100)]
locale-setup: use _cleanup_strv_free_
Lennart Poettering [Mon, 12 Nov 2018 11:41:23 +0000 (12:41 +0100)]
proc-cmdline: introduce new proc_cmdline_get_key_many() helper
This is like parse_env_file(), but from the kernel command line
Lennart Poettering [Mon, 12 Nov 2018 11:39:34 +0000 (12:39 +0100)]
proc-cmdline: split out rd. prefix handling in proc_cmdline_parse_given() and proc_cmdline_get_key()
This introduces a wrapper around extrac_first_word() called
proc_cmdline_extract_first(), which suppresses "rd." parameters
depending on the specified calls.
This allows us to share more code between proc_cmdline_parse_given() and
proc_cmdline_get_key(), and makes it easier to reuse this logic for
other purposes.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Nov 2018 15:57:33 +0000 (16:57 +0100)]
man: use <keycombo> more
Zbigniew Jędrzejewski-Szmek [Sun, 11 Nov 2018 18:04:00 +0000 (19:04 +0100)]
basic/pager: ignore ^C when piping to less and K is not set
Normally, we want to immediately quit on ^C. But when we are running under
less, people may set SYSTEMD_LESS without K, in which case they can use ^C to
communicate with less, and e.g. start and stop following input.
Fixes #6405.
Zbigniew Jędrzejewski-Szmek [Sun, 11 Nov 2018 17:43:44 +0000 (18:43 +0100)]
basic/cgroup-util: remove two unnecessary includes
Zbigniew Jędrzejewski-Szmek [Sun, 11 Nov 2018 17:39:39 +0000 (18:39 +0100)]
Move LONG_LINE_MAX definition to fileio.h
All users of the macro (except for one, in serialize.c), use the macro in
connection with read_line(), so they must include fileio.h. Let's not play
libc games and require multiple header file to be included for the most common
use of a function.
The removal of def.h includes is not exact. I mostly went over the commits that
switch over to use read_line() and add def.h at the same time and reverted the
addition of def.h in those files.
Zbigniew Jędrzejewski-Szmek [Sun, 11 Nov 2018 11:56:29 +0000 (12:56 +0100)]
basic/pager: convert the pager options to a flags argument
Pretty much everything uses just the first argument, and this doesn't make this
common pattern more complicated, but makes it simpler to pass multiple options.
Lennart Poettering [Mon, 12 Nov 2018 10:58:58 +0000 (11:58 +0100)]
proc-cmdline: turn flags parameter into a proper typedef'ed enum
Let's add some extra typesafety.
Lennart Poettering [Wed, 14 Nov 2018 15:21:14 +0000 (16:21 +0100)]
Merge pull request #10759 from keszybz/udevd-more-configuration
Udevd more configuration options
Evgeny Vereshchagin [Wed, 14 Nov 2018 09:38:59 +0000 (10:38 +0100)]
travis: use double the normal timeout in the ASan & UBSan stage
This should somewhat address https://github.com/systemd/systemd/issues/10696.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Nov 2018 11:47:56 +0000 (12:47 +0100)]
Merge pull request #10747 from poettering/machinectl-list-fix
properly acquire os-release file from containers
Zbigniew Jędrzejewski-Szmek [Wed, 14 Nov 2018 09:44:50 +0000 (10:44 +0100)]
Merge pull request #10763 from poettering/pending-reload-fix
when reloading, don't throttle unit/job dbus change signal generation
Yu Watanabe [Tue, 13 Nov 2018 00:05:59 +0000 (09:05 +0900)]
json: decrease DEPTH_MAX to 4k
This makes DEPTH_MAX lower value, as test-json fails with stack
overflow.
Note that the test can pass with 8k, but for safety, here set to 4k.
Fixes #10738.
Ruben Suarez Alvarez [Wed, 14 Nov 2018 07:18:23 +0000 (08:18 +0100)]
hwdb: Add accelerometer orientation quirk for the Chuwi CoreBook tablet
Evgeny Vereshchagin [Wed, 14 Nov 2018 06:41:06 +0000 (07:41 +0100)]
travis: also compile and run unsafe unit tests
jambonmcyeah [Wed, 14 Nov 2018 03:03:21 +0000 (22:03 -0500)]
hwdb: Add Onda V820w accelerometer transformation matrix
Added accelerometer transformation matrix for the Onda V820w Tablet
Lennart Poettering [Tue, 13 Nov 2018 19:51:31 +0000 (20:51 +0100)]
unit: don't claim there was no IP traffic generated by a unit when we don't know
Only if we have some IP traffic accounting at all we should claim that.
Lennart Poettering [Tue, 13 Nov 2018 19:59:20 +0000 (20:59 +0100)]
core: split out audit message generation from unit_notify()
Just some refactoring, no change in behaviour.
Lennart Poettering [Tue, 13 Nov 2018 22:09:32 +0000 (23:09 +0100)]
man: document that env vars are not suitable for passing secrets
Prompted by the thread around:
https://lists.freedesktop.org/archives/systemd-devel/2018-November/041665.html
Lennart Poettering [Tue, 13 Nov 2018 22:05:36 +0000 (23:05 +0100)]
update TODO
Lennart Poettering [Tue, 13 Nov 2018 21:03:10 +0000 (22:03 +0100)]
Merge pull request #10757 from Antique/cgroupv2
Fix cgroupv2 bpf-devices issues
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 13:53:04 +0000 (14:53 +0100)]
udev: downgrade message when we fail to set inotify watch up
My logs are full of:
systemd-udevd[6586]: seq 13515 queued, 'add' 'block'
systemd-udevd[6586]: seq 13516 queued, 'change' 'block'
systemd-udevd[6586]: seq 13517 queued, 'change' 'block'
systemd-udevd[6586]: seq 13518 queued, 'remove' 'bdi'
systemd-udevd[6586]: seq 13519 queued, 'remove' 'block'
systemd-udevd[9865]: seq 13514 processed
systemd-udevd[9865]: seq 13515 running
systemd-udevd[9865]: GROUP 6 /usr/lib/udev/rules.d/50-udev-default.rules:59
systemd-udevd[9865]: IMPORT builtin 'blkid' /usr/lib/udev/rules.d/60-persistent-storage.rules:95
systemd-udevd[9865]: IMPORT builtin 'blkid' fails: No such file or directory
systemd-udevd[9865]: loop4: Failed to add device '/dev/loop4' to watch: No such file or directory
(the last line is at error level).
If we are too slow to set up a watch and the device is already gone by the time
we try, this is not an error.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 10:33:32 +0000 (11:33 +0100)]
udev: also allow resolve_names= to be specified in udev.conf
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 12:42:42 +0000 (13:42 +0100)]
udev: move ResolveNameTiming definition and parsers to udev-util.h
Follow-up for
c4d44cba4d9bd9d92c86e06f21d5936cca1b8c16. No functional change,
but the parser is moved to libsystemd-shared.so.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 10:10:13 +0000 (11:10 +0100)]
udevd: allow more parameters to be set through udev.conf
Rebooting to set change the kernel command line to set some udev parameters is
inconvenient. Let's allow setting more stuff in the config file.
Also drop quotes from around "info" in udev.conf. We need to accept them for
compatibility, but there is no reason to use them.
Pavel Hrdina [Mon, 12 Nov 2018 09:53:47 +0000 (10:53 +0100)]
bpf-devices: fix order of removing and adding BPF programs
The current code has multiple issues and it should never be done like
that. If someone updates list of allowed devices we should attach new
program before we remove the old one for two reasons:
1. It takes some time to attach new program so there is a period of time
when all devices are allowed.
2. BPF programs have limit for number of instructions (4096) and if user
adds a lot of devices we might hit the instruction limit and the new
program will not be accepted which will result in allow all devices
because the old program was already removed.
In order to attach the new program before we remove the old one we need
to use BPF_F_ALLOW_MULTI flag every time.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 09:37:05 +0000 (10:37 +0100)]
udev: do not pass timeout_warn_usec around, calculate it on demand
It was always set to one third of timeout_usec, so let's simplify things by
calculating it using a helper function right before it is used.
Before
9d9264ba39f797d20100c8acfda3df895ab5aaa2, udevd.c would avoid setting
timeout_warn_usec to 0, using 1 instead. This wasn't necessary, because when
timeout_warn_usec is finally used in spawn_wait(), it is ignored if
timeout_usec is 0 or timeout_warn_usec is 0. So there was no need to handle
this case specially.
Pavel Hrdina [Mon, 12 Nov 2018 09:52:05 +0000 (10:52 +0100)]
bpf-devices: fix cgroup v2 devices detection
If cgroup v2 bpf devices is supported we need to return 1, not -1.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Lennart Poettering [Tue, 13 Nov 2018 11:48:49 +0000 (12:48 +0100)]
core: make sure we don't throttle change signal generator when a reload is pending
Fixes: #10627
Lennart Poettering [Tue, 13 Nov 2018 11:00:42 +0000 (12:00 +0100)]
core: when we can't send the pending reload message, say we ignore it in the warning we log
No change in behaviour, just better wording.
Lennart Poettering [Tue, 13 Nov 2018 10:59:06 +0000 (11:59 +0100)]
core: rename queued_message → pending_reload_message
This field is only used for pending Reload() replies, hence let's rename
it to be more descriptive and precise.
No change in behaviour.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 08:08:24 +0000 (09:08 +0100)]
shared/dissect-image: drop parens
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 08:02:01 +0000 (09:02 +0100)]
nspawn: add a hint to the message we emit when a child dies
From #10526:
$ sudo systemd-nspawn -i image
Spawning container image on /home/zbyszek/src/mkosi/image.
Press ^] three times within 1s to kill container.
Short read while reading cgroup mode.
Lennart Poettering [Mon, 12 Nov 2018 22:42:24 +0000 (23:42 +0100)]
tree-wide: port over other candidates for namespace_fork()
Let's always use the same, correct, way to join a namespace.
Lennart Poettering [Mon, 12 Nov 2018 22:40:09 +0000 (23:40 +0100)]
machined: when reading os-release file, join PID namespace too
This is required for /proc/self/fd/xyz to work, but that's what we need
to convert the O_PATH fd returned by chase_symlinks() back to a regular
file fd. Hence, let's do the joining of the namespaces fully and
correctly, by doing fork()+setns()+fork() with the PID and fs
namespaces.
This makes use of the new namespace_fork() helper we just added.
Fixes: #10549
Lennart Poettering [Mon, 12 Nov 2018 22:39:01 +0000 (23:39 +0100)]
sd-bus: port over to namespace_fork()
This is pretty similar code, let's replace it with the generic
namespace_fork() implementation.
Lennart Poettering [Mon, 12 Nov 2018 22:37:13 +0000 (23:37 +0100)]
core: add namespace_fork() helper, that forks, joins a set of namespaces and forks again
This helper is useful to ensure pidns/userns joining is properly
executed (as that requires a fork after the setns()). This is
particularly important when it comes to /proc/self/ access or
SCM_CREDENTIALS, but is generally the safer mode of operation.
INSUN PYO [Tue, 13 Nov 2018 04:44:20 +0000 (13:44 +0900)]
core: use local variable m instead of u->manager
Lennart Poettering [Tue, 13 Nov 2018 09:38:47 +0000 (10:38 +0100)]
Merge pull request #10744 from poettering/logind-lock-down
units: lock down logind with fs namespacing options
Lennart Poettering [Mon, 12 Nov 2018 18:21:09 +0000 (19:21 +0100)]
units: also change portabled's syscall filter to a whitelist
Lennart Poettering [Mon, 12 Nov 2018 19:13:48 +0000 (20:13 +0100)]
Merge pull request #10614 from thom311/dhcp-identifier-set-iaid
endianness dependent behavior of dhcp_identifier_set_iaid()
Frantisek Sumsal [Sun, 11 Nov 2018 11:13:48 +0000 (12:13 +0100)]
tests: dbus.service was renamed to dbus-daemon.service in Rawhide
Fedora Rawhide renamed dbus.service to dbus-daemon.service - that
breaks tests which require working DBus (e.g. TEST-03-JOBS)
Excerpt from the dbus.spec:
The 'dbus' package is only retained for compatibility purposes. It will
eventually be removed and then replaced by 'Provides: dbus' in the
dbus-daemon package. It will then exclusively be used for other packages to
describe their dependency on a system and user bus. It does not pull in any
particular dbus *implementation*, nor any libraries. These should be pulled
in, if required, via explicit dependencies.
Lennart Poettering [Mon, 12 Nov 2018 17:08:48 +0000 (18:08 +0100)]
units: lock down systemd-logind.service with various fs namespacing options
now that logind doesn't mount $XDG_RUNTIME_DIR anymore we can lock down
the service using fs namespacing (as we don't need the mount to
propagate to the host namespace anymore).
Thomas Haller [Thu, 1 Nov 2018 13:43:11 +0000 (14:43 +0100)]
dhcp: support endianness independent dhcp_identifier_set_iaid()
The previous code did htole64() followed by unaligned_write_be32() (the
XOR and shift in between is endianness agnostic). That means, on every
architeture there is always exactly one byte swap and the iaid is
dependent on endianness.
Since dhcp_identifier_set_iaid() is part of the DUID generation
algorithm, this cannot be fixed without changing the client-id.
In particular, as the client-id already depends on the machine-id (and
is thus inherrently host-specific), it is better to stick to the current
behavior.
However, add a parameter to switch between old and new behaviour.
Since the new behavior is unused, the only real purpose of this
change is to self-document the oddity of the function.
Fixes:
933f9caeeb2b3c1b951d330e04beb04226e5a890
Thomas Haller [Thu, 1 Nov 2018 13:46:27 +0000 (14:46 +0100)]
dhcp: add test for dhcp_identifier_set_iaid()
Lennart Poettering [Mon, 12 Nov 2018 16:57:45 +0000 (17:57 +0100)]
logind: drop CAP_KILL from caps bounding set
logind doesn't kill any processes anymore, hence let's drop the
capability.
Lennart Poettering [Mon, 12 Nov 2018 18:03:22 +0000 (19:03 +0100)]
Merge pull request #10741 from poettering/signal-check
propeperly handle sd_event_add_signal() errors
Lennart Poettering [Mon, 12 Nov 2018 16:19:48 +0000 (17:19 +0100)]
units: set NoNewPrivileges= for all long-running services
Previously, setting this option by default was problematic due to
SELinux (as this would also prohibit the transition from PID1's label to
the service's label). However, this restriction has since been lifted,
hence let's start making use of this universally in our services.
On SELinux system this change should be synchronized with a policy
update that ensures that NNP-ful transitions from init_t to service
labels is permitted.
An while we are at it: sort the settings in the unit files this touches.
This might increase the size of the change in this case, but hopefully
should result in stabler patches later on.
Fixes: #1219