Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:07:44 +0000 (14:07 +0200)]
logind: fix possible memleak of message if the message was already in the set
I'm not sure if it is actually possible to encounter this condition. But
let's make the handling correct regardless.
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:06:02 +0000 (14:06 +0200)]
portable: rework set handling in portable_detach()
_cleanup_set_free_ is enough for unit_files, because unit_files is
allocated in set_put_strdup(), which uses string_hash_ops_free.
This fixes a leak if marker was already present in the table.
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:03:30 +0000 (14:03 +0200)]
resolved: fix memleak on duplicate host lines in /etc/hosts
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 06:46:08 +0000 (08:46 +0200)]
resolved: simplify allocation failure handling in dns_stub_process_query()
Old code was correct, but let's make things more explicit.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 17:58:18 +0000 (19:58 +0200)]
basic/set,hashmap: pass through allocation info in more cases
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 17:46:14 +0000 (19:46 +0200)]
basic/set: add set_ensure_consume()
This combines set_ensure_allocated() with set_consume(). The cool thing is that
because we know the hash ops, we can correctly free the item if appropriate.
Similarly to set_consume(), the goal is to simplify handling of the case where
the item needs to be freed on error and if already present in the set.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 15:41:18 +0000 (17:41 +0200)]
shared/bus-util: fix misleading error handling
set_put()/set_ensure_put() return 0, not -EEXIST, if the entry is already
found in the set. In this case this does not make any difference, but let's
not confuse the reader.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 15:21:42 +0000 (17:21 +0200)]
udevadm-monitor: simplify creation of arg_tag_filter set
This version is more efficient, which doesn't matter, but it allows us
to remove a bunch of error handling, which is always nice.
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 14:27:02 +0000 (16:27 +0200)]
fuzz-netdev-parser: add test case for earlier version of preceding patches
AddressSanitizer:DEADLYSIGNAL
=================================================================
==12==ERROR: AddressSanitizer: ABRT on unknown address 0x00000000000c (pc 0x7f0a518b3428 bp 0x7fffa463bfd0 sp 0x7fffa463be68 T0)
SCARINESS: 10 (signal)
#0 0x7f0a518b3428 in raise (/lib/x86_64-linux-gnu/libc.so.6+0x35428)
#1 0x7f0a518b5029 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x37029)
#2 0x7f0a52ca635a in log_assert_failed_realm /work/build/../../src/systemd/src/basic/log.c:819:9
#3 0x4eea92 in config_parse_wireguard_endpoint /work/build/../../src/systemd/src/network/netdev/wireguard.c:808:9
#4 0x7f0a52b2f74e in next_assignment /work/build/../../src/systemd/src/shared/conf-parser.c:133:32
#5 0x7f0a52b2954e in parse_line /work/build/../../src/systemd/src/shared/conf-parser.c:242:16
#6 0x7f0a52b28911 in config_parse /work/build/../../src/systemd/src/shared/conf-parser.c:377:21
#7 0x7f0a52b29ec6 in config_parse_many_files /work/build/../../src/systemd/src/shared/conf-parser.c:439:21
#8 0x7f0a52b2a5a6 in config_parse_many /work/build/../../src/systemd/src/shared/conf-parser.c:507:16
#9 0x4d8d6c in netdev_load_one /work/build/../../src/systemd/src/network/netdev/netdev.c:732:13
#10 0x4d3e2b in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/network/fuzz-netdev-parser.c:23:16
#11 0x6b3266 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:558:15
#12 0x6af860 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:470:3
#13 0x6b6970 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:770:7
#14 0x6b7376 in fuzzer::Fuzzer::Loop(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:799:3
#15 0x67573f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:846:6
#16 0x667097 in main /src/libfuzzer/FuzzerMain.cpp:19:10
#17 0x7f0a5189e82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#18 0x4295a8 in _start (out/fuzz-netdev-parser+0x4295a8)
DEDUP_TOKEN: raise--abort--log_assert_failed_realm
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x35428) in raise
==12==ABORTING
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 13:55:04 +0000 (15:55 +0200)]
netdev/wireguard: do not invalidate peer on invalid syntax
We would say "ignoring", but invalidate the peer anyway.
Let's only do that if we modified the peer irreperably.
Also add comments explaining allocation handling.
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 13:12:29 +0000 (15:12 +0200)]
tree-wide: use set_ensure_put()
Patch contains a coccinelle script, but it only works in some cases. Many
parts were converted by hand.
Note: I did not fix errors in return value handing. This will be done separate
to keep the patch comprehensible. No functional change is intended in this
patch.
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:25:18 +0000 (14:25 +0200)]
basic/set: add set_ensure_put()
It's such a common operation to allocate the set and put an item in it,
that it deserves a helper. set_ensure_put() has the same return values
as set_put().
Comes with tests!
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:58:01 +0000 (14:58 +0200)]
sd-device: use set_put_strdup() in one more place
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:25:18 +0000 (14:25 +0200)]
resolved: introduce dns_transaction_gcp()
Matthew Leeds [Fri, 19 Jun 2020 03:43:40 +0000 (20:43 -0700)]
man: Fix a typo of session
Paul Cercueil [Mon, 15 Jun 2020 10:54:28 +0000 (12:54 +0200)]
sd-boot: Add small comments after device-specific key macros
The key macros added in commit
6fe95d3020 look strange at first sight.
Add a comment with just the tablet name after each line, so that it's
obvious that these lines address device-specific issues of the EFI
firmware, and not broken/old code.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Lennart Poettering [Thu, 18 Jun 2020 13:53:31 +0000 (15:53 +0200)]
Merge pull request #16191 from poettering/repart-spec
repart: add specifier expansion to Label= + bump default mininum size to 10M
Lennart Poettering [Thu, 18 Jun 2020 13:52:07 +0000 (15:52 +0200)]
Merge pull request #16208 from yuwata/udev-fix-16207
udev: fixes error handling of sd_device_get_parent()
Yu Watanabe [Wed, 17 Jun 2020 04:54:56 +0000 (13:54 +0900)]
network: do not fail to configure non-nl80211 wifi interfaces
Also, make wifi_get_interface() and wifi_get_station() initialize
destination buffer when they return a non-negatinve value.
Closes #16160.
Yu Watanabe [Thu, 18 Jun 2020 06:35:27 +0000 (15:35 +0900)]
network: drop casting in memcpy()ing IPv6 address
Follow-up for #16067.
Yu Watanabe [Thu, 18 Jun 2020 04:48:45 +0000 (13:48 +0900)]
udev: udev_event_apply_format() always make buf NUL terminated
The return value of udev_event_apply_format() is always ignored.
So, the destination buffer must be always NUL terminated.
Yu Watanabe [Thu, 18 Jun 2020 04:48:44 +0000 (13:48 +0900)]
udev: fix error handling of sd_device_get_parent()
sd_device_get_parent() returns -EINVAL or -ENOENT on error, not -ENODEV.
Fixes #16207.
Lennart Poettering [Tue, 16 Jun 2020 18:35:18 +0000 (20:35 +0200)]
network: clean-up DHCP lease server data configuration
This is an attempt to clean up the POP3/SMTP/LPR/… DHCP lease server
data logic in networkd. This reduces code duplication and fixes a number
of bugs.
This removes any support for collecting POP3/SMPT/LPR servers acquired
via local DHCP client releases since noone uses that, and given how old
these protocols are I doubt this will change. It keeps support for
configuring them for the dhcp server however.
The differences between the DNS/NTP/SIP/POP3/SMTP/LPR configuration
logics are minimized.
This removes the relevant symbols from sd-network.h (which is an
internal API only at this point after all).
This is unfortunately not well test, given the old code for this had
barely any tests. But the new code should not perform worse at least,
and allow us to release, since it corrects some interfaces visible in
the .network configuration format.
Fixes: #15943
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jun 2020 22:09:42 +0000 (00:09 +0200)]
Merge pull request #16061 from filbranden/standalone1
meson: add a new -Dstandalone-binaries=true option
Susant Sahani [Wed, 10 Jun 2020 02:57:35 +0000 (04:57 +0200)]
network: DHCPv6 - Add support to set token on the LAN interface
This patch adds support to set a token on the LAN interface for
the acquired delegated prefixes for the DHCPv6 to generate address.
Luca Boccassi [Mon, 15 Jun 2020 18:50:56 +0000 (19:50 +0100)]
efi: use stub for cache_efi_options_variable if !ENABLE_EFI
../src/core/main.c: In function 'main':
../src/core/main.c:2637:32: error: implicit declaration of function 'cache_efi_options_variable'; did you mean 'systemd_efi_options_variable'? [-Werror=implicit-function-declaration]
(void) cache_efi_options_variable();
^~~~~~~~~~~~~~~~~~~~~~~~~~
systemd_efi_options_variable
Lennart Poettering [Tue, 16 Jun 2020 14:10:37 +0000 (16:10 +0200)]
USER_RECORD: fix typo
Fixes: #16172
Lennart Poettering [Tue, 16 Jun 2020 12:38:44 +0000 (14:38 +0200)]
repart: if now minimal size is specified, default to 10M
Prompted by this discussion:
https://lists.freedesktop.org/archives/systemd-devel/2020-June/044669.html
Lennart Poettering [Tue, 16 Jun 2020 09:43:11 +0000 (11:43 +0200)]
repart: add simple specifier expansion in Label=
Strictly speaking this is a compat breakage, but given the tool was
added only in the last release, let's try to sail under the radar, and
fix this early before anyone notices it wasn't supported always.
Lennart Poettering [Tue, 16 Jun 2020 12:38:23 +0000 (14:38 +0200)]
update TODO
Lennart Poettering [Tue, 16 Jun 2020 09:37:06 +0000 (11:37 +0200)]
README: add reference to systemd.io
Lennart Poettering [Tue, 16 Jun 2020 09:42:16 +0000 (11:42 +0200)]
update TODO
Kai-Heng Feng [Thu, 11 Jun 2020 13:32:12 +0000 (21:32 +0800)]
hwdb: Mask rfkill event from intel-hid on HP platforms
HP spec mandates the hp-wireless driver as canonical source of rfkill
event, so mask the rfkill event from intel-hid to avoid double rfkill
events fired from a single hotkey press.
Paul Cercueil [Sun, 14 Jun 2020 10:51:36 +0000 (12:51 +0200)]
sd-boot: Work around malformed CR key code
When a key is pressed, the EFI firmware gives us a 64-bit word that
contains the modifier key code in the upper 32 bits, the scan code in
the middle 16 bits, and a unicode character in the low 16 bits.
Some bogus EFI firmwares will put the unicode character in the scan code
area, for instance on the EZpad mini 4s tablet.
Others will even put the unicode character in both the scan code and
unicode areas. This is the case for instance on the Teclast X98+ II
tablet.
Add workarounds for these corner cases, only for the carriage return key
right now. Some more workarounds may be needed, e.g. for volume keys,
but I cannot test it.
Partially fixes #8466.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
AndreRH [Sat, 13 Jun 2020 14:48:53 +0000 (16:48 +0200)]
hwdb: Add accel orientation quirk for Odys Fusion Win 12 2in1
Zbigniew Jędrzejewski-Szmek [Sun, 14 Jun 2020 17:55:11 +0000 (19:55 +0200)]
Merge pull request #16170 from keszybz/man-user@
Better documentation for user@ services
Zbigniew Jędrzejewski-Szmek [Sat, 13 Jun 2020 15:11:00 +0000 (17:11 +0200)]
man: mention systemd-user-runtime-dir in user@.service too
_riotingpacifist was complaining on reddit [1] that systemd-user-runtime-dir
is not documented anywhere. So let's add the binary name as page alias.
[1] https://www.reddit.com/r/linux/comments/h086fd/why_linuxs_systemd_is_still_divisive_after_all/ftllr66/
This page should be in section 8, like all .service descriptions.
Also extend the text a bit to make it clearer that systemd --user is the same
executable but running in a different mode (which might be certainly a bit
confusing to users.)
Filipe Brandenburger [Thu, 11 Jun 2020 22:33:32 +0000 (15:33 -0700)]
efi: Skip parsing SystemdOptions if there's an error getting it.
The original logic was logging an "ignored" debug message, but it was still
going ahead and calling proc_cmdline_parse_given() on the NULL line. Fix that
to skip that explicitly when the EFI variable wasn't really read.
Daan De Meyer [Fri, 12 Jun 2020 17:31:22 +0000 (19:31 +0200)]
networkd: Add missing match_wlan_iftype check to network_verify
Vladimir Panteleev [Fri, 12 Jun 2020 10:44:57 +0000 (10:44 +0000)]
man: Document the crypttab keyfile syntax specifying a device
Feature introduced in
50d2eba27b9bfc77ef6b40e5721713846815418b. Also documented
as part of the kernel parameter syntax in systemd-cryptsetup-generator(8), but
should also be documented here as part of the overall file syntax.
Zbigniew Jędrzejewski-Szmek [Sun, 14 Jun 2020 08:45:02 +0000 (10:45 +0200)]
Merge pull request #16163 from DaanDeMeyer/resolved-edns-info
resolved: Don't complain too much when downgrading from EDNS
Tomáš Pospíšek [Sun, 14 Jun 2020 08:43:06 +0000 (10:43 +0200)]
Improve message for scheduled shutdown or reboot
Depending on if the system has been scheduled for shutdown or for reboot pring the corresponding message (and not only "Shutdown"). Prtinting the "wrong" message when rebooting will mislead and panic people. I get these messages via cron from remote servers and it would be bad if those systems actually *did* shut down, as the email from cron is telling me. Those messages cause an adrenalin spike in our team, which wouldn't happen, if the message was "correct"
Fixes #16129.
Zbigniew Jędrzejewski-Szmek [Sat, 13 Jun 2020 14:45:37 +0000 (16:45 +0200)]
man: really fix conditional in homed.conf
Followup for
f978844eb62e1c47431b388ab90aafdd29f624ec.
Zbigniew Jędrzejewski-Szmek [Sat, 13 Jun 2020 14:44:58 +0000 (16:44 +0200)]
man: drop obsolete HAVE_PYTHON conditional
It stopped making sense when automake support was dropped and python started
being required to perform a build.
Follow-up for
72cdb3e783174dcf9223a49f03e3b0e2ca95ddb8.
Zbigniew Jędrzejewski-Szmek [Sat, 13 Jun 2020 14:29:43 +0000 (16:29 +0200)]
update-man-rules: properly filter out directives index again
When directives-template.xml was created in
282230882cd0fc49b5377349f2aee22a1c9dd159,
this generator started picking it up. Let's filter it out properly again,
and also simply the filter while at it.
Daan De Meyer [Sat, 13 Jun 2020 12:48:40 +0000 (14:48 +0200)]
resolved: Log the feature level we're downgrading from as well
Filipe Brandenburger [Wed, 10 Jun 2020 22:11:32 +0000 (15:11 -0700)]
efi: Cache contents of EFI variable SystemdOptions
Cache it early in startup of the system manager, right after `/run/systemd` is
created, so that further access to it can be done without accessing the EFI
filesystem at all.
Dan Streetman [Fri, 12 Jun 2020 22:23:15 +0000 (18:23 -0400)]
test: in test_bridge_configure_without_carrier, ignore setup_state
This test is failing becuase the setup state isn't reaching 'configured'
for unknown reasons; ignore the setup state for now to prevent failures
of CI until the reason can be investigated.
Daan De Meyer [Fri, 12 Jun 2020 18:17:15 +0000 (20:17 +0200)]
resolved: Don't complain too much when downgrading from EDNS
Jan Palus [Thu, 11 Jun 2020 16:23:28 +0000 (18:23 +0200)]
login: filenames in /run/systemd/users are uids
Fixes: #16146
Evgeny Vereshchagin [Thu, 11 Jun 2020 20:26:17 +0000 (22:26 +0200)]
cifuzz: build fuzz target with UBsan and MSan as well
Evgeny Vereshchagin [Thu, 11 Jun 2020 16:34:42 +0000 (18:34 +0200)]
turn off fuzzit part 2
it's just a follow-up to https://github.com/systemd/systemd/pull/16064
Evgeny Vereshchagin [Thu, 11 Jun 2020 15:04:13 +0000 (18:04 +0300)]
Merge pull request #16144 from mrc0mmand/gh-actions-followup
GH Actions followup
Frantisek Sumsal [Thu, 11 Jun 2020 13:00:15 +0000 (15:00 +0200)]
ci: tweak the dependency installation
Frantisek Sumsal [Thu, 11 Jun 2020 12:21:02 +0000 (14:21 +0200)]
ci: tweak the compilation options
Build each build with tests (slow tests and fuzzer tests as well), and
combine the LTO build with -O3.
Frantisek Sumsal [Thu, 11 Jun 2020 11:29:01 +0000 (13:29 +0200)]
ci: move the build check script to workflows directory
Frantisek Sumsal [Thu, 11 Jun 2020 11:18:07 +0000 (13:18 +0200)]
ci: do the compiler-detection magic in the test script
so we have all PPA definitions at one place.
Lennart Poettering [Thu, 11 Jun 2020 12:12:48 +0000 (14:12 +0200)]
Merge pull request #16137 from poettering/sleep-fixlets
some log fixes in the sleep code
Evgeny Vereshchagin [Thu, 11 Jun 2020 11:16:44 +0000 (14:16 +0300)]
Merge pull request #16136 from mrc0mmand/travis-cleanup
Move the gcc/clang build check to GitHub Actions
Frantisek Sumsal [Wed, 10 Jun 2020 18:51:15 +0000 (20:51 +0200)]
ci: add homed/zstd dependencies
Also, sort the whole list when we're at it.
Frantisek Sumsal [Wed, 10 Jun 2020 11:41:28 +0000 (13:41 +0200)]
github: move the clang/gcc build check to GH Actions
Travis CI is getting overloaded, so let's move some load over to GitHub
Actions.
Lennart Poettering [Thu, 11 Jun 2020 10:03:07 +0000 (12:03 +0200)]
Merge pull request #16124 from ssahani/dhcpv6-duid
network: Display DHCPv6 DUID
Lennart Poettering [Wed, 10 Jun 2020 14:54:10 +0000 (16:54 +0200)]
sleep: pass error we see to log function
Lennart Poettering [Wed, 10 Jun 2020 14:53:24 +0000 (16:53 +0200)]
sleep-config: modernize destructors
All other destructors in the same .c file return NULL, let's make sure
the one where this so far wasn't done does it too.
Lennart Poettering [Wed, 10 Jun 2020 14:52:08 +0000 (16:52 +0200)]
sleep-config: downgrade log level in can_s2h()
As in the previous commit: can_sleep() is more a library-style function,
hence log at debug level only.
Lennart Poettering [Wed, 10 Jun 2020 14:47:38 +0000 (16:47 +0200)]
sleep: clean up debug/error logging
half of find_hibernation_location() logged at debug level, the other
half logged at error level, and the third half didn't log at all.
Let's clean this up somewhat. Since can_sleep() is probably more
a library-style function let's downgrade everything to LOG_DEBUG and
then make sure sleep.c logs at error level, as the main program.
Lennart Poettering [Wed, 10 Jun 2020 14:40:52 +0000 (16:40 +0200)]
sleep-config: return correct error code
Lennart Poettering [Wed, 10 Jun 2020 14:40:36 +0000 (16:40 +0200)]
sleep-config: add more debug logging
Frantisek Sumsal [Wed, 10 Jun 2020 15:06:49 +0000 (17:06 +0200)]
github: rename CIFuzz workflow file to cifuzz.yml
Frantisek Sumsal [Wed, 10 Jun 2020 15:05:55 +0000 (17:05 +0200)]
travis: bump Ubuntu release to Bionic
Frantisek Sumsal [Wed, 10 Jun 2020 17:45:33 +0000 (19:45 +0200)]
journal: drop the assert-only variable completely
Followup to
dfa64b64a7e2b9bffea260953b30e6236047fffb.
Frantisek Sumsal [Wed, 10 Jun 2020 15:48:14 +0000 (17:48 +0200)]
travis: replace set (+|-)e with travis_terminate
It looks nicer and works around
https://travis-ci.community/t/exit-0-cannot-exit-successfully-on-arm/5731/
Lennart Poettering [Wed, 10 Jun 2020 09:43:40 +0000 (11:43 +0200)]
tree-wide: port to fd_wait_for_event()
Prompted by the discussion on #16110, let's migrate more code to
fd_wait_for_event().
This only leaves 7 places where we call into poll()/poll() directly in
our entire codebase. (one of which is fd_wait_for_event() itself)
Filipe Brandenburger [Wed, 3 Jun 2020 21:49:53 +0000 (14:49 -0700)]
meson: build standalone version of systemd-tmpfiles
Use -Dstandalone-binaries=yes to enable building and installing this standalone
version of the binary without a dependency on the systemd-shared solib.
Also move the list of sources for systemd-tmpfiles to its own meson.build file.
Filipe Brandenburger [Wed, 3 Jun 2020 21:02:59 +0000 (14:02 -0700)]
meson: add a new -Dstandalone-binaries=true option
This adds an option to build standalone binaries that do not depend on the
systemd-shared library. This option can be handy to build binaries that can be
useful on a non-systemd system, binaries such as systemd-sysusers and
systemd-tmpfiles have been previously requested, but installing them with all
the required dependencies pulls in too much code that isn't really relevant for
those use cases. The standalone use case is also relevant in containers, where
minimizing the size of the container image is quite relevant.
For now, only `systemd-sysusers` is also built as a standalone binary.
The standalone binaries are installed as `/usr/bin/%{name}.standalone`, the
packaging system is reponsible for renaming those into the correct names
during the packaging step. RPM is able to do so with RemovePathPostfixes:
The default behavior is to build shared binaries only, since this option is
mainly intended for building distribution packages.
Tested that a proper separate binary is built when using this option and
that having it disabled (or using the default Meson configuration) does not
produce a binary for this option.
Susant Sahani [Tue, 9 Jun 2020 14:49:48 +0000 (16:49 +0200)]
networkctl: Display DHCP6 DUID
Susant Sahani [Tue, 9 Jun 2020 14:49:12 +0000 (16:49 +0200)]
sd-network: Introduce APIs to get DHCP6 DUID
Susant Sahani [Tue, 9 Jun 2020 14:48:42 +0000 (16:48 +0200)]
network: DHCP6 - save DUID to state file
Susant Sahani [Tue, 9 Jun 2020 14:47:49 +0000 (16:47 +0200)]
network: DHCP6 - introduce DHCP6 DUID to string
Lennart Poettering [Wed, 10 Jun 2020 16:52:08 +0000 (18:52 +0200)]
Merge pull request #15940 from keszybz/names-set-optimization
Try to optimize away Unit.names set
Lennart Poettering [Wed, 10 Jun 2020 16:37:00 +0000 (18:37 +0200)]
update TODO
Frantisek Sumsal [Tue, 9 Jun 2020 14:51:55 +0000 (16:51 +0200)]
test: make TEST-02-CRYPTSETUP a bit more robust
Prompted by systemd/systemd#16111.
* check if /var is a mountpoint - if not, something went wrong. In case
of systemd/systemd#16111 the /failed file was created, because
systemd-cryptsetup failed, but it ended up being empty, making the result
check incorrectly pass
* forward journal messages to console - if we fail to mount /var,
journald won't flush logs to the persistent storage and we end up
empty handed and with no clue what went wrong
For example, without systemd/systemd#16111 and with this patch:
...
[FAILED] Failed to start systemd-cryptsetup@varcrypt.service.
See 'systemctl status systemd-cryptsetup@varcrypt.service' for details.
[DEPEND] Dependency failed for cryptsetup.target.
...
[ 3.882451] systemd-cryptsetup[581]: Key file /etc/varkey is world-readable. This is not a good idea!
[ 3.883946] systemd-cryptsetup[581]: WARNING: Locking directory /run/cryptsetup is missing!
[ 3.884846] systemd-cryptsetup[581]: Failed to load Bitlocker superblock on device /dev/disk/by-uuid/
180ba5ef-873b-4018-9968-
47c23431f71a: Invalid argument
...
[ 4.099451] sh[606]: + mountpoint /var
[ 4.100025] sh[603]: + systemctl poweroff --no-block
[ 4.101636] systemd[1]: Finished systemd-user-sessions.service.
[ 4.102598] sh[608]: /var is not a mountpoint
[FAILED] Failed to start testsuite-02.service.
Anita Zhang [Wed, 10 Jun 2020 08:18:00 +0000 (01:18 -0700)]
core: don't consider SERVICE_SKIP_CONDITION for abnormal or failure restarts
Fixes: #16115
David Edmundson [Mon, 8 Jun 2020 21:00:33 +0000 (22:00 +0100)]
docs: Change suffix for desktop applications to support non-transient services
One problem found with the current draft specification is we can't have
an application provide a non-transient systemd service file in a way
that is spec compliant as the service name currently needs to end in a
random token defined by the launcher.
This came up when trying to put DBus activated services into the correct
cgroup. There isn't enough metadata in the DBus service file to know the
correct application ID, and the most intuitive fix is for those
applications to just specify the SystemdService file in the existing
system. They're generally unique for a given user session anyway so
don't need a separate cgroup identifier.
This changes the spec for RANDOM to be optional for services.
It also changes the separator between in services to act like templates.
Ultimately that's what we're trying to recreate with the RANDOM token of
the systemd service and it's a better fit. It's needed as otherwise with
launcher and the random ident being both optional it would be impossible
to get the application ID reliably.
Scopes are unchanged as they don't support templates.
Lennart Poettering [Tue, 9 Jun 2020 06:59:33 +0000 (08:59 +0200)]
pager: set PR_DEATHSIG for pager to SIGINT rather than SIGTERM
"less" doesn't properly reset its terminal on SIGTERM, it does so only
on SIGINT. Let's thus configure SIGINT instead of SIGTERM.
I think this is something less should fix too, and clean up things
correctly on SIGTERM, too. However, given that we explicitly enable
SIGINT behaviour by passing "K" to $LESS I figure it makes sense if we
also send SIGINT instead of SIGTERM to match it.
Fixes: #16084
Lennart Poettering [Tue, 9 Jun 2020 07:42:12 +0000 (09:42 +0200)]
docs: point contributors to list of most recent systemd releases
Fixes: #16083
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jun 2020 08:25:36 +0000 (10:25 +0200)]
Merge pull request #16111 from poettering/bitlck-fix
bitlocker cryptsetup fix
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jun 2020 08:23:13 +0000 (10:23 +0200)]
Merge pull request #16118 from poettering/inaccessible-fixlets
move $XDG_RUNTIME_DIR/inaccessible/ to $XDG_RUNTIME_DIR/systemd/inaccessible
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jun 2020 08:18:36 +0000 (10:18 +0200)]
Merge pull request #16120 from poettering/udevd-fixlets
minor udev fixlets
Zbigniew Jędrzejewski-Szmek [Wed, 27 May 2020 14:36:38 +0000 (16:36 +0200)]
core: do not touch instance from unit_choose_id()
unit_choose_id() is about marking one of the aliases of the unit as the main
name. With the preparatory work in previous patches, all aliases of the unit
must have the same instance, so the operation to update the instance is a noop.
Zbigniew Jędrzejewski-Szmek [Fri, 29 May 2020 12:24:12 +0000 (14:24 +0200)]
core: create socket service instances with the correct name from the start
Upon an incoming connection for an accepting socket, we'd create a unit like
foo@0.service, then figure out that the instance name should be e.g. "0-41-0",
and then add the name foo@0-41-0.service to the unit. This obviously violates
the rule that any service needs to have a constance instance part.
So let's reverse the order: we first determine the instance name and then
create the unit with the correct name from the start.
There are two cases where we don't know the instance name:
- analyze-verify: we just do a quick check that the instance unit can be
created. So let's use a bogus instance string.
- selinux: the code wants to load the service unit to extract the ExecStart path
and query it for the selinux label. Do the same as above.
Note that in both cases it is possible that the real unit that is loaded could
be different than the one with the bogus instance value, for example if there
is a dropin for a specific instance name. We can't do much about this, since we
can't figure out the instance name in advance. The old code had the same
shortcoming.
Zbigniew Jędrzejewski-Szmek [Fri, 29 May 2020 09:22:14 +0000 (11:22 +0200)]
core: rework error messages in unit_add_name()
They were added recently in
acd1987a1867fc3390ef2516962b2313cbeb366e. We can
make them more informative by using unit_type_to_string() and not repeating
unit names as much. Also, %m should not be used together with SYNTHETIC_ERRNO().
Zbigniew Jędrzejewski-Szmek [Wed, 27 May 2020 14:39:35 +0000 (16:39 +0200)]
core: when adding names to unit, require matching instance strings
We would check that the instance is present in both units (or missing in both).
But when it is defined, it should be the same in both. The comment in the code
was explicitly saying that differing instance strings are allowed, but this
mostly seems to be a left-over from old times. The man page is pretty clear:
> the instance (if any) is always uniquely defined for a given unit and all its
> aliases.
Zbigniew Jędrzejewski-Szmek [Wed, 27 May 2020 13:49:17 +0000 (15:49 +0200)]
core: store unit aliases in a separate set
We allocated the names set for each unit, but in the majority of cases, we'd
put only one name in the set:
$ systemctl show --value -p Names '*'|grep .|grep -v ' '|wc -l
564
$ systemctl show --value -p Names '*'|grep .|grep ' '|wc -l
16
So let's add a separate .id field, and only store aliases in the set, and only
create the set if there's at least one alias. This requires a bit of gymnastics
in the code, but I think this optimization is worth the trouble, because we
save one object for many loaded units.
In particular set_complete_move() wasn't very useful because the target
unit would always have at least one name defined, i.e. the optimization to
move the whole set over would never fire.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jun 2020 07:06:14 +0000 (09:06 +0200)]
Merge pull request #16087 from mrc0mmand/travis-build-check
travis: check build with various compiler options
Lennart Poettering [Tue, 9 Jun 2020 11:40:25 +0000 (13:40 +0200)]
tree-wide: check POLLNVAL everywhere
poll() sets POLLNVAL inside of the poll structures if an invalid fd is
passed. So far we generally didn't check for that, thus not taking
notice of the error. Given that this specific kind of error is generally
indication of a programming error, and given that our code is embedded
into our projects via NSS or because people link against our library,
let's explicitly check for this and convert it to EBADF.
(I ran into a busy loop because of this missing check when some of my
test code accidentally closed an fd it shouldn't close, so this is a
real thing)
Frantisek Sumsal [Tue, 9 Jun 2020 19:31:10 +0000 (21:31 +0200)]
tree-wide: mark assert()-only variables as unused
to make a compilation with -Db_ndebug=true and --werror pass once again.
Frantisek Sumsal [Sun, 7 Jun 2020 12:05:20 +0000 (14:05 +0200)]
travis: check build with various compiler options
In the past we occasionally stumbled upon a build issue which could be
reproduced only with specific optimization level or other compilation
option. Let's try to build the current revision with several most common
compiler options causing such issues to catch them early.
Daan De Meyer [Tue, 9 Jun 2020 19:18:28 +0000 (21:18 +0200)]
Merge pull request #16104 from ssahani/dhcpv6-iaid
networkctl: Display DHCPv6 IAID
YmrDtnJu [Mon, 25 May 2020 08:46:54 +0000 (10:46 +0200)]
AppArmor: Support for loading a set of pre-compiled profiles at startup time
Let systemd load a set of pre-compiled AppArmor profile files from a policy
cache at /etc/apparmor/earlypolicy. Maintenance of that policy cache must be
done outside of systemd.
After successfully loading the profiles systemd will attempt to change to a
profile named systemd.
If systemd is already confined in a profile, it will not load any profile files
and will not attempt to change it's profile.
If anything goes wrong, systemd will only log failures. It will not fail to
start.