]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agojournalctl: don't skip the entries that have the same seqnum v247.2
shenyangyang4 [Thu, 10 Dec 2020 11:44:31 +0000 (06:44 -0500)] 
journalctl: don't skip the entries that have the same seqnum

These two judgement can't judge that two entries are repeating fully.
So i think seqnum is needed to make full judgement.

(cherry picked from commit b17f651a17cd6ec0ceac7835f2f8607fbd9ddb95)

4 years agosd-bus: use SOCK_CLOEXEC on one more socket
Lennart Poettering [Fri, 11 Dec 2020 11:04:11 +0000 (12:04 +0100)] 
sd-bus: use SOCK_CLOEXEC on one more socket

(cherry picked from commit 68a3d9153883b90c99ea2aec20075146ce58beaa)

4 years agoresolved: create stub-resolv.conf symlink with correct security label
Ondrej Mosnacek [Mon, 14 Dec 2020 15:36:27 +0000 (16:36 +0100)] 
resolved: create stub-resolv.conf symlink with correct security label

Use symlink_atomic_label() instead of symlink_atomic() as the symlink
may need a different label than the parent directory.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
(cherry picked from commit 7b87bece5ded3e8f068df8402901198c069ab5cf)

4 years agoefi: Only use arm flags if supported
Andrew Balmos [Fri, 11 Dec 2020 03:15:24 +0000 (22:15 -0500)] 
efi: Only use arm flags if supported

Support gcc 8 on arm

(cherry picked from commit 361f41645cdf920d431e2d68dcfa3f98088c2e03)

4 years agocore: detect_container() may return negative errno
Yu Watanabe [Mon, 14 Dec 2020 16:13:32 +0000 (01:13 +0900)] 
core: detect_container() may return negative errno

(cherry picked from commit bcdb3b7d5076cf6ad17cb70df8db22d876880ada)

4 years agomeson: Fix reallocarray check
Khem Raj [Sun, 13 Dec 2020 00:15:57 +0000 (16:15 -0800)] 
meson: Fix reallocarray check

reallocarray() is defined in stdlib.h, so that would be right header to
check for its presense.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 5bb20fd3d33f7e866a0845f15c1ab5b595147f1e)

4 years agonetwork: do not assume address ready callback is always set to static addresses
Yu Watanabe [Fri, 11 Dec 2020 05:22:35 +0000 (14:22 +0900)] 
network: do not assume address ready callback is always set to static addresses

(cherry picked from commit b788a429d19acda8acb1c4b543da1adc2e49f4a9)

4 years agonetwork: drop assertions to check link state in netlink callback handlers
Yu Watanabe [Thu, 10 Dec 2020 05:16:22 +0000 (14:16 +0900)] 
network: drop assertions to check link state in netlink callback handlers

As, the link may be dropped while configuring addresses or routes.

Fixes #17920.

(cherry picked from commit b2219cc4b6a2832c29eb82e90625d9c6ac61e73c)

4 years agonetwork: do not reconfigure interface when the link gains carrier but udev not initia...
Yu Watanabe [Fri, 11 Dec 2020 03:15:45 +0000 (12:15 +0900)] 
network: do not reconfigure interface when the link gains carrier but udev not initialized it yet

When an interface gains carrier but udev have not initialized the
interface or link_initialized_handler() has not been called yet,
then link_configure will be called twice. Thus LLDP client will be
configured twice, and triggers assertion.

Fixes #17929.

(cherry picked from commit 8bceafa7771800c8bdfc1b74ef39824103f5c129)

4 years agoveritysetup: also place udev socket dep
Lennart Poettering [Thu, 10 Dec 2020 10:48:37 +0000 (11:48 +0100)] 
veritysetup: also place udev socket dep

In light of #17848, also place udev socket dep in veritysetup, it's the
same issue after all.

(cherry picked from commit 8374bf4fa2663b19f329801abfd8b29e66897380)

4 years agocryptsetup: Fix crypto device missing issue after bootup
Jinyuan Si [Fri, 4 Dec 2020 02:38:28 +0000 (10:38 +0800)] 
cryptsetup: Fix crypto device missing issue after bootup

Normally, the udev rules operate on "change" events. But when
coldplugging, there's an "add" event present. The udev rules have to
recognize this and do some actions in this particular situation, too.
Also, we don't want the nodes to be created prematurely on "add"
events while not coldplugging. The udev rules will check
DM_UDEV_PRIMARY_SOURCE_FLAG to see if the device was activated
correctly before and if not, it ignore the "add" event totally.
This way the udev rules can support udev triggers generating "add"
events (e.g. "udevadm trigger --action=add" or
"echo add > /sys/block/<dm_device>/uevent").

In this case, the udevd service is started after
systemd-cryptsetup@config.service, is started, which will cause udevd
service to miss the "change" uevent with DM_UDEV_PRIMARY_SOURCE_FLAG
flag generated by systemd-cryptsetup@config.service. To solve this
issue, we let the cryptsetup service be started after the udevd
service.

(cherry picked from commit 239952e890fd4b53859f84bbc43d910e68a8f6bc)

4 years agonetwork: fix SIGABRT related to unreachable route with DHCP6
Yu Watanabe [Fri, 4 Dec 2020 11:50:34 +0000 (20:50 +0900)] 
network: fix SIGABRT related to unreachable route with DHCP6

After #17834, unreachable routes generated through DHCP6 are managed by
Manager. But they are referrenced by the DHCP6 uplink. So, the routes
managed by Manager must be freed after all Link objects are freed.

Follow-up for 575f14eef010101c60e9d4d970e542c815be1994.

Fixes SIGABRT reproted in #17831.

(cherry picked from commit 450fa34bd0315f2ca4728050b37c3a3d9e0f1b78)

4 years agonetwork: revert previous changes to address_compare_func()
Yu Watanabe [Fri, 4 Dec 2020 07:41:08 +0000 (16:41 +0900)] 
network: revert previous changes to address_compare_func()

This partially reverts fe841414ef157f7f01d339c5d5730126e7b5fe0a and
2a236f9fc0ff8fb2152032551436fde74da7217a.

For IPv4, kernel compares the local address, prefix, and prefixlen.
For IPv6, kernel compares only the local address.
Let's follow the kernel's comparison way.

Fixes #17831.

(cherry picked from commit 1d30fc5cb64ecba2f03fe42aa0d8c65c3decad82)

4 years agoudev: Fix sound.target dependency
Takashi Iwai [Wed, 9 Dec 2020 09:56:51 +0000 (10:56 +0100)] 
udev: Fix sound.target dependency

The recent bug report indicated a race at device creation and the
sound.target dependencies, and the cause turned out to be the condition
of the sound.target trigger.  Currently it's set for "card*", but this
is actually the parent object; i.e. the sound.target is triggered before
the sound devices are created.

For assuring the whole sound device creations beforehand, we need to use
"controlC*" instead of "card*"; as already described in
78-sound-card.rules, this is guaranteed to be the last device, and can
be used as a synchronization point.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1179363
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 5926e592fa5e6290b9f4588939945869adb5c55f)

4 years agomeson: specify correct libqrencode version in meson dep
Luca Boccassi [Wed, 9 Dec 2020 12:33:54 +0000 (13:33 +0100)] 
meson: specify correct libqrencode version in meson dep

(cherry picked from commit a6c7811f0d3888e2fa545cd80d7815049b5cb084)

4 years agoudev: link_update() should fail if the entry in symlink dir couldn't have been created
Franck Bui [Wed, 9 Dec 2020 08:46:08 +0000 (09:46 +0100)] 
udev: link_update() should fail if the entry in symlink dir couldn't have been created

Follow-up for 30f6dce62cb3a738b20253f2192270607c31b55b

(cherry picked from commit 4e1db59274c4b31ba5369270a489420245616eb4)

4 years agoman: document that automount units are privileged
Lennart Poettering [Wed, 9 Dec 2020 13:04:21 +0000 (14:04 +0100)] 
man: document that automount units are privileged

Fixes: #17886
(cherry picked from commit eef34a1d8fe5ca44bdab189b682642096c53e661)

4 years agologind: fix closing of button input devices
Lennart Poettering [Mon, 7 Dec 2020 09:51:15 +0000 (10:51 +0100)] 
logind: fix closing of button input devices

This is a fix of #17751. Specifically:

1. Sort #include headers again

2. Remove tabs, as per coding style

3. Don't install fds in half-initialized objects

4. Use asynchronous_close() everywhere

That all said:

Quit frankly, I am not convinced we should do all this at all. If
close()ing of these input devices is really that slow, then this should
probably be fixed in the kernel, not worked around in userspace like
this.

(cherry picked from commit c74d5fe25d53263c143f0a9c2698d8bb483e398c)

4 years agoUpdate logind-button.c
nihilix-melix [Fri, 27 Nov 2020 10:21:22 +0000 (11:21 +0100)] 
Update logind-button.c

(cherry picked from commit eee582e7951fa8e328d1fcdfcff940254070ccba)

4 years agoasync: add trivial cleanup wrapper for asynchronous_close()
Lennart Poettering [Wed, 9 Dec 2020 09:07:12 +0000 (10:07 +0100)] 
async: add trivial cleanup wrapper for asynchronous_close()

(cherry picked from commit 1d9aa4d572b661fd6500c55ab524141332f76230)

4 years agoSilence cgroups v1 read-only filesystem warning
Daan De Meyer [Mon, 7 Dec 2020 22:18:28 +0000 (22:18 +0000)] 
Silence cgroups v1 read-only filesystem warning

Avoid warning messages when booting systemd-nspawn containers and using
hybrid or legacy cgroups. systemd-nspawn mounts the cgroups v1 controller
tree as read-only so these errors are expected and not problematic.
Partially fixes #17862.

Test plan:

- Before: `mkosi --default .mkosi/mkosi.fedora boot`

```
‣ Processing default...
Spawning container image on /home/daan/projects/systemd/image.raw.
Press ^] three times within 1s to kill container.
systemd 247 running in system mode. (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Fedora 33 (Thirty Three)!

Queued start job for default target Graphical Interface.
-.slice: Failed to migrate controller cgroups from , ignoring: Read-only file system
system.slice: Failed to delete controller cgroups /system.slice, ignoring: Read-only file system
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-modprobe.slice.
user.slice: Failed to delete controller cgroups /user.slice, ignoring: Read-only file system
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Process Core Dump Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on User Database Manager Socket.
dev-hugepages.mount: Failed to delete controller cgroups /dev-hugepages.mount, ignoring: Read-only file system
         Mounting Huge Pages File System...
sys-fs-fuse-connections.mount: Failed to delete controller cgroups /sys-fs-fuse-connections.mount, ignoring: Read-only file system
         Mounting FUSE Control File System...
         Starting Journal Service...
         Starting Remount Root and Kernel File Systems...
system.slice: Failed to delete controller cgroups /system.slice, ignoring: Read-only file system
```

After: `mkosi --default .mkosi/mkosi.fedora boot`

```
‣ Processing default...
Spawning container image on /home/daan/projects/systemd/mkosi.output/image.raw.
Press ^] three times within 1s to kill container.
systemd 247 running in system mode. (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Fedora 33 (Thirty Three)!

Queued start job for default target Graphical Interface.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-modprobe.slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Process Core Dump Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on User Database Manager Socket.
         Mounting Huge Pages File System...
         Mounting FUSE Control File System...
         Starting Journal Service...
         Starting Remount Root and Kernel File Systems...
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Finished Remount Root and Kernel File Systems.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Finished Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Restore /run/initramfs on shutdown...
[  OK  ] Finished Restore /run/initramfs on shutdown.
[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[  OK  ] Finished Flush Journal to Persistent Storage.
         Starting Create Volatile Files and Directories...
[  OK  ] Finished Create Volatile Files and Directories.
         Starting Network Name Resolution...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Finished Update UTMP about System Boot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timers.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Home Area Manager...
         Starting User Login Management...
         Starting Permit User Sessions...
[  OK  ] Finished Permit User Sessions.
[  OK  ] Started Console Getty.
[  OK  ] Reached target Login Prompts.
         Starting D-Bus System Message Bus...
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Home Area Manager.
[  OK  ] Started User Login Management.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Finished Update UTMP about System Runlevel Changes.
[  OK  ] Started Network Name Resolution.
[  OK  ] Reached target Host and Network Name Lookups.

Fedora 33 (Thirty Three) (built from systemd tree)
Kernel 5.9.11-arch2-1 on an x86_64 (console)
```

(cherry picked from commit ecd3c86b60655d892f5ec68549226cc5fa4be818)

4 years agomanager: Fix HW watchdog when systemd starts before driver loaded
Michael Marley [Tue, 8 Dec 2020 02:27:38 +0000 (21:27 -0500)] 
manager: Fix HW watchdog when systemd starts before driver loaded

When manager_{set|override}_watchdog is called, set the watchdog timeout
regardless of whether the hardware watchdog was successfully initialized.  If
the watchdog was requested but could not be initialized, then instead of
pinging it, attempt to initialize it again.  This ensures that the hardware
watchdog is initialized even if the kernel module for it isn't loaded when
systemd starts (which is quite likely, unless it is compiled in).

This builds on work by @danc86 in https://github.com/systemd/systemd/pull/17460,
but fixes the issue of not updating the watchdog timeout with the actual value
from the hardware.

Fixes https://github.com/systemd/systemd/issues/17838

Co-authored-by: Dan Callaghan <djc@djc.id.au>
Co-authored-by: Michael Marley <michael@michaelmarley.com>
(cherry picked from commit 61927b9f116bf45bfdbf19dc2981d4a4f527ae5f)

4 years agocgroup: Also set blkio.bfq.weight
Pavel Hrdina [Wed, 25 Nov 2020 08:05:36 +0000 (09:05 +0100)] 
cgroup: Also set blkio.bfq.weight

Commit [1] added a workaround when unified cgroups are used but missed
legacy cgroups where there is the same issue.

[1] <https://github.com/systemd/systemd/commit/2dbc45aea747f25cc1c3848fded2ec0062f96bcf>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit 35e7a62ca32a30169a94693b831e53c832251984)

4 years agonss-resolve: varlink_call() set error_id only when r >= 0
Yu Watanabe [Sun, 6 Dec 2020 13:41:35 +0000 (22:41 +0900)] 
nss-resolve: varlink_call() set error_id only when r >= 0

Fixes #17870.

(cherry picked from commit 3c229a9afb670025a3c1792bf5ac233b5a566ec5)

4 years agomissing: Define several syscall numbers for Alpha arch
Matt Turner [Sun, 6 Dec 2020 23:45:49 +0000 (18:45 -0500)] 
missing: Define several syscall numbers for Alpha arch

(cherry picked from commit d6c0fdf4923420bd808094d02df9f05d739f4b17)

4 years agoDon't assume /run/systemd exists when creating unit-root
Daan De Meyer [Thu, 3 Dec 2020 23:08:21 +0000 (23:08 +0000)] 
Don't assume /run/systemd exists when creating unit-root

When running tests in a mkosi container, /run/systemd might not
exist yet in the container which causes test-execute to fail.

Fixes #17842.

(cherry picked from commit 77f16dbd6d93f2b4a96984254cca25cab03479af)

4 years agomkosi: Add findutils to Fedora config
Daan De Meyer [Fri, 4 Dec 2020 22:23:11 +0000 (22:23 +0000)] 
mkosi: Add findutils to Fedora config

find is needed by test_exec_dynamicuser.

(cherry picked from commit 8f2c4c5e93718ac6d6f790de61fced5ed143de5d)

4 years agomkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config
Daan De Meyer [Fri, 4 Dec 2020 20:05:19 +0000 (20:05 +0000)] 
mkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config

(cherry picked from commit 8d036c446adc4dd8f9f1919916462752209c29a4)

4 years agomkosi: Replace iptables-dev with libiptc-dev in debian config
Daan De Meyer [Mon, 30 Nov 2020 23:03:52 +0000 (23:03 +0000)] 
mkosi: Replace iptables-dev with libiptc-dev in debian config

Latest debian unstable doesn't have iptables-dev anymore. Instead,
let's use libiptc-dev.

(cherry picked from commit aef61dc888056454c543535e1410c3b299d623a5)

4 years agodissect: don't declare unused variables on archs that have no GPT discovery
Lennart Poettering [Thu, 3 Dec 2020 19:58:00 +0000 (20:58 +0100)] 
dissect: don't declare unused variables on archs that have no GPT discovery

Fixes: #17839
(cherry picked from commit 62ea0ed08d0fba0bcf0a7fbde2d2ec1d317b66c7)

4 years agoresolved: synthesize NODATA instead of NXDOMAIN if gateway exists, but of other protocol
Lennart Poettering [Fri, 6 Nov 2020 09:26:44 +0000 (10:26 +0100)] 
resolved: synthesize NODATA instead of NXDOMAIN if gateway exists, but of other protocol

Fixes: #11192
(cherry picked from commit 877884fc0da76170dce5abe7b3883eee334156b1)

4 years agolocal-addresses: make returning accumulated list optional
Lennart Poettering [Fri, 6 Nov 2020 09:26:40 +0000 (10:26 +0100)] 
local-addresses: make returning accumulated list optional

(cherry picked from commit c3a8c6aa42092d87b73a3653d96258bbfe32fd28)

4 years agoresolved: improve log message when we use TCP a bit
Lennart Poettering [Tue, 10 Nov 2020 17:45:59 +0000 (18:45 +0100)] 
resolved: improve log message when we use TCP a bit

DNS-over-TLS being in use isn't precisely the same as "UDP not
supported". Let's make this clearer.

(cherry picked from commit 6c0bacc146f1eea16f3b177a02fadf28901f9302)

4 years agonetwork: ignore broadcast address for /31 or /32 addresses
Yu Watanabe [Thu, 3 Dec 2020 01:19:35 +0000 (10:19 +0900)] 
network: ignore broadcast address for /31 or /32 addresses

As they do not have broadcast address.
See https://tools.ietf.org/html/rfc3021

(cherry picked from commit 2a236f9fc0ff8fb2152032551436fde74da7217a)

4 years agonetwork: fix verification for broadcast address
Yu Watanabe [Wed, 2 Dec 2020 10:26:41 +0000 (19:26 +0900)] 
network: fix verification for broadcast address

Fixes a bug caused by fe841414ef157f7f01d339c5d5730126e7b5fe0a.

(cherry picked from commit 05a7023d242b9012216c661f253df1c9c3d45b39)

4 years agonetwork: do not set broadcast if prefixlen is 31 or 32
Yu Watanabe [Wed, 2 Dec 2020 10:19:06 +0000 (19:19 +0900)] 
network: do not set broadcast if prefixlen is 31 or 32

After fe841414ef157f7f01d339c5d5730126e7b5fe0a, broadcast address is
also compared with existing one to determine whether the address is
foregin or not. So, the address object should not contain unnecessary
information.

Fixes #17803.

(cherry picked from commit df8aa086420e6ce61e32898b2bb7c88b87fd1c43)

4 years agostub: don't ever respond to datagrams coming in on non-localhost addreses, on the...
Lennart Poettering [Thu, 5 Nov 2020 14:51:12 +0000 (15:51 +0100)] 
stub: don't ever respond to datagrams coming in on non-localhost addreses, on the stub

(cherry picked from commit 565147b7bb2156277a2efaccd920d3ca9c21f8a8)

4 years agoresolved: never allow _gateway lookups to go to the network
Lennart Poettering [Wed, 11 Nov 2020 16:38:21 +0000 (17:38 +0100)] 
resolved: never allow _gateway lookups to go to the network

Make them rather fail than go to the network.

Previously we'd filter them on LLMNR (explicitly) and MDNS (implicitly,
because it doesn't have .local suffix), but not on DNS.

In order to make _gateway truly reliable, let's not allow it to go to
DNS either, and keep it local.

This is particular relevant, as clients can now request lookups without
local RR synthesis, where we'd rather have NXDOMAIN returned for
_gateway than have it hit the network.

(cherry picked from commit fbbc72189f7844df8500bb10a58988f70bf90c99)

4 years agoresolved: lower SERVFAIL cache timeout from 30s to 10s
Lennart Poettering [Thu, 12 Nov 2020 16:52:09 +0000 (17:52 +0100)] 
resolved: lower SERVFAIL cache timeout from 30s to 10s

Apparently 30s is a bit too long for some cases, see #5552. But not
caching SERVFAIL at all also breaks stuff, see explanation in
201d99584ed7af8078bb243ce2587e5455074713.

Let's try to find some middle ground, by lowering the cache timeout to
10s. This should be ample for the problem
201d99584ed7af8078bb243ce2587e5455074713 attackes, but not as long as
half a miute, as #5552 complains.

Fixes: #5552
(cherry picked from commit 19bcef9dc3fde342f138394333ab04d7e44b7da2)

4 years agodns-domain: try IDN2003 rules if IDN2008 doesn't work
Lennart Poettering [Mon, 9 Nov 2020 22:10:43 +0000 (23:10 +0100)] 
dns-domain: try IDN2003 rules if IDN2008 doesn't work

This follows more closely what web browsers do, and makes sure emojis in
domains work.

Fixes: #14483
(cherry picked from commit d80e72ec602c2af2983842ad87e4443fce89d423)

4 years agovirt: Properly detect nested UML inside another hypervisor
Christopher Obbard [Wed, 2 Dec 2020 14:20:39 +0000 (14:20 +0000)] 
virt: Properly detect nested UML inside another hypervisor

UML runs as a user-process so it can quite easily be ran inside of
another hypervisor, for instance inside a KVM instance. UML passes
through the CPUID from the host machine so in this case detect_vm
incorrectly identifies as running under KVM. So check we are running
a UML kernel first, before we check any other hypervisors.

Resolves: #17754

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
(cherry picked from commit c8037dbf05da586b6a210ac04f145d99f424971f)

4 years agoresolved: properly check per-link NTA list
Lennart Poettering [Tue, 17 Nov 2020 17:31:53 +0000 (18:31 +0100)] 
resolved: properly check per-link NTA list

We need to check for parent domains too. We did this correctly for the
system-wide NTA list, but not for the per-link one. Let's fix that.

(cherry picked from commit 7e8a93b77c3c4d4df1e8c3177dc9553c94fac759)

4 years agomeson: use '_' as separator in fuzz test names
Yu Watanabe [Wed, 2 Dec 2020 09:05:06 +0000 (18:05 +0900)] 
meson: use '_' as separator in fuzz test names

Follow-up for d448888924c1d4815cb97bcd5d94419812c053b9 and ca121e20c42219e3bc4e5cb63dcc96cc5eae2879.

Fixes #17568.

(cherry picked from commit 0f82a2ab5c8d812791aca9686bdcc45f39c62431)

4 years agoman: mention that --key= is about *secret* keys
Lennart Poettering [Wed, 4 Nov 2020 15:23:11 +0000 (16:23 +0100)] 
man: mention that --key= is about *secret* keys

(cherry picked from commit ce82de671f63105e9839978b432e2b015783ffc0)

4 years agomeson: check that cxx variable is set before using it
Luca Boccassi [Thu, 3 Dec 2020 16:17:43 +0000 (16:17 +0000)] 
meson: check that cxx variable is set before using it

In some cases it is not defined. Eg in a yocto build:

src/systemd/meson.build:61:15: ERROR: Unknown variable cxx.

(cherry picked from commit 442bc2afee6c5f731c7b3e76ccab7301703a45a7)

4 years agoscope: on unified, make sure to unwatch all PIDs once they've been moved to the cgrou... v247.1
Franck Bui [Mon, 30 Nov 2020 14:26:15 +0000 (15:26 +0100)] 
scope: on unified, make sure to unwatch all PIDs once they've been moved to the cgroup scope

Commit 428a9f6f1d0396b9eacde2b38d667cbe3f15eb55 freed u->pids which is
problematic since the references to this unit in m->watch_pids were no more
removed when the unit was freed.

This patch makes sure to clean all this refs up before freeing u->pids by
calling unit_unwatch_all_pids().

(cherry picked from commit e9eec8b5d2c106c5dd51382a155e6045c7c17c1a)

4 years agosd-event: fix delays assert brain-o (#17790)
Vito Caputo [Tue, 1 Dec 2020 08:26:54 +0000 (00:26 -0800)] 
sd-event: fix delays assert brain-o (#17790)

s/sizeof/ELEMENTSOF/

Bug introduced in 34b87517749caa4142b19eb3c63bdf349fafbc49.

(cherry picked from commit cb9d621ebbfa30bbd620c17e143daeb0d78c12f0)

4 years agopo: add units/systemd-journald.service.in to POTFILES.skip
Piotr Drąg [Sat, 28 Nov 2020 12:43:52 +0000 (13:43 +0100)] 
po: add units/systemd-journald.service.in to POTFILES.skip

(cherry picked from commit a75471ced1b4527870e21e96fbb81017e76fbcc8)

4 years agotest-networkd-conf: add missing assert_se
Zbigniew Jędrzejewski-Szmek [Sat, 28 Nov 2020 10:27:31 +0000 (11:27 +0100)] 
test-networkd-conf: add missing assert_se

Coverity CID#1437351. Fixup for f706340979a.

(cherry picked from commit 78cafcbc7ec7eb19d40a07dfa75ad562f7ded643)

4 years agoNEWS: really fix kernel version number reference
Zbigniew Jędrzejewski-Szmek [Fri, 27 Nov 2020 11:51:48 +0000 (12:51 +0100)] 
NEWS: really fix kernel version number reference

Fixes #17736.

(cherry picked from commit 832eedd192deb4e3520deb6a62c9acae23541b67)

4 years agooom: fix oomd.conf install location
Christian Hesse [Thu, 26 Nov 2020 20:29:30 +0000 (21:29 +0100)] 
oom: fix oomd.conf install location

The file is read in pkgsysconfdir, so install it there.

4 years agohome: fix homed.conf install location
Christian Hesse [Thu, 26 Nov 2020 20:22:41 +0000 (21:22 +0100)] 
home: fix homed.conf install location

The install location changed in d7aa78c32f076c305ceeb183fc06eb1de0960deb,
I think this was not intentional. Keep the condition but revert the path.

4 years agoMerge pull request #17738 from keszybz/hwdb-news-update-v247 v247
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 18:00:50 +0000 (19:00 +0100)] 
Merge pull request #17738 from keszybz/hwdb-news-update-v247

Update hwdb and news for v247

4 years agoshared/seccomp-util: address family filtering is broken on ppc
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 10:23:54 +0000 (11:23 +0100)] 
shared/seccomp-util: address family filtering is broken on ppc

This reverts the gist of da1921a5c396547261c8c7fcd94173346eb3b718 and
0d9fca76bb69e162265b2d25cb79f1890c0da31b (for ppc).

Quoting #17559:
> libseccomp 2.5 added socket syscall multiplexing on ppc64(el):
> https://github.com/seccomp/libseccomp/pull/229
>
> Like with i386, s390 and s390x this breaks socket argument filtering, so
> RestrictAddressFamilies doesn't work.
>
> This causes the unit test to fail:
> /* test_restrict_address_families */
> Operating on architecture: ppc
> Failed to install socket family rules for architecture ppc, skipping: Operation canceled
> Operating on architecture: ppc64
> Failed to add socket() rule for architecture ppc64, skipping: Invalid argument
> Operating on architecture: ppc64-le
> Failed to add socket() rule for architecture ppc64-le, skipping: Invalid argument
> Assertion 'fd < 0' failed at src/test/test-seccomp.c:424, function test_restrict_address_families(). Aborting.
>
> The socket filters can't be added so `socket(AF_UNIX, SOCK_DGRAM, 0);` still
> works, triggering the assertion.

Fixes #17559.

4 years agoNEWS: fix kernel version number reference 17738/head
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 13:01:09 +0000 (14:01 +0100)] 
NEWS: fix kernel version number reference

Fixes #17736.

4 years agoNEWS: version 247
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 12:45:06 +0000 (13:45 +0100)] 
NEWS: version 247

4 years agohwdb: update chromiumos autosuspend rules
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 12:54:08 +0000 (13:54 +0100)] 
hwdb: update chromiumos autosuspend rules

4 years agohwdb: update for v247
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 12:53:03 +0000 (13:53 +0100)] 
hwdb: update for v247

Only some small changes, because we updated recently. As usual, it seems that there are mostly
additions with a smaller amount of corrections, no big removals.

4 years agodocs/RELEASE: clarify which steps are done when
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 12:48:35 +0000 (13:48 +0100)] 
docs/RELEASE: clarify which steps are done when

4 years agotest: use cap_last_cap() for max supported cap number, not capability_list_length()
Dan Streetman [Wed, 25 Nov 2020 20:22:24 +0000 (15:22 -0500)] 
test: use cap_last_cap() for max supported cap number, not capability_list_length()

This test assumes capability_list_length() is an invalid cap number,
but that isn't true if the running kernel supports more caps than we were
compiled with, which results in the test failing.

Instead use cap_last_cap() + 1.

If cap_last_cap() is 63, there are no more 'invalid' cap numbers to test with,
so the invalid cap number test part is skipped.

4 years agoTranslated using Weblate (Chinese (Simplified))
Whired Planck [Thu, 26 Nov 2020 11:35:55 +0000 (12:35 +0100)] 
Translated using Weblate (Chinese (Simplified))

Currently translated at 83.9% (157 of 187 strings)

Co-authored-by: Whired Planck <fungdaat31@outlook.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/zh_CN/
Translation: systemd/master

4 years agoMerge pull request #17622 from yuwata/udev-database-set-udev-version
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 11:48:05 +0000 (12:48 +0100)] 
Merge pull request #17622 from yuwata/udev-database-set-udev-version

sd-device: make sd_device_has_current_tag() compatible with udev database generated by older udevd

4 years agoadd touchpad-edge-detect output for the Lenovo Thinkpad Extreme to evdev.hwdb
Lee Whalen [Thu, 26 Nov 2020 04:31:47 +0000 (20:31 -0800)] 
add touchpad-edge-detect output for the Lenovo Thinkpad Extreme to evdev.hwdb

4 years agoMerge pull request #17709 from yuwata/test-seccomp-skip
Yu Watanabe [Thu, 26 Nov 2020 00:31:10 +0000 (09:31 +0900)] 
Merge pull request #17709 from yuwata/test-seccomp-skip

test: skip several tests in test-seccomp when running under valgrind or ASAN

4 years agosd-device: make sd_device_has_current_tag() and friends compatible with database... 17622/head
Yu Watanabe [Mon, 16 Nov 2020 10:47:42 +0000 (19:47 +0900)] 
sd-device: make sd_device_has_current_tag() and friends compatible with database version 0

4 years agosd-device: introduce database version and save it in udev database V field
Yu Watanabe [Wed, 25 Nov 2020 21:23:14 +0000 (06:23 +0900)] 
sd-device: introduce database version and save it in udev database V field

4 years agosd-device: make device_add_property_internal() inline
Yu Watanabe [Mon, 16 Nov 2020 10:28:40 +0000 (19:28 +0900)] 
sd-device: make device_add_property_internal() inline

4 years agoman: slightly update the man page of sd_bus_message_read_basic()
Yu Watanabe [Wed, 25 Nov 2020 13:20:48 +0000 (22:20 +0900)] 
man: slightly update the man page of sd_bus_message_read_basic()

Follow-up for 73a1d7d2433edd1872ec53db3e804009298ebb1d.

4 years agoman: Fixed an incomplete sentence
igo95862 [Wed, 25 Nov 2020 13:15:33 +0000 (16:15 +0300)] 
man: Fixed an incomplete sentence

4 years agoman: Specify that sd_bus_message_read_basic returns 0 if end of array had been reached.
igo95862 [Wed, 25 Nov 2020 12:53:52 +0000 (15:53 +0300)] 
man: Specify that sd_bus_message_read_basic returns 0 if end of array had been reached.

4 years agodocs: document what VPNs should do to systemd-resolved.service
Lennart Poettering [Fri, 20 Nov 2020 11:33:16 +0000 (12:33 +0100)] 
docs: document what VPNs should do to systemd-resolved.service

Fixes: #17588 #17512
Prompted-by: #17529
(Also relevant: #6076)

4 years agocore/mount: mount command may fail after adding the corresponding proc mountinfo...
Yu Watanabe [Tue, 17 Nov 2020 00:13:59 +0000 (09:13 +0900)] 
core/mount: mount command may fail after adding the corresponding proc mountinfo entry

Hopefully fixes #17617.

4 years agoMerge pull request #17715 from yuwata/specifier-follow-ups
Zbigniew Jędrzejewski-Szmek [Wed, 25 Nov 2020 12:22:56 +0000 (13:22 +0100)] 
Merge pull request #17715 from yuwata/specifier-follow-ups

Sort specifiers

4 years agocryptsetup: use log_warning_errno() where we can, instead of log_warning()
Lennart Poettering [Tue, 24 Nov 2020 12:56:48 +0000 (13:56 +0100)] 
cryptsetup: use log_warning_errno() where we can, instead of log_warning()

4 years agoMerge pull request #17721 from poettering/more-strjoin-cryptsetup
Zbigniew Jędrzejewski-Szmek [Wed, 25 Nov 2020 12:20:42 +0000 (13:20 +0100)] 
Merge pull request #17721 from poettering/more-strjoin-cryptsetup

two minor fixes/clean-ups

4 years agomkosi: make sure our mkosi files work with f33
Lennart Poettering [Tue, 17 Nov 2020 17:35:08 +0000 (18:35 +0100)] 
mkosi: make sure our mkosi files work with f33

4 years agotest: skip several tests in test-seccomp when running on asan 17709/head
Yu Watanabe [Tue, 24 Nov 2020 12:07:42 +0000 (21:07 +0900)] 
test: skip several tests in test-seccomp when running on asan

4 years agotest: skip several tests in test-seccomp when running on valgrind
Yu Watanabe [Tue, 24 Nov 2020 11:58:07 +0000 (20:58 +0900)] 
test: skip several tests in test-seccomp when running on valgrind

4 years agoman: clarify DefaultTasksMax doc
Pavel Sapezhko [Wed, 18 Nov 2020 14:54:01 +0000 (17:54 +0300)] 
man: clarify DefaultTasksMax doc

4 years agounits: typo fix /proc/<pid>/exec → /proc/<pid>/exe 17721/head
Lennart Poettering [Wed, 25 Nov 2020 10:20:38 +0000 (11:20 +0100)] 
units: typo fix /proc/<pid>/exec → /proc/<pid>/exe

Fix a pretty relevant typo introduced in
c7faa23235694a1e803ba093cba6d6e0193a093e.

4 years agocryptsetup: use strjoin() for concatenating strings
Lennart Poettering [Wed, 4 Nov 2020 17:14:54 +0000 (18:14 +0100)] 
cryptsetup: use strjoin() for concatenating strings

4 years agounits: document why CAP_SYS_PTRACE is needed by journald
Franck Bui [Wed, 25 Nov 2020 08:47:46 +0000 (09:47 +0100)] 
units: document why CAP_SYS_PTRACE is needed by journald

4 years agotree-wide: fix typo
Yu Watanabe [Wed, 25 Nov 2020 04:50:58 +0000 (13:50 +0900)] 
tree-wide: fix typo

4 years agotree-wide: sort specifiers and move common comments to specifier.h 17715/head
Yu Watanabe [Wed, 25 Nov 2020 06:09:17 +0000 (15:09 +0900)] 
tree-wide: sort specifiers and move common comments to specifier.h

4 years agoman: sort specifiers alphabetically
Yu Watanabe [Wed, 25 Nov 2020 05:39:10 +0000 (14:39 +0900)] 
man: sort specifiers alphabetically

4 years agoman: add missing specifiers supported in [INSTALL] section
Yu Watanabe [Wed, 25 Nov 2020 05:38:50 +0000 (14:38 +0900)] 
man: add missing specifiers supported in [INSTALL] section

4 years agospecifiers: introduce common macros for generating specifier tables
Lennart Poettering [Fri, 20 Nov 2020 14:15:24 +0000 (15:15 +0100)] 
specifiers: introduce common macros for generating specifier tables

In many cases the tables are largely the same, hence define a common set
of macros to generate the common parts.

This adds in a couple of missing specifiers here and there, so is more
thant just refactoring: it actually fixes accidental omissions.

Note that some entries that look like they could be unified under these
macros can't really be unified, since they are slightly different. For
example in the DNSSD service logic we want to use the DNSSD hostname for
%H rather than the unmodified kernel one.

4 years agoMerge pull request #17706 from ddstreet/test-move-pam-systemd-user
Michael Biebl [Tue, 24 Nov 2020 20:45:12 +0000 (21:45 +0100)] 
Merge pull request #17706 from ddstreet/test-move-pam-systemd-user

test/test-functions: copy /usr/lib/pam.d into $initdir

4 years agoNEWS: mention that we intend to retrigger udev devices on package upgrade
Lennart Poettering [Tue, 24 Nov 2020 15:07:39 +0000 (16:07 +0100)] 
NEWS: mention that we intend to retrigger udev devices on package upgrade

Also, mention RISCV GPT partition types have been defined.

4 years agopam_systemd_home: export password as PAM_AUTHTOK
Christoph Ruegge [Mon, 23 Nov 2020 17:06:36 +0000 (18:06 +0100)] 
pam_systemd_home: export password as PAM_AUTHTOK

4 years agoMerge pull request #17680 from yuwata/udev-link-mac-address
Lennart Poettering [Tue, 24 Nov 2020 16:42:45 +0000 (17:42 +0100)] 
Merge pull request #17680 from yuwata/udev-link-mac-address

udev: to make MACAddress= take effect, MACAddressPolicy= must be "none"

4 years agoseccomp: also move munmap into @default syscall filter set
Yu Watanabe [Tue, 24 Nov 2020 09:47:37 +0000 (18:47 +0900)] 
seccomp: also move munmap into @default syscall filter set

Follow-up for 5abede3247591248718026cb8be6cd231de7728b.

4 years agosd-device-enumerator: do not return error when a device is removed
INSUN PYO [Thu, 19 Nov 2020 01:49:04 +0000 (10:49 +0900)] 
sd-device-enumerator: do not return error when a device is removed

If /sys/class/OOO node is created and destroyed during booting (kernle driver initialization fails),
systemd-udev-trigger.service fails due to race condition.

***** race condition ***********************************************************************************
 1. kernel driver create /sys/class/OOO
 2. systemd-udev-trigger.service execues "/usr/bin/udevadm trigger --type=devices --action=add"

 3. device_enumerator_scan_devices() => enumerator_scan_devices_all() => enumerator_scan_dir("class") =>
    opendir("/sys/class") and iterate all subdirs ==> enumerator_scan_dir_and_add_devices("/sys/class/OOO")

 4. kernel driver fails and destroy /sys/class/OOO
 5. enumerator_scan_dir_and_add_devices("/sys/class/OOO") fails in opendir("/sys/class/OOO")

 6. "systemd-udev-trigger.service" fails
 7. udev coldplug fails and some device units not ready
 8. mount units asociated with device units fail
 9. local-fs.target fails
 10. enters emergency mode
********************************************************************************************************

***** status of systemd-udev-trigger.service unit ******************************************************
$ systemctl status systemd-udev-trigger.service
 systemd-udev-trigger.service - udev Coldplug all Devices
   Loaded: loaded (/usr/lib/systemd/system/systemd-udev-trigger.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-01-02 13:16:54 KST; 22min ago
     Docs: man:udev(7)
           man:systemd-udevd.service(8)
  Process: 2162 ExecStart=/usr/bin/udevadm trigger --type=subsystems --action=add (code=exited, status=0/SUCCESS)
  Process: 2554 ExecStart=/usr/bin/udevadm trigger --type=devices --action=add (code=exited, status=1/FAILURE)
  Main PID: 2554 (code=exited, status=1/FAILURE)

  Jan 02 13:16:54 localhost udevadm[2554]: Failed to scan devices: No such file or directory
  Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Main process exited, code=exited, status=1/FAILURE
  Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Failed with result 'exit-code'.
  Jan 02 13:16:54 localhost systemd[1]: Failed to start udev Coldplug all Devices.
*******************************************************************************************************

***** journal log with Environment=SYSTEMD_LOG_LEVEL=debug in systemd-udev-trigger.service  ***********
  Jan 01 21:57:20 localhost udevadm[2039]: sd-device-enumerator: Scanning /sys/bus
  Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scan all dirs
  Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/bus
  Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/class
  Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Failed to scan /sys/class: No such file or directory
  Jan 01 21:57:21 localhost udevadm[2522]: Failed to scan devices: No such file or directory
*******************************************************************************************************

4 years agokernel-install: drop redundant "/"
Yu Watanabe [Fri, 20 Nov 2020 09:25:06 +0000 (18:25 +0900)] 
kernel-install: drop redundant "/"

Follow-up for 1cdbff1c844ce46f1d84d8feeed426ebfd550988.

After the commit 1cdbff1c844ce46f1d84d8feeed426ebfd550988, each entry .conf contains
redundant slash like the following:
```
$ cat xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-5.9.8-200.fc33.x86_64.conf
title      Fedora 33 (Thirty Three)
version    5.9.8-200.fc33.x86_64
machine-id xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
options    root=/dev/nvme0n1p2 ro rootflags=subvol=system/fedora selinux=0 audit=0
linux      //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/5.9.8-200.fc33.x86_64/linux
initrd     //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/5.9.8-200.fc33.x86_64/initrd
```

4 years agoman: bootctl set-default/oneshot accept an empty string
Yu Watanabe [Fri, 20 Nov 2020 09:43:13 +0000 (18:43 +0900)] 
man: bootctl set-default/oneshot accept an empty string

4 years agoRevert "semaphore: temporarily explicitly use the US image mirror"
Frantisek Sumsal [Thu, 29 Oct 2020 14:29:29 +0000 (15:29 +0100)] 
Revert "semaphore: temporarily explicitly use the US image mirror"

This reverts commit 9ac47d926146ed177aef805bba75f07bd3ed8643.

4 years agotest/test-functions: copy /usr/lib/pam.d into $initdir 17706/head
Dan Streetman [Fri, 20 Nov 2020 18:41:03 +0000 (13:41 -0500)] 
test/test-functions: copy /usr/lib/pam.d into $initdir

The systemd-user file has been moved from /etc/pam.d into /usr/lib/pam.d,
so test-functions needs to copy it from /usr/lib/pam.d instead.

This will copy it from either location.

4 years agounit: update comment about OOM score
Yu Watanabe [Fri, 20 Nov 2020 08:16:44 +0000 (17:16 +0900)] 
unit: update comment about OOM score

Follow-up for 6b2229c6c60d0486f5eb9ed3088f9c780d7c0233.

4 years agoMerge pull request #17669 from yuwata/coccinelle-update
Lennart Poettering [Mon, 23 Nov 2020 21:19:52 +0000 (22:19 +0100)] 
Merge pull request #17669 from yuwata/coccinelle-update

tree-wide: shorten code a bit suggested by coccinelle

4 years agoMerge pull request #17676 from yuwata/lgtm-fixes
Lennart Poettering [Mon, 23 Nov 2020 21:18:28 +0000 (22:18 +0100)] 
Merge pull request #17676 from yuwata/lgtm-fixes

tree-wide: several fixes prompted by LGTM