systemd/.git
4 years agotest-network: add a testcase for ManageForeignRoutes=no
Yu Watanabe [Mon, 12 Jul 2021 07:36:55 +0000 (16:36 +0900)]
test-network: add a testcase for ManageForeignRoutes=no

(cherry picked from commit 1d26d4cd140e939babf83425cdcaef4ca4bc82ce)

4 years agonetwork: also check addresses when determine a gateway address is reachable or not
Yu Watanabe [Mon, 12 Jul 2021 06:46:44 +0000 (15:46 +0900)]
network: also check addresses when determine a gateway address is reachable or not

Fixes #20201.

(cherry picked from commit 11046cea1414c70b5d7aab37ea88d5a839cbd209)

4 years agonetwork: ignore errors on unsetting master ifindex v249.3
Yu Watanabe [Wed, 4 Aug 2021 15:10:52 +0000 (00:10 +0900)]
network: ignore errors on unsetting master ifindex

Fixes #20241.

(cherry picked from commit c347a98272bd1b81682c266b9720fad107b96ab0)

4 years agonetwork: ignore errors on setting bridge config
Yu Watanabe [Wed, 4 Aug 2021 04:53:21 +0000 (13:53 +0900)]
network: ignore errors on setting bridge config

For some setups, kernel refuses to set bridge configs with -EOPNOTSUPP.
See kernel's rtnl_bridge_setlink() in net/core/rtnetlink.c.

Fixes #20373.

(cherry picked from commit 1171f3f030319155914c2bb90655f46653f88cbf)

4 years agonetwork: add comments
Yu Watanabe [Wed, 4 Aug 2021 04:52:52 +0000 (13:52 +0900)]
network: add comments

(cherry picked from commit 17d808a8bf55471009f5e0e1ccb06b1ffccdfa1a)

4 years agocore: wrap cgroup path with empty_to_root() in log messages
Yu Watanabe [Wed, 4 Aug 2021 18:14:41 +0000 (03:14 +0900)]
core: wrap cgroup path with empty_to_root() in log messages

This fixes e.g. the following log message:
---
systemd[1]: -.slice: Failed to migrate controller cgroups from , ignoring: Read-only file system
---

(cherry picked from commit 6178e2f88956e1900f445908ed053865cc22e879)

4 years agocore/cgroup: fix error handling of cg_remove_xattr()
Yu Watanabe [Wed, 4 Aug 2021 18:13:48 +0000 (03:13 +0900)]
core/cgroup: fix error handling of cg_remove_xattr()

(cherry picked from commit 0cddb53c85588fbfb8043f622895c7bd15819198)

4 years agosd-netlink: always append new bridge FDB entries
Yu Watanabe [Wed, 4 Aug 2021 09:16:44 +0000 (18:16 +0900)]
sd-netlink: always append new bridge FDB entries

This partially reverts 192a9d95ea3e058afd824d38a9cea16ad0a84a57 (#19432).

Fixes #20305.

(cherry picked from commit 74c1ab841fbad9d4f237c819577fcd1d46a072b6)

4 years agomkosi: Fix openSUSE Jinja2 package name
Michal Koutný [Thu, 10 Jun 2021 12:39:13 +0000 (14:39 +0200)]
mkosi: Fix openSUSE Jinja2 package name

Dare to be different ¯\_(ツ)_/¯

(cherry picked from commit ed802c44da7918ba1c14944b711a20b14d9e0fd4)

4 years agomkosi: openSUSE update --bootable=no dependencies
Michal Koutný [Fri, 12 Feb 2021 17:11:18 +0000 (18:11 +0100)]
mkosi: openSUSE update --bootable=no dependencies

Since we can build --bootable=no images without dracut->systemd, we need
to add systemd runtime dependencies explicitely.

(cherry picked from commit f2bb8857cd093eb9bd5e1dad6fb996a0a4463556)

4 years agonetwork: use address_equal()/route_equal() to compare addresses or routes configured...
Yu Watanabe [Wed, 4 Aug 2021 04:14:03 +0000 (13:14 +0900)]
network: use address_equal()/route_equal() to compare addresses or routes configured by NDisc

Fixes #20244.

(cherry picked from commit 10e417b3eac03c1bcd0b5f3d5c24291ac644e164)

4 years agoman: describe veritysetup command syntax
Zbigniew Jędrzejewski-Szmek [Sat, 31 Jul 2021 07:16:52 +0000 (09:16 +0200)]
man: describe veritysetup command syntax

It makes it easier to diagnose what the generated units actually do.

(cherry picked from commit d53285d551d883bb9f097eca0942e8c585e33470)

4 years agoveritysetup: print help for --help/-h/help
Zbigniew Jędrzejewski-Szmek [Sat, 31 Jul 2021 07:00:11 +0000 (09:00 +0200)]
veritysetup: print help for --help/-h/help

In general our commands print help on --help, but here this would trigger
the error that two arguments are needed. Let's make this more user-friendly.

(cherry picked from commit 5d5e43cc33637a12f743f17294cfbd3ede08a1b3)

4 years agoUse correct `<poll.h>` include
David Seifert [Mon, 2 Aug 2021 14:09:10 +0000 (16:09 +0200)]
Use correct `<poll.h>` include

* `<sys/poll.h>` is not specified in POSIX

(cherry picked from commit 2b6c0bb2a341c95223ce672249e43c743b03d78c)

4 years agoUse correct `<fcntl.h>` include
David Seifert [Mon, 2 Aug 2021 10:41:38 +0000 (12:41 +0200)]
Use correct `<fcntl.h>` include

* `<sys/fcntl.h>` is not specified in POSIX

(cherry picked from commit f8d54f7810aeea5ff27a5db03e1aab7ea54c8268)

4 years agotest: correctly detect ASan on s390x
Frantisek Sumsal [Thu, 29 Jul 2021 16:44:51 +0000 (18:44 +0200)]
test: correctly detect ASan on s390x

s390x uses BRAS(L) instead of CALL(Q), e.g.:

```
 1009528: c0 e5 ff ff f8 a0  brasl %r14,1008668 <__asan_report_load1@plt>
 10095f0: c0 e5 ff ff ea ec  brasl %r14,1006bc8 <__asan_stack_malloc_4@plt>
 10097f8: c0 e5 ff ff f8 f8  brasl %r14,10089e8 <__asan_report_load8@plt>
```

x86_64 for reference:

```
  4011f3: e8 48 fe ff ff        callq  401040 <__asan_report_load1@plt>
  401227: e8 24 fe ff ff        callq  401050 <__asan_report_load8@plt>
  401251: e8 da fd ff ff        callq  401030 <__asan_init@plt>
```

(cherry picked from commit 8bf79f05532162d19fe6ee211297cff81b4f9874)

4 years agosystemctl: allow set-property to be called with a glob pattern
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jul 2021 10:57:10 +0000 (12:57 +0200)]
systemctl: allow set-property to be called with a glob pattern

We call "systemctl set-property … Markers=+needs-restart" and this should
also work for globs, e.g. "user@*.service" or "syncthing@*.service".

https://bugzilla.redhat.com/show_bug.cgi?id=1986258
(cherry picked from commit 23a0ffa59f9cb26c4b016c9fd1a3a70da2607f61)

4 years agoman/systemctl: rework descriptions of bind and mount-image
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:42:09 +0000 (09:42 +0200)]
man/systemctl: rework descriptions of bind and mount-image

The text used "unit's view" to mean mount namespace. But we talk about
mount namespaces in the later part of the paragraph anyway, so trying to
use an "approachable term" only makes the whole thing harder to understand.
Let's use the precise term.

Some paragraph-breaking and re-indentation is done too.

(cherry picked from commit e04eae5e1c43c050e0707d3fcfdc16691b761d61)

4 years agoman/tmpfiles.d: rewrite the description of age-by
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:39:39 +0000 (09:39 +0200)]
man/tmpfiles.d: rewrite the description of age-by

(cherry picked from commit dab1fe1a8e4d47784b6bf7b440d4b3ba6e70940d)

4 years agoman: use title of docs/ pages when referring to them
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:39:19 +0000 (09:39 +0200)]
man: use title of docs/ pages when referring to them

There is some inconsistency, partially caused by the awkward naming
of the docs/ pages. But let's be consistent and use the "official" title.
If we ever change plural↔singular, we should use the same form everywhere.

(cherry picked from commit d6029680df7c4991e37662467668816a83c0b806)

4 years agoman: fix assorted issues reported by the manpage-l10n project
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:37:29 +0000 (09:37 +0200)]
man: fix assorted issues reported by the manpage-l10n project

Fixes #20297.

(cherry picked from commit be0d27ee0c2a2cce39490b8cfc0e7d995fbd7644)

4 years agoseccomp: move sched_getaffinity() from @system-service to @default
Lennart Poettering [Tue, 27 Jul 2021 15:11:09 +0000 (17:11 +0200)]
seccomp: move sched_getaffinity() from @system-service to @default

See: https://github.com/systemd/systemd/pull/20191#issuecomment-881982739

In general, we shouldn't blanket move syscalls like this into @default,
given that glibc actually does have fallbacks, afaics. However, as
long as the syscalls are "read-only" and thus benign, I figure it's a
safe thing to do. But we should probably stick to a "if in doubt, don't"
rule, and put these syscalls in @system-service as default, but not into
@default.

I think in the real world @system-service is the sensible group people
should use, and not @default actually.

(cherry picked from commit 7df660e45682af5c40a236abe1bdc5ddcf3b3533)

4 years agoseccomp: drop getrandom() from @system-service
Lennart Poettering [Tue, 27 Jul 2021 15:10:21 +0000 (17:10 +0200)]
seccomp: drop getrandom() from @system-service

It's included in @default now, since
14f4b1b568907350d023d1429c1aa4aaa8925f22, and since @system-service
pulls that in we can drop it from @system-service.

Follow-up for #20191

(cherry picked from commit 67347f37407489a68e12da8f75b78ae1d1168de9)

4 years agonetworkd: Include linux/netdevice.h header
Khem Raj [Mon, 26 Jul 2021 17:58:46 +0000 (10:58 -0700)]
networkd: Include linux/netdevice.h header

This header provides definitions for NET_NAME_UNKNOWN ånd NET_NAME_ENUM
Fixes build issue found with non-glibc systems

../git/src/network/networkd-link.c:1203:52: error: 'NET_NAME_UNKNOWN' undeclared (first use in this function)

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

4 years agotest: make sure we don't access an unbound variable
Frantisek Sumsal [Fri, 23 Jul 2021 10:53:31 +0000 (12:53 +0200)]
test: make sure we don't access an unbound variable

```
testsuite-60.sh[759]: + grep -q '(mount-monitor-dispatch) entered rate limit'
testsuite-60.sh[571]: + sleep 5
testsuite-60.sh[761]: ++ date -u +%s
testsuite-60.sh[571]: + [[ 1627037066 -le 1627037061 ]]
testsuite-60.sh[571]: /usr/lib/systemd/tests/testdata/units/testsuite-60.sh: line 41: entered_rl: unbound variable
```

(cherry picked from commit f571d9d5f051f7dbaee8d0dbf32e5a93180285e9)

4 years agoman: Fix incorrect EFI vendor UUID (last missing nibble)
ratijas [Fri, 23 Jul 2021 10:32:52 +0000 (13:32 +0300)]
man: Fix incorrect EFI vendor UUID (last missing nibble)

(cherry picked from commit d2e84b601805ae89cf8cb1b383b30c7c97cac73d)

4 years agodiscover-image: mount as read-only when extracting metadata
Luca Boccassi [Thu, 22 Jul 2021 21:21:10 +0000 (22:21 +0100)]
discover-image: mount as read-only when extracting metadata

We don't need to modify the image, and the loopback device is already set to read-only.

(cherry picked from commit f6f4ec7951f429e8a470f8912cbeacde8fa1206e)

4 years agomalloc() uses getrandom now
Cristian Rodríguez [Fri, 9 Jul 2021 21:19:05 +0000 (17:19 -0400)]
malloc() uses getrandom now

glibc master uses getrandom in malloc since https://sourceware.org/git/?p=glibc.git;a=commit;h=fc859c304898a5ec72e0ba5269ed136ed0ea10e1  ,  getrandom should be in the default set so to avoid all non trivial programs to fallback to a PRNG.

(cherry picked from commit 14f4b1b568907350d023d1429c1aa4aaa8925f22)

4 years agomachined-varlink: fix double free
David Tardon [Mon, 2 Aug 2021 11:31:04 +0000 (13:31 +0200)]
machined-varlink: fix double free

Fixes: #18599
(cherry picked from commit feac9a1d1bf3f59adaa85f58b655ec01a111a29a)

4 years agocoredump/stacktrace.c: avoid crash on binaries without NHDR
Sergei Trofimovich [Sat, 31 Jul 2021 12:07:54 +0000 (13:07 +0100)]
coredump/stacktrace.c: avoid crash on binaries without NHDR

Observed as a crash on binaries built with gcc-master:

```
 3  0x00005573b8841d6a in parse_package_metadata (name=name@entry=0x5573b901a620 "/a", id_json=0x0,
    elf=0x5573b9028730, c=c@entry=0x7fffc688f790) at ../systemd-stable-249.2/src/coredump/stacktrace.c:157
 4  0x00005573b884209e in module_callback (mod=0x7fffc688f6c0, userdata=<optimized out>,
    name=0x5573b901a620 "/a", start=<optimized out>, arg=0x7fffc688f790)
    at ../systemd-stable-249.2/src/coredump/stacktrace.c:306
 5  0x00007f56d60dcbd5 in dwfl_getmodules (dwfl=0x5573b901fda0,
    callback=callback@entry=0x5573b8841eb0 <module_callback>, arg=arg@entry=0x7fffc688f790, offset=offset@entry=0)
    at ../../elfutils-0.185/libdwfl/dwfl_getmodules.c:86
 6  0x00005573b884231b in parse_core (ret_package_metadata=0x7fffc688f848, ret=0x7fffc688f850,
    executable=0x7fffc688f790 "\200\332\001\271sU", fd=21) at ../systemd-stable-249.2/src/coredump/stacktrace.c:366
 7  coredump_parse_core (fd=fd@entry=6, executable=0x7fffc688f790 "\200\332\001\271sU", ret=ret@entry=0x7fffc688f850,
    ret_package_metadata=ret_package_metadata@entry=0x7fffc688f848)
    at ../systemd-stable-249.2/src/coredump/stacktrace.c:406
 8  0x00005573b883f897 in submit_coredump (context=context@entry=0x7fffc688fa10, iovw=iovw@entry=0x7fffc688f990,
    input_fd=input_fd@entry=5) at ../systemd-stable-249.2/src/coredump/coredump.c:827
 9  0x00005573b883d339 in process_socket (fd=3) at ../systemd-stable-249.2/src/coredump/coredump.c:1041
 10 run (argv=<optimized out>, argc=-964101648) at ../systemd-stable-249.2/src/coredump/coredump.c:1416
 11 main (argc=-964101648, argv=<optimized out>) at ../systemd-stable-249.2/src/coredump/coredump.c:1422
```

Happens only on enabled elfutils symbolizer.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
(cherry picked from commit 1da3eef262078905ec14c707eeab655a17ae8bd2)

4 years agoman: document nss-{resolve,myhostname} resolving in the other direction, too v249.2
Florian Klink [Sat, 17 Jul 2021 17:49:42 +0000 (19:49 +0200)]
man: document nss-{resolve,myhostname} resolving in the other direction, too

(cherry picked from commit 946f7ce32cef44d9bfcf2dc594bb193341434f57)

4 years agoman: stop recommending putting myhostname after dns
Florian Klink [Thu, 1 Jul 2021 20:11:27 +0000 (22:11 +0200)]
man: stop recommending putting myhostname after dns

nss-resolve also looks in /etc/hosts, and has the same local hostname
resolving logic as nss-myhostname. We shouldn't recommend another order
than nss-resolve uses internally.

When nss-resolve is used, there's no possibility to override
nss-myhostname hosts via DNS *anyway*.

On top of that, it's not a good idea to allow DNS to override local
hostnames as all - at least not something we should advertise in the
docs.

Followup of f918c67d38ba6ccd4eb0dc657f3f3155e5010cae /
https://github.com/systemd/systemd/pull/16754.

(cherry picked from commit ce266330fc3bd6767451ac3400336cd9acebe9c1)

4 years agopid1: propagate the original command line when reexecuting
Zbigniew Jędrzejewski-Szmek [Thu, 22 Jul 2021 06:21:46 +0000 (08:21 +0200)]
pid1: propagate the original command line when reexecuting

When we reexec the manager in a container, we lose configuration settings on
the kernel command line:

  $ systemd-nspawn -M rawhide -b systemd.status-unit-format=name systemd.show-status=yes
  ...
  # tr '\0' ' ' </proc/1/cmdline
  /usr/lib/systemd/systemd systemd.status_unit_format=combined systemd.show-status=yes
  # sudo systemctl daemon-reexec
  # tr '\0' ' ' </proc/1/cmdline
  /usr/lib/systemd/systemd --system --deserialize 20

  This means that after daemon-reexec, the settings that we gain from the
  commandline are reset to defaults.

So let's reeexecute with the original arguments copied over, modulo some
filtering.

(cherry picked from commit 846f1da465beda990c1c01346311393f485df467)

4 years agosd-bus: fix missing initializer in SD_BUS_VTABLE_END (#20253)
Matthijs van Duin [Wed, 21 Jul 2021 09:10:36 +0000 (11:10 +0200)]
sd-bus: fix missing initializer in SD_BUS_VTABLE_END (#20253)

When two fields were added to the vtable.x.start struct, no initializers
for these were added to SD_BUS_VTABLE_END which also (ab)used that
struct (albeit sneakily by using non-designated initialization).

While C tolerates this, C++ prohibits these missing initializers, and
both g++ and clang++ will complain when using -Wextra.

This patch gives SD_BUS_VTABLE_END its own case in the union and
clarifies its initialization.

I tested the behaviour of g++ 10.2 and clang 11 in various cases. Both will warn
(-Wmissing-field-initializers, implied by -Wextra) if you provide initializers for some
but not all fields of a struct. Declaring x.end as empty struct or using an empty initializer
{} to initialize the union or one of its members is valid C++ but not C, although both gcc
and clang accept it without warning (even at -Wall -Wextra -std=c90/c++11) unless you
use -pedantic (which requires -std=c99/c++2a to support designated initializers).

Interestingly, .x = { .start = { 0, 0, NULL } } is the only initializer I found for the union
(among candidates for SD_BUS_VTABLE_END) where gcc doesn't zero-fill it entirely
when allocated on stack, it looked like it did in all other cases (I only examined this on
32-bit arm). clang always seems to initialize all bytes of the union.

[zjs: test case:
$ cat vtable-test.cc
#include "sd-bus.h"

const sd_bus_vtable vtable[] = {
   SD_BUS_VTABLE_END
};

$ g++ -I src/systemd/ -Wall -Wmissing-field-initializers -c vtable-test.cc
vtable-test.cc:5:1: warning: missing initializer for member ‘sd_bus_vtable::<unnamed union>::<unnamed struct>::features’ [-Wmissing-field-initializers]
    5 | };
      | ^
vtable-test.cc:5:1: warning: missing initializer for member ‘sd_bus_vtable::<unnamed union>::<unnamed struct>::vtable_format_reference’ [-Wmissing-field-initializers]

$ clang++ -I src/systemd/ -Wmissing-field-initializers -c vtable-test.cc
vtable-test.cc:4:4: warning: missing field 'features' initializer [-Wmissing-field-initializers]
   SD_BUS_VTABLE_END
   ^
src/systemd/sd-bus-vtable.h:188:28: note: expanded from macro 'SD_BUS_VTABLE_END'
                .x = { { 0 } },                                         \
                           ^
1 warning generated.

Both warnings are gone with the patch.]

(cherry picked from commit 654eaa403070d3c897454a5190603fda4071c3ff)

4 years agohwdb: 60-keyboard::remove hardcoded definition for KEYBOARD_KEY_56 for MSI Prestige...
Aakash Singh [Mon, 19 Jul 2021 18:57:48 +0000 (00:27 +0530)]
hwdb: 60-keyboard::remove hardcoded definition for  KEYBOARD_KEY_56 for MSI Prestige And  Modern

(cherry picked from commit 30c9faff0d74ceb0cbafb8ecdd8573bc479984dc)

4 years agobasic/unit-name: do not use strdupa() on a path v249.1
Zbigniew Jędrzejewski-Szmek [Wed, 23 Jun 2021 09:46:41 +0000 (11:46 +0200)]
basic/unit-name: do not use strdupa() on a path

The path may have unbounded length, for example through a fuse mount.

CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and
ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo
and each mountpoint is passed to mount_setup_unit(), which calls
unit_name_path_escape() underneath. A local attacker who is able to mount a
filesystem with a very long path can crash systemd and the whole system.

https://bugzilla.redhat.com/show_bug.cgi?id=1970887

The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we
can't easily check the length after simplification before doing the
simplification, which in turns uses a copy of the string we can write to.
So we can't reject paths that are too long before doing the duplication.
Hence the most obvious solution is to switch back to strdup(), as before
7410616cd9dbbec97cf98d75324da5cda2b2f7a2.

(cherry picked from commit 441e0115646d54f080e5c3bb0ba477c892861ab9)

4 years agoMinor typo (#20254)
rene [Tue, 20 Jul 2021 05:45:04 +0000 (15:45 +1000)]
Minor typo (#20254)

Correct resoulution with resolution.

(cherry picked from commit b838bc11268ea461e8c58ce69e2f781be1821aa1)

4 years agoshell-completion/zsh/_systemd-run: Fix completion of command names and arguments
duament [Sat, 17 Jul 2021 17:17:41 +0000 (01:17 +0800)]
shell-completion/zsh/_systemd-run: Fix completion of command names and arguments

(cherry picked from commit 3f49d1faf59acaa85aa5ad502c39b1a601d58d26)

4 years agoman/systemd.network: Fix duplicate Xfrm description
Raul Tambre [Wed, 14 Jul 2021 11:58:31 +0000 (14:58 +0300)]
man/systemd.network: Fix duplicate Xfrm description

It's already listed along with others (Tunnel, VLAN, etc.) and its description matches those. The duplication was introduced by commit c3006a485c9c35c0ab947479ff1dd7149fda9750.

(cherry picked from commit 534b5abce12847abc896fba24cafb99c101a2987)

4 years agoshared/format-table: allocate buffer of sufficient size
Zbigniew Jędrzejewski-Szmek [Mon, 5 Jul 2021 19:29:11 +0000 (21:29 +0200)]
shared/format-table: allocate buffer of sufficient size

(cherry picked from commit 6dc57047ff0f1f9e98938ffb172dae06e6868b94)

4 years agohomed: allow systemd-homed access to FIDO2 devices
Gibeom Gwon [Mon, 12 Jul 2021 17:57:43 +0000 (02:57 +0900)]
homed: allow systemd-homed access to FIDO2 devices

Add DeviceAllow= option for FIDO2 devices in systemd-homed.service.

(cherry picked from commit 85e424c0c852fcb92d108494a6efa9dd0ce943b2)

4 years agosystemctl: show error when help for unknown unit is requested
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jul 2021 10:32:39 +0000 (12:32 +0200)]
systemctl: show error when help for unknown unit is requested

Fixes #20189. We would only log at debug level and return failure, which looks
like a noop for the user.

('help' accepts multiple arguments and will show multiple concatenated man
pages in that case. Actually, it will also show multiple concatenated man pages
if the Documentation= setting lists multiple pages. I don't think it's very
terribly useful, but, meh, I don't think we can do much better. If a user
requests a help for a two services, one known and one unknown, there'll now be
a line in the output. It's not very user friendly, but not exactly wrong too.)

(cherry picked from commit 75312ada5324d8adae3f3a0ed97f0acfc8b8bde5)

4 years agoUpdated manpage for sd_bus_set_property
Ben Stockett [Fri, 9 Jul 2021 20:29:36 +0000 (20:29 +0000)]
Updated manpage for sd_bus_set_property

Updated manpage for sd_bus_set_property and sd_bus_set_propertyv. In the old manpage, these functions included the parameter sd_bus_message **reply when the actual function had no such argument.

(cherry picked from commit 4226dfafbac2167e1441a7a65d00c29c5016d4fb)

4 years agoFixed typo (#20187)
nassir90 [Fri, 9 Jul 2021 20:16:02 +0000 (21:16 +0100)]
Fixed typo (#20187)

* Fixed typo

Before, the file claimed that some systemd units are created "from other
configuration". It should have read "from other configuration files".

Co-authored-by: Nozz <nozolo90@gmail.com>
(cherry picked from commit a814eae728a5e238e39d4a9d952ce8e309fa38fd)

4 years agotest: strip binaries by default
Frantisek Sumsal [Fri, 9 Jul 2021 12:59:11 +0000 (14:59 +0200)]
test: strip binaries by default

Since 23f8e01 we always kept binaries unstripped, since $STRIP_BINARIES
is unset by default.

(cherry picked from commit e68e473ba2d6383155c49337c3c5f2c0d3fb0b5f)

4 years agotest: bump the test timeout to give ldconfig.service enough time to finish
Frantisek Sumsal [Fri, 9 Jul 2021 12:44:38 +0000 (14:44 +0200)]
test: bump the test timeout to give ldconfig.service enough time to finish

Sometimes the ldconfig.service might take a bit longer to finish,
causing spurious test timeouts:

```
[ 1025.858923] systemd[24]: ldconfig.service: Executing: /sbin/ldconfig -X
...
[ 1043.883620] systemd[1]: ldconfig.service: Main process exited, code=exited, status=0/SUCCESS (success)
...
Trying to halt container. Send SIGTERM again to trigger immediate
termination.
Container TEST-52-HONORFIRSTSHUTDOWN terminated by signal KILL.
E: Test timed out after 20s
```

(cherry picked from commit 7fb4ee7aa5b6ffdf2e1e8e50a18630aa30f16505)

4 years agodocs: improve wording when mentioning the acronym "ESP"
nl6720 [Fri, 9 Jul 2021 09:56:54 +0000 (12:56 +0300)]
docs: improve wording when mentioning the acronym "ESP"

"ESP" is "EFI system partition", so "ESP partition" is redundant.

(cherry picked from commit 250db1bf02b9fd73f2e0604acddbc20937c67d19)

4 years agohostnamed: correct variable with errno in fallback_chassis
Jan Palus [Wed, 7 Jul 2021 22:23:21 +0000 (00:23 +0200)]
hostnamed: correct variable with errno in fallback_chassis

fixes assertion failure on arm:

systemd-hostnamed[642]: Assertion '(_error) != 0' failed at src/hostname/hostnamed.c:207, function fallback_chassis(). Aborting.

(cherry picked from commit 105a4245ff13d588e1e848e8ee3cffd6185bd0ae)
(cherry picked from commit 4a44597bdd725f504ebd520b0deef7797dc46daa)

4 years agoNEWS: finalize for v249 v249
Luca Boccassi [Wed, 7 Jul 2021 16:32:01 +0000 (17:32 +0100)]
NEWS: finalize for v249

4 years agoprocess-util: explicitly handle processes lacking parents in get_process_ppid()
Lennart Poettering [Wed, 7 Jul 2021 13:57:51 +0000 (15:57 +0200)]
process-util: explicitly handle processes lacking parents in get_process_ppid()

Let's make sure we signal out-of-band via an error message if a process
doesn't have a parent process whose PID we could return. Otherwise we'll
too likely hide errors, as we return an invalid PID 0, which in other
contexts has special meaning (i.e. usually "myself").

Replaces: #20153

This is based on work by @dtardon, but goes a different route, by
ensuring we propagate a proper error in this case.

This modernizes the function in question a bit in other ways, i.e.
renames stuff and makes the return parameter optional.

4 years agoMerge pull request #20145 from bluca/prep
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 13:28:15 +0000 (15:28 +0200)]
Merge pull request #20145 from bluca/prep

Preparations for v249

4 years agoRevert "Add systemd-resolve backwards compatibility section to resolvectl docs"
Lennart Poettering [Wed, 30 Jun 2021 16:45:32 +0000 (18:45 +0200)]
Revert "Add systemd-resolve backwards compatibility section to resolvectl docs"

This reverts commit 9fcfc0470df856c870dcfc6df78bfbc714da6bd2.

4 years agomeson: install the right README file in modprobe.d
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 10:39:33 +0000 (12:39 +0200)]
meson: install the right README file in modprobe.d

We put the "global" README file there. Introduced
in d83e90c73cf25a839f5e60f355baa0d38364ff41.

4 years agobasic/time-util: fix errno name
Zbigniew Jędrzejewski-Szmek [Fri, 2 Jul 2021 08:53:40 +0000 (10:53 +0200)]
basic/time-util: fix errno name

Fixup for bdaeafea5dff32ccb479ecf8fe0a3173c995fbf5. This was supposed to be
pushed in an updated version, but I forgot to stage the change.

4 years agoman: fix systemd-sleep.conf.xml whitespace
Luca Boccassi [Wed, 7 Jul 2021 09:32:35 +0000 (10:32 +0100)]
man: fix systemd-sleep.conf.xml whitespace

Follow-up for 33f899bd479534b0a920ce427cdf06739028f5ab

4 years agoNEWS: note new user-visible change, drop 'in spe'
Luca Boccassi [Tue, 6 Jul 2021 21:53:49 +0000 (22:53 +0100)]
NEWS: note new user-visible change, drop 'in spe'

4 years agoNEWS: update contributors list
Luca Boccassi [Tue, 6 Jul 2021 21:45:02 +0000 (22:45 +0100)]
NEWS: update contributors list

Added Alexey Rubtsov, Icenowy Zheng, milaq, qhill, Trent Piepho,
Hamish Moffatt

4 years agohwdb: run ninja -C build update-hwdb update-hwdb-autosuspend
Luca Boccassi [Tue, 6 Jul 2021 21:36:04 +0000 (22:36 +0100)]
hwdb: run ninja -C build update-hwdb update-hwdb-autosuspend

4 years agoClarify the behaviour of suspend-then-sleep mode in the manual pages.
Hamish Moffatt [Mon, 5 Jul 2021 09:06:15 +0000 (19:06 +1000)]
Clarify the behaviour of suspend-then-sleep mode in the manual pages.

Fixes #20125.

4 years agowait-online: fix typo
Yu Watanabe [Tue, 6 Jul 2021 23:42:15 +0000 (08:42 +0900)]
wait-online: fix typo

4 years agoNEWS: add old entry about Type=ether
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 07:26:12 +0000 (09:26 +0200)]
NEWS: add old entry about Type=ether

Apparently it's an important feature for some folks:
https://utcc.utoronto.ca/\~cks/space/blog/linux/NetworkdMACMatchesWidely.
I think we considered this more of a bugfix, but it's somewhere on the border.
Let's add this it's easier to discover.

4 years agooomd: don't collect candidate stats on every interval
Anita Zhang [Tue, 6 Jul 2021 09:46:13 +0000 (02:46 -0700)]
oomd: don't collect candidate stats on every interval

cb13961ada52c1b27f6d6c2c6e37a2901f01ed30 updated the oomd logic to
collect candidate data when a kill was about to happen. However there
was still a call left over in the main loop to collect candidate data on
every interval. Remove this since it's unneeded.

Fixes #20122

4 years agotmpfiles: fix borked assert
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jul 2021 14:41:28 +0000 (16:41 +0200)]
tmpfiles: fix borked assert

It seems that fd_set_perms() is always called after checking that
fd >= 0 (also when called as action() in glob_item_recursively()),
so it seems that the assertion really came from fd==0.

Fixes #20140.

Also three other similar cases are updated.

4 years agoman: correct return value of sd_bus_open_with_description
Luca Boccassi [Tue, 6 Jul 2021 11:55:30 +0000 (12:55 +0100)]
man: correct return value of sd_bus_open_with_description

Since https://github.com/systemd/systemd/commit/f4b2933ee7890e5d414ab266d8586f19027a2bd9
if a description is not set, sd_bus_open_with_description returns -ENXIO, but the
documnetation stated that it returned successfully with a NULL string.

4 years agoMerge pull request #20092 from fbuihuu/tag-xgi-z7z9-graphic-chip-as-master-of-seat...
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jul 2021 10:52:53 +0000 (12:52 +0200)]
Merge pull request #20092 from fbuihuu/tag-xgi-z7z9-graphic-chip-as-master-of-seat-take2

 login: XGI Z7/Z9 (XG20 core) graphic chip requires master-of-seat to…

4 years agoupdate TODO
Lennart Poettering [Mon, 5 Jul 2021 13:07:12 +0000 (15:07 +0200)]
update TODO

4 years agologin: use a hwdb entry for tagging Parallels' fb devices with 'master-of-seat' tag
Franck Bui [Fri, 2 Jul 2021 12:43:50 +0000 (14:43 +0200)]
login: use a hwdb entry for tagging Parallels' fb devices with 'master-of-seat' tag

This assumes that (vesa)fb driver is used as fallback.

4 years agologin: use a hwdb entry for tagging HyperV's fb devices with 'master-of-seat' tag
Franck Bui [Thu, 1 Jul 2021 19:34:34 +0000 (21:34 +0200)]
login: use a hwdb entry for tagging HyperV's fb devices with 'master-of-seat' tag

Graphic devices that don't do DRM and relies on fb devices are now listed in
hwdb. Dedicated udev rules are no more needed.

4 years agologin: XGI Z7/Z9 (XG20 core) graphic chip requires master-of-seat to be set
Franck Bui [Thu, 1 Jul 2021 10:30:29 +0000 (12:30 +0200)]
login: XGI Z7/Z9 (XG20 core) graphic chip requires master-of-seat to be set

This graphic chip doesn't have a DRM driver and fall back to vesa-framebuffer
driver.

Without this patch, users of such chip suddenly see their GUI broken without
any indication or reason of what happened (no error message). Hence this
regression is near to impossible to troubleshoot for end users. Such case was
reported https://bugzilla.opensuse.org/show_bug.cgi?id=1187154.

Rather than adding another exception in the udev rules to deal with such
HWs, they instead get their own hwdb file '60-seat.hwdb'.

4 years agohwdb: add resolution override for Pinebook Pro touchpad
Icenowy Zheng [Sun, 4 Jul 2021 09:20:25 +0000 (17:20 +0800)]
hwdb: add resolution override for Pinebook Pro touchpad

The Pinebook Pro touchpad returns a resolution data that is 2 times of
the real value, which makes libinput think the touchpad is only 1/4 the
real size.

Add a resolution override value for it, to allow libinput to calculate
the distance moved on it correctly.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
4 years agoMerge pull request #20098 from milaq/hwdb_logitech_additions
Yu Watanabe [Sun, 4 Jul 2021 23:10:11 +0000 (08:10 +0900)]
Merge pull request #20098 from milaq/hwdb_logitech_additions

hwdb: Additions and fixes to Logitech mice

4 years agotest: unify handling of boolean values
Frantisek Sumsal [Sun, 4 Jul 2021 10:21:23 +0000 (12:21 +0200)]
test: unify handling of boolean values

Let's unify handling of the boolean values throughout the test-functions
code, since we use 0/1, true/false, and yes/no almost randomly in many
places, so picking the right values during CI configuration can be a real
pain.

4 years agoTODO: reorder entries by component
Luca Boccassi [Sat, 3 Jul 2021 15:26:21 +0000 (16:26 +0100)]
TODO: reorder entries by component

Roughly reorder entries, without rewording anything, by component, so
that there's some structure to the text.
Only 3 lines are deleted: an empty line, 'External:' at the bottom since
it was merged with 'External:' at the top, and the weird last line:
'String is not UTF-8 clean, ignoring assignment' which was likely an error
from some editor

4 years agomkosi: initialize /usr/lib/os-release' IMAGE_ID + IMAGE_VERSION fields from build
Lennart Poettering [Fri, 2 Jul 2021 12:59:58 +0000 (14:59 +0200)]
mkosi: initialize /usr/lib/os-release' IMAGE_ID + IMAGE_VERSION fields from build

If it's passed into the build, use it, so that the mkosi build version
is propagated into the image itself.

4 years agotest: optionally, only save test journal for failing tests
Dan Streetman [Fri, 2 Jul 2021 14:38:14 +0000 (10:38 -0400)]
test: optionally, only save test journal for failing tests

Saving the journal for passing tests creates a huge amount of unneeded
data stored for each full test run. Add a env var to allow saving the
journal only for failed tests.

4 years agoMerge pull request #20108 from yuwata/network-fix-ndisc-and-dhcp6-issue-20050
Zbigniew Jędrzejewski-Szmek [Sat, 3 Jul 2021 07:17:29 +0000 (09:17 +0200)]
Merge pull request #20108 from yuwata/network-fix-ndisc-and-dhcp6-issue-20050

network: remove old addresses and routes after new ones are configured

4 years agohashmap: make sure hashmap_get_strv()+set_get_strv() work with a NULL object
Lennart Poettering [Fri, 2 Jul 2021 13:15:17 +0000 (15:15 +0200)]
hashmap: make sure hashmap_get_strv()+set_get_strv() work with a NULL object

Before we invoke n_entries() we need to check for non-NULL here, like in
all other calls to the helper function. Otherwise we'll crash when
invoked with a NULL object, which we usually consider equivalent to an
empty one though.

4 years agounits: correct description of final.target
qhill [Fri, 2 Jul 2021 13:13:13 +0000 (14:13 +0100)]
units: correct description of final.target

This was updated incorrectly in https://github.com/systemd/systemd/pull/20058/commits/4fd3fc66396026f81fd5b27746f2faf8a9a7b9ee.  As https://github.com/systemd/systemd/blob/main/man/systemd.special.xml decribes, this unit is about shutdown rather than boot.

4 years agoudev: when booting without root= specification, and searching a root partition actual...
Lennart Poettering [Fri, 2 Jul 2021 13:35:39 +0000 (15:35 +0200)]
udev: when booting without root= specification, and searching a root partition actually do the version comparison magic

Since 08fe0a53869f27a9bfbc5bd31f27058145d46745 when dissecting a disk
image we'll automatically pick the "newest" root fs if multiple exist,
by comparing GPT partition labels. This works in systemd-nspawn,
systemd-dissect, systemd-tmpfiles --image, … and so on. It also works
already in systemd-gpt-auto-generator. However, there was one missing
place: in the logic that automatically finds a root fs in case no root=
was specified on the kernel logic at all. This logic doesn't use the
dissection logic, but a much simpler one.

Let's fill the gap, and implement it there too.

4 years agocoredumpctl: show --help text if "coredumpctl help" is called
Lennart Poettering [Fri, 2 Jul 2021 13:30:43 +0000 (15:30 +0200)]
coredumpctl: show --help text if "coredumpctl help" is called

Most of our programs that take "verbs" make the "help" verb either
equivalent to passing the --help switch (or at least print a message
redirecting the user to that switch). Do so in coredumpctl too, in order
to minimize surprises.

4 years agoudev: Fix by-uuid symlink for ubifs volumes
Trent Piepho [Thu, 1 Jul 2021 19:19:57 +0000 (12:19 -0700)]
udev: Fix by-uuid symlink for ubifs volumes

ubifs volumes have a UUID and the built-in blkid is able to determine
it.  The disk/by-uuid symlink isn't created because ubifs volumes are
not on block devices but on SUBSYSTEM="ubi" devices.  See #20071.

Allow ubi subsystem devices to be processed by the persistent storage
rules too.  The kernel device name matching already allows ubi* to pass.
The existing rules are sufficient to create the link.

The links look like other by-uuid symlinks, for example:
/dev/disk/by-uuid/9a136158-585b-4ba4-9b70-cbaf2cf78a1c -> ../../ubi0_1

4 years agonetwork: fix overflow issue in address lifetime calculation
Yu Watanabe [Fri, 2 Jul 2021 13:26:04 +0000 (22:26 +0900)]
network: fix overflow issue in address lifetime calculation

Fixes another issue reported in #20050. See
https://github.com/systemd/systemd/issues/20050#issuecomment-872967337.

4 years agonetwork: drop old dhcp6 addresses or routes after new ones are configured
Yu Watanabe [Fri, 2 Jul 2021 11:19:17 +0000 (20:19 +0900)]
network: drop old dhcp6 addresses or routes after new ones are configured

Fixes the issue similar to #20050 but for DHCP6.

4 years agonetwork: drop old ndisc configurations after new ones are configured
Yu Watanabe [Fri, 2 Jul 2021 11:15:10 +0000 (20:15 +0900)]
network: drop old ndisc configurations after new ones are configured

Previously, `ndisc_remove_old_one()` checked `ndisc_{addresses,routes}_configured`
flags, but they are not unset when all addresses or routes are already
assigned.
After the request queue is implemented, the address or route requests
are not processed within the same event of ndisc handler is called, but
will processed later when they are ready. So, calling `ndisc_remove_old()`
in the event of ndisc handler will remove all addresses and routes
previously assigned even they are requested to be updated.

This makes `ndisc_remove_old()` do nothing when there exist some
requests to configure addresses and routes, thus previously assigned
addresses and routes are kept until all requests are processed.

Fixes #20050.

4 years agonetwork: fix log message
Yu Watanabe [Fri, 2 Jul 2021 11:13:32 +0000 (20:13 +0900)]
network: fix log message

4 years agowait-online: improve timeout log message
Lennart Poettering [Fri, 2 Jul 2021 07:53:16 +0000 (09:53 +0200)]
wait-online: improve timeout log message

The time-out when waiting to reach the online state is a pretty
regularly seen error, let's print an explicit log message for it. The
previous "Event loop failed: timed out" message is a bit too low-level I
think for regular users (as event loops are a developer's concept, not a
user's, really).

Note that outputting low-level error messages is generally actually OK I
think — for unexpected errors, but this timeout is a pretty expected one,
directly configurable by the user, hence output something friendly.

4 years agoparse-socket-bind-item: fix typo in comment
Yu Watanabe [Fri, 2 Jul 2021 11:49:40 +0000 (20:49 +0900)]
parse-socket-bind-item: fix typo in comment

This also adds a blank line after each function declaration to follow our
coding style.

4 years agopo: Translated using Weblate (Russian)
Alexey Rubtsov [Fri, 2 Jul 2021 09:04:21 +0000 (11:04 +0200)]
po: Translated using Weblate (Russian)

Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Alexey Rubtsov <rushills@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ru/
Translation: systemd/main

4 years agooomd: review follow ups to #20020
Anita Zhang [Fri, 2 Jul 2021 00:07:32 +0000 (17:07 -0700)]
oomd: review follow ups to #20020

4 years agoselinux: support infering SELinux label also from socket not connected to stdin
Michal Sekletar [Tue, 29 Jun 2021 15:10:27 +0000 (17:10 +0200)]
selinux: support infering SELinux label also from socket not connected to stdin

Fixes #19918

4 years agoTODO: mention the new core scheduling kernel feature
Luca Boccassi [Thu, 1 Jul 2021 17:22:31 +0000 (18:22 +0100)]
TODO: mention the new core scheduling kernel feature

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/hw-vuln/core-scheduling.rst

4 years agoNEWS: update for imminent v249-rc3 tag v249-rc3
Lennart Poettering [Thu, 1 Jul 2021 15:15:13 +0000 (17:15 +0200)]
NEWS: update for imminent v249-rc3 tag

4 years agohwdb: Add accel orientation quirk for the Chuwi Hi13 (CWI534) with BMA250 sensor
Hans de Goede [Thu, 1 Jul 2021 13:28:25 +0000 (15:28 +0200)]
hwdb: Add accel orientation quirk for the Chuwi Hi13 (CWI534) with BMA250 sensor

Recently the kernel has gotten support for reading the mount-matrix for
BMA250 sensors represented by a BOSC0200 ACPI device from the ACPI tables,
so that we don't need to add quirks for these.

At least that was the theory. The Chuwi Hi13 (CWI534) with BMA250 sensor
has the sensor mounted such that it works / needs the normal(ized) matrix,
but the ACPI tables actually contain a wrong matrix inverting the X and Y
axis.

Add a quirk to override /sys/bus/iio/devices/iio:device?/in_mount_matrix
with the norm-matrix, since the ACPI derived matrix is actually wrong on
these devices (sigh)

4 years agohwdb: Add Logitech Trackman Marble
milaq [Thu, 1 Jul 2021 14:55:04 +0000 (16:55 +0200)]
hwdb: Add Logitech Trackman Marble

As per Logitech specsheet and quick verification via mouse-dpi-tool

4 years agohwdb: Use correct default values for Logitech M310
milaq [Thu, 1 Jul 2021 14:37:39 +0000 (16:37 +0200)]
hwdb: Use correct default values for Logitech M310

Altough the Logitech website states "1000 DPI", the default DPI
settings seems to be 800 as shown by older versions of Logitech
SetPoint and verification by mouse-dpi-tool.

4 years agohwdb: Add Logitech G Pro Wireless
milaq [Thu, 1 Jul 2021 11:54:44 +0000 (13:54 +0200)]
hwdb: Add Logitech G Pro Wireless

Use the default settings as advertised in the manual and in Logitech G HUB.

4 years agohwdb: Add Logitech G700 "Nano" receiver
milaq [Thu, 1 Jul 2021 11:33:10 +0000 (13:33 +0200)]
hwdb: Add Logitech G700 "Nano" receiver

Although this mouse may be paired with other receivers
this one is the "G-Series Nano Receiver" that originally
shipped with the device.

4 years agohwdb: Fix Logitech G700 default DPI settings
milaq [Thu, 1 Jul 2021 10:02:26 +0000 (12:02 +0200)]
hwdb: Fix Logitech G700 default DPI settings

The old settings were all over the place contained mixed refresh rates.

The new settings are the correct default DPI settings as advertised online.
This has also been confirmed in the latest Logitech Gaming Software (9.02.65).

4 years agohwdb: Fix Logitech G500 default DPI settings
milaq [Thu, 1 Jul 2021 09:29:17 +0000 (11:29 +0200)]
hwdb: Fix Logitech G500 default DPI settings

These are the correct default DPI settings as advertised in the manual.
This has also been confirmed in the latest Logitech Gaming Software (9.02.65).

4 years agohwdb: Add DPI info for Logitech MX Ergo
milaq [Thu, 1 Jul 2021 09:24:00 +0000 (11:24 +0200)]
hwdb: Add DPI info for Logitech MX Ergo

Use the "nominal value" as advertised in the spec sheet by Logitech.
This has also been verified with mouse-dpi-tool.