]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agosysv-generator: reduce scope of variables 16238/head
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 13:53:55 +0000 (15:53 +0200)] 
sysv-generator: reduce scope of variables

5 years agosocket-proxy: use structured initialization in one place
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 13:53:44 +0000 (15:53 +0200)] 
socket-proxy: use structured initialization in one place

5 years agobasic/hashmap,set: propagate allocation location info in _copy()
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:55:41 +0000 (14:55 +0200)] 
basic/hashmap,set: propagate allocation location info in _copy()

Also use double space before the tracking args at the end. Without
the comma this looks ugly, but it's a bit better with the double space.
At least it doesn't look like a variable with a type.

5 years agotree-wide: use set_ensure_consume() in various places
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:40:08 +0000 (14:40 +0200)] 
tree-wide: use set_ensure_consume() in various places

No funtional change.

5 years agonetworkd: take ref immediately after storing item in set
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:24:57 +0000 (14:24 +0200)] 
networkd: take ref immediately after storing item in set

I'm not sure if I understand the code correctly, but it seems that if
storig in the second set failed, we'd return with the first set having
no reference on the link object, and the link object could be freed in the
future, leaving the set with a dangling reference.

5 years agocore/bpf-firewall: use the correct cleanup function
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:16:04 +0000 (14:16 +0200)] 
core/bpf-firewall: use the correct cleanup function

On error, we'd just free the object, and not close the fd.

While at it, let's use set_ensure_consume() to make sure we don't leak
the object if it was already in the set. I'm not sure if that condition
can be achieved.

5 years agologind: fix possible memleak of message if the message was already in the set
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.

5 years agoportable: rework set handling in portable_detach()
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.

5 years agoresolved: fix memleak on duplicate host lines in /etc/hosts
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

5 years agoresolved: simplify allocation failure handling in dns_stub_process_query()
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.

5 years agobasic/set,hashmap: pass through allocation info in more cases
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

5 years agobasic/set: add set_ensure_consume()
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.

5 years agoshared/bus-util: fix misleading error handling
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.

5 years agoudevadm-monitor: simplify creation of arg_tag_filter set
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.

5 years agofuzz-netdev-parser: add test case for earlier version of preceding patches
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

5 years agonetdev/wireguard: do not invalidate peer on invalid syntax
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.

5 years agotree-wide: use set_ensure_put()
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.

5 years agobasic/set: add set_ensure_put()
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!

5 years agosd-device: use set_put_strdup() in one more place
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

5 years agoresolved: introduce dns_transaction_gcp()
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:25:18 +0000 (14:25 +0200)] 
resolved: introduce dns_transaction_gcp()

5 years agoman: Fix a typo of session
Matthew Leeds [Fri, 19 Jun 2020 03:43:40 +0000 (20:43 -0700)] 
man: Fix a typo of session

5 years agosd-boot: Add small comments after device-specific key macros
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>
5 years agoMerge pull request #16191 from poettering/repart-spec
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

5 years agoMerge pull request #16208 from yuwata/udev-fix-16207
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()

5 years agonetwork: do not fail to configure non-nl80211 wifi interfaces
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.

5 years agonetwork: drop casting in memcpy()ing IPv6 address
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.

5 years agoudev: udev_event_apply_format() always make buf NUL terminated 16208/head
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.

5 years agoudev: fix error handling of sd_device_get_parent()
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.

5 years agonetwork: clean-up DHCP lease server data configuration
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
5 years agoMerge pull request #16061 from filbranden/standalone1
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

5 years agonetwork: DHCPv6 - Add support to set token on the LAN interface
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.

5 years agoefi: use stub for cache_efi_options_variable if !ENABLE_EFI
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

5 years agoUSER_RECORD: fix typo
Lennart Poettering [Tue, 16 Jun 2020 14:10:37 +0000 (16:10 +0200)] 
USER_RECORD: fix typo

Fixes: #16172
5 years agorepart: if now minimal size is specified, default to 10M 16191/head
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

5 years agorepart: add simple specifier expansion in Label=
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.

5 years agoupdate TODO
Lennart Poettering [Tue, 16 Jun 2020 12:38:23 +0000 (14:38 +0200)] 
update TODO

5 years agoREADME: add reference to systemd.io
Lennart Poettering [Tue, 16 Jun 2020 09:37:06 +0000 (11:37 +0200)] 
README: add reference to systemd.io

5 years agoupdate TODO
Lennart Poettering [Tue, 16 Jun 2020 09:42:16 +0000 (11:42 +0200)] 
update TODO

5 years agohwdb: Mask rfkill event from intel-hid on HP platforms
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.

5 years agosd-boot: Work around malformed CR key code
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>
5 years agohwdb: Add accel orientation quirk for Odys Fusion Win 12 2in1
AndreRH [Sat, 13 Jun 2020 14:48:53 +0000 (16:48 +0200)] 
hwdb: Add accel orientation quirk for Odys Fusion Win 12 2in1

5 years agoMerge pull request #16170 from keszybz/man-user@
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

5 years agoman: mention systemd-user-runtime-dir in user@.service too 16170/head
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.)

5 years agoefi: Skip parsing SystemdOptions if there's an error getting it.
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.

5 years agonetworkd: Add missing match_wlan_iftype check to network_verify
Daan De Meyer [Fri, 12 Jun 2020 17:31:22 +0000 (19:31 +0200)] 
networkd: Add missing match_wlan_iftype check to network_verify

5 years agoman: Document the crypttab keyfile syntax specifying a device
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.

5 years agoMerge pull request #16163 from DaanDeMeyer/resolved-edns-info
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

5 years agoImprove message for scheduled shutdown or reboot
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.

5 years agoman: really fix conditional in homed.conf
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.

5 years agoman: drop obsolete HAVE_PYTHON conditional
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.

5 years agoupdate-man-rules: properly filter out directives index again
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.

5 years agoresolved: Log the feature level we're downgrading from as well 16163/head
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

5 years agoefi: Cache contents of EFI variable SystemdOptions
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.

5 years agotest: in test_bridge_configure_without_carrier, ignore setup_state
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.

5 years agoresolved: Don't complain too much when downgrading from EDNS
Daan De Meyer [Fri, 12 Jun 2020 18:17:15 +0000 (20:17 +0200)] 
resolved: Don't complain too much when downgrading from EDNS

5 years agologin: filenames in /run/systemd/users are uids
Jan Palus [Thu, 11 Jun 2020 16:23:28 +0000 (18:23 +0200)] 
login: filenames in /run/systemd/users are uids

Fixes: #16146
5 years agocifuzz: build fuzz target with UBsan and MSan as well
Evgeny Vereshchagin [Thu, 11 Jun 2020 20:26:17 +0000 (22:26 +0200)] 
cifuzz: build fuzz target with UBsan and MSan as well

5 years agoturn off fuzzit part 2
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

5 years agoMerge pull request #16144 from mrc0mmand/gh-actions-followup
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

5 years agoci: tweak the dependency installation 16144/head
Frantisek Sumsal [Thu, 11 Jun 2020 13:00:15 +0000 (15:00 +0200)] 
ci: tweak the dependency installation

5 years agoci: tweak the compilation options
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.

5 years agoci: move the build check script to workflows directory
Frantisek Sumsal [Thu, 11 Jun 2020 11:29:01 +0000 (13:29 +0200)] 
ci: move the build check script to workflows directory

5 years agoci: do the compiler-detection magic in the test script
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.

5 years agoMerge pull request #16137 from poettering/sleep-fixlets
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

5 years agoMerge pull request #16136 from mrc0mmand/travis-cleanup
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

5 years agoci: add homed/zstd dependencies 16136/head
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.

5 years agogithub: move the clang/gcc build check to GH Actions
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.

5 years agoMerge pull request #16124 from ssahani/dhcpv6-duid
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

5 years agosleep: pass error we see to log function 16137/head
Lennart Poettering [Wed, 10 Jun 2020 14:54:10 +0000 (16:54 +0200)] 
sleep: pass error we see to log function

5 years agosleep-config: modernize destructors
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.

5 years agosleep-config: downgrade log level in can_s2h()
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.

5 years agosleep: clean up debug/error logging
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.

5 years agosleep-config: return correct error code
Lennart Poettering [Wed, 10 Jun 2020 14:40:52 +0000 (16:40 +0200)] 
sleep-config: return correct error code

5 years agosleep-config: add more debug logging
Lennart Poettering [Wed, 10 Jun 2020 14:40:36 +0000 (16:40 +0200)] 
sleep-config: add more debug logging

5 years agogithub: rename CIFuzz workflow file to cifuzz.yml
Frantisek Sumsal [Wed, 10 Jun 2020 15:06:49 +0000 (17:06 +0200)] 
github: rename CIFuzz workflow file to cifuzz.yml

5 years agotravis: bump Ubuntu release to Bionic
Frantisek Sumsal [Wed, 10 Jun 2020 15:05:55 +0000 (17:05 +0200)] 
travis: bump Ubuntu release to Bionic

5 years agojournal: drop the assert-only variable completely
Frantisek Sumsal [Wed, 10 Jun 2020 17:45:33 +0000 (19:45 +0200)] 
journal: drop the assert-only variable completely

Followup to dfa64b64a7e2b9bffea260953b30e6236047fffb.

5 years agotravis: replace set (+|-)e with travis_terminate
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/

5 years agotree-wide: port to fd_wait_for_event()
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)

5 years agomeson: build standalone version of systemd-tmpfiles 16061/head
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.

5 years agomeson: add a new -Dstandalone-binaries=true option
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.

5 years agonetworkctl: Display DHCP6 DUID 16124/head
Susant Sahani [Tue, 9 Jun 2020 14:49:48 +0000 (16:49 +0200)] 
networkctl: Display DHCP6 DUID

5 years agosd-network: Introduce APIs to get DHCP6 DUID
Susant Sahani [Tue, 9 Jun 2020 14:49:12 +0000 (16:49 +0200)] 
sd-network: Introduce APIs to get DHCP6 DUID

5 years agonetwork: DHCP6 - save DUID to state file
Susant Sahani [Tue, 9 Jun 2020 14:48:42 +0000 (16:48 +0200)] 
network: DHCP6 - save DUID to state file

5 years agonetwork: DHCP6 - introduce DHCP6 DUID to string
Susant Sahani [Tue, 9 Jun 2020 14:47:49 +0000 (16:47 +0200)] 
network: DHCP6 - introduce DHCP6 DUID to string

5 years agoMerge pull request #15940 from keszybz/names-set-optimization
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

5 years agoupdate TODO
Lennart Poettering [Wed, 10 Jun 2020 16:37:00 +0000 (18:37 +0200)] 
update TODO

5 years agotest: make TEST-02-CRYPTSETUP a bit more robust
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.

5 years agocore: don't consider SERVICE_SKIP_CONDITION for abnormal or failure restarts
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
5 years agodocs: Change suffix for desktop applications to support non-transient services
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.

5 years agopager: set PR_DEATHSIG for pager to SIGINT rather than SIGTERM
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
5 years agodocs: point contributors to list of most recent systemd releases
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
5 years agoMerge pull request #16111 from poettering/bitlck-fix
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

5 years agoMerge pull request #16118 from poettering/inaccessible-fixlets
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

5 years agoMerge pull request #16120 from poettering/udevd-fixlets
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

5 years agocore: do not touch instance from unit_choose_id() 15940/head
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.

5 years agocore: create socket service instances with the correct name from the start
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.

5 years agocore: rework error messages in unit_add_name()
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().

5 years agocore: when adding names to unit, require matching instance strings
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.

5 years agocore: store unit aliases in a separate set
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.