]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoMerge pull request #27126 from yuwata/journal-compress
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2023 07:28:27 +0000 (09:28 +0200)] 
Merge pull request #27126 from yuwata/journal-compress

sd-journal: allow to specify compression algorithm through env

2 years agoman: netdev: Clarify wireguard IPv6 endpoint format
Sorah Fukumori [Thu, 6 Apr 2023 19:15:43 +0000 (04:15 +0900)] 
man: netdev: Clarify wireguard IPv6 endpoint format

2 years agomkosi: Update to latest
Daan De Meyer [Thu, 6 Apr 2023 19:41:14 +0000 (21:41 +0200)] 
mkosi: Update to latest

This also migrates the configuration to the new format that was
just merged in mkosi. Specifically, we make use of the new [Match]
sections to only include specific config snippets per distro.

2 years agoMerge pull request #27158 from mrc0mmand/more-tests
Yu Watanabe [Thu, 6 Apr 2023 22:53:37 +0000 (07:53 +0900)] 
Merge pull request #27158 from mrc0mmand/more-tests

test: introduce TEST-81-GENERATORS

2 years agotest: check if we skip the full setup on daemon-reexec
Frantisek Sumsal [Thu, 6 Apr 2023 17:14:12 +0000 (19:14 +0200)] 
test: check if we skip the full setup on daemon-reexec

A simple test case for issue #27106.

Resolves: #27139

2 years agotest: add test case that journal file is created with the requested compression algorithm 27126/head
Yu Watanabe [Tue, 4 Apr 2023 06:03:35 +0000 (15:03 +0900)] 
test: add test case that journal file is created with the requested compression algorithm

2 years agotest: introduce TEST-81-GENERATORS 27158/head
Frantisek Sumsal [Mon, 3 Apr 2023 20:38:37 +0000 (22:38 +0200)] 
test: introduce TEST-81-GENERATORS

Add some explicit tests for various generators we ship, e.g.:
    - systemd-debug-generator
    - systemd-environment-d-generator
    - systemd-fstab-generator

2 years agoMerge pull request #26013 from goenkam/maanya/syscfg-feature
Luca Boccassi [Thu, 6 Apr 2023 09:59:18 +0000 (10:59 +0100)] 
Merge pull request #26013 from goenkam/maanya/syscfg-feature

confext: extension of sysext

2 years agotest: add a couple of tests for systemd-modules-load
Frantisek Sumsal [Mon, 3 Apr 2023 16:32:58 +0000 (18:32 +0200)] 
test: add a couple of tests for systemd-modules-load

2 years agofstab-generator: don't propagate ignored errno
Frantisek Sumsal [Wed, 5 Apr 2023 18:14:53 +0000 (20:14 +0200)] 
fstab-generator: don't propagate ignored errno

With certain fstabs we may propagate ENXIO from the $SYSTEMD_SYSFS_CHECK
check all the way up, making fstab-generator exit with a non-zero EC and
without any helpful message, which is really confusing.

2 years agorepart: Add more logging
Daan De Meyer [Wed, 5 Apr 2023 17:36:05 +0000 (19:36 +0200)] 
repart: Add more logging

2 years agoconfext: shell completion for systemd-confext 26013/head
maanyagoenka [Fri, 24 Feb 2023 08:44:36 +0000 (08:44 +0000)] 
confext: shell completion for systemd-confext

2 years agoconfext: documentation and man page updates for confext
maanyagoenka [Fri, 24 Feb 2023 08:42:45 +0000 (08:42 +0000)] 
confext: documentation and man page updates for confext

2 years agotest-os-util: add tests for sysext and confext release files
maanyagoenka [Fri, 31 Mar 2023 17:33:00 +0000 (17:33 +0000)] 
test-os-util: add tests for sysext and confext release files

2 years agoconfext: add tests for systemd-confext
maanyagoenka [Fri, 24 Feb 2023 08:35:38 +0000 (08:35 +0000)] 
confext: add tests for systemd-confext

2 years agoconfext: add the systemd-confext.service file
maanyagoenka [Fri, 24 Feb 2023 08:33:15 +0000 (08:33 +0000)] 
confext: add the systemd-confext.service file

2 years agoconfext: add multi call functionality to sysext
maanyagoenka [Wed, 29 Mar 2023 20:35:18 +0000 (20:35 +0000)] 
confext: add multi call functionality to sysext

The confext concept is an extension of the existing sysext concept and
allows to extend the host's filesystem or a unit's filesystem with signed
images that add new files to the /etc/ directory using OverlayFS.

2 years agoextension-release: establish compatibility between host file and extension-release...
maanyagoenka [Wed, 29 Mar 2023 20:34:21 +0000 (20:34 +0000)] 
extension-release: establish compatibility between host file and extension-release file

The release file that accompanies the confext images needs to be
host compatible to be able to be merged into the host /etc/ directory.
This commit checks for version compatibility between the image file and
the host file.

2 years agoos-util: add a new confext image type and the ability to parse their release files
maanyagoenka [Fri, 24 Feb 2023 00:37:52 +0000 (00:37 +0000)] 
os-util: add a new confext image type and the ability to parse their release files

Adds a new image type called IMAGE_CONFEXT which is similar to IMAGE_SYSEXT but works
for the /etc/ directory instead of /usr/ and /opt/. This commit also adds the ability to
parse the release file that is present with the confext image in /etc/confext-release.d/
directory.

2 years agoMerge pull request #27154 from DaanDeMeyer/kconfig
Luca Boccassi [Wed, 5 Apr 2023 18:59:24 +0000 (19:59 +0100)] 
Merge pull request #27154 from DaanDeMeyer/kconfig

mkosi kernel build updates

2 years agotest: use kbd-mode-map we ship in TEST-73-LOCALE
Franck Bui [Wed, 5 Apr 2023 11:37:48 +0000 (13:37 +0200)] 
test: use kbd-mode-map we ship in TEST-73-LOCALE

The rational is the same as the one described in commit
be0cc2ce6c947aafadb3f42dba405269f670b31c.

2 years agotest: add tests for dir_fd_is_root_or_cwd()
Yu Watanabe [Wed, 5 Apr 2023 06:23:19 +0000 (15:23 +0900)] 
test: add tests for dir_fd_is_root_or_cwd()

Follow-up for e212f422796da9e626030289faf083407c8955df.

2 years agomkosi: Update bundled kconfig 27154/head
Daan De Meyer [Wed, 5 Apr 2023 15:04:30 +0000 (17:04 +0200)] 
mkosi: Update bundled kconfig

- Remove useless serial console configs
- Add CONFIG_SERIAL_8250_PCI so that qemu's virtconsole works properly
- Add CONFIG_DMI and CONFIG_DMI_SYSFS so that SMBIOS credentials work
- Add CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC so we can read the
  current kernel config from /proc/config.gz
- Add CONFIG_IOSCHED_BFQ to get rid of a udev error on boot on Fedora
- Add CONFIG_HW_RANDOM_VIRTIO to get hw rng in qemu
- Add CONFIG_SECURITY_YAMA to get rid of warning from sysctl on boot
- Add CONFIG_VSOCKETS and CONFIG_VIRTIO_VSOCKETS to enable vsock support

2 years agomkosi: Make sure we always boot our built from source kernel
Daan De Meyer [Wed, 5 Apr 2023 14:20:28 +0000 (16:20 +0200)] 
mkosi: Make sure we always boot our built from source kernel

If we build a kernel from source, let's make sure it's always booted
by giving it a very high version number.

2 years agoresolve: refuse mdns scope for ipv4 broadcast addresses
Ronan Pigott [Mon, 27 Mar 2023 16:43:58 +0000 (09:43 -0700)] 
resolve: refuse mdns scope for ipv4 broadcast addresses

This query can never be answered, so let's no wait for it to timeout.

2 years agoMerge pull request #27143 from bluca/no_tpm
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2023 09:24:18 +0000 (11:24 +0200)] 
Merge pull request #27143 from bluca/no_tpm

cryptsetup: fix build without TPM2

2 years agoRevert "mkosi: Drop python-docutils"
Daan De Meyer [Wed, 5 Apr 2023 08:23:58 +0000 (10:23 +0200)] 
Revert "mkosi: Drop python-docutils"

This reverts commit be266f49d6b7e3f021e2a07f937d39d1f14a283d.

Turns out we installed this because it's required by the bpf selftests
so let's keep it intact.

2 years agoservice: use newdup() where appropriate
Lennart Poettering [Tue, 4 Apr 2023 14:25:33 +0000 (16:25 +0200)] 
service: use newdup() where appropriate

2 years agoMerge pull request #27137 from yuwata/id128-get-machine
Yu Watanabe [Wed, 5 Apr 2023 06:24:45 +0000 (15:24 +0900)] 
Merge pull request #27137 from yuwata/id128-get-machine

sd-id128: introduce id128_get_machine() and _at()

2 years agovarious: simplify calls to parse_boolean_argument()
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2023 17:39:04 +0000 (19:39 +0200)] 
various: simplify calls to parse_boolean_argument()

parse_boolean_argument() returns the same information via both the output
argument and normal return.

2 years agoci: do one build with no tpm/p11kit/fido2 27143/head
Luca Boccassi [Tue, 4 Apr 2023 21:37:35 +0000 (22:37 +0100)] 
ci: do one build with no tpm/p11kit/fido2

We have some missing coverage in the CI, all builds enable these features,
but there are often changes and they cover a lot of code. Do one build
without them to ensure we don't break builds.

2 years agocryptsetup: fix build without TPM2
Luca Boccassi [Tue, 4 Apr 2023 21:34:49 +0000 (22:34 +0100)] 
cryptsetup: fix build without TPM2

Follow-up for acbb504eaf1be51572b1c0d0d490ac478bc41c64

2 years agotpm2: fix nits from PR #26185
William Roberts [Tue, 4 Apr 2023 16:14:17 +0000 (11:14 -0500)] 
tpm2: fix nits from PR #26185

Fixes:
  - Comment style
  - Alignment style
  - cleanup macro usage
  - incorrect error message[1]

1. Thanks to tempusfugit991@gmail.com for pointing out the error
message mistake.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2 years agotest/test-functions: fix typo in install_suse_systemd()
Thomas Blume [Tue, 4 Apr 2023 13:13:13 +0000 (15:13 +0200)] 
test/test-functions: fix typo in install_suse_systemd()

2 years agoupdate TODO
Lennart Poettering [Tue, 4 Apr 2023 19:28:50 +0000 (21:28 +0200)] 
update TODO

As it turns out RuntimeDirectoryPreserve= already supports such a mode.

2 years agoupdate TODO
Lennart Poettering [Tue, 4 Apr 2023 19:27:52 +0000 (21:27 +0200)] 
update TODO

2 years agoexecute: add one more assert()
Lennart Poettering [Tue, 4 Apr 2023 11:41:00 +0000 (13:41 +0200)] 
execute: add one more assert()

2 years agoMerge pull request #27128 from keszybz/sd-bus-docs-and-error-messages
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2023 19:28:15 +0000 (21:28 +0200)] 
Merge pull request #27128 from keszybz/sd-bus-docs-and-error-messages

Improvements to man pages for systemd.service, sd-bus, and better error messages

2 years agoman: mention -o option for systemd-journal-remote
Yu Watanabe [Tue, 4 Apr 2023 15:38:55 +0000 (00:38 +0900)] 
man: mention -o option for systemd-journal-remote

2 years agomachine-id-setup: do not read host's machine ID when root directory is specified 27137/head
Yu Watanabe [Fri, 31 Mar 2023 07:07:23 +0000 (16:07 +0900)] 
machine-id-setup: do not read host's machine ID when root directory is specified

If a root directory is specified, and e.g. /var under the root directory
is a symlink to the host's /var, then we wrongly read host's machine ID,
even if O_NOFOLLOW is set.

Let's chase the path with CHASE_NOFOLLOW to refuse such case.

Also, refuse null ID, otherwise we may setup machine ID with NULL.

2 years agomachine-id-setup: use id128_get_machine() at one more place
Yu Watanabe [Sat, 1 Apr 2023 13:49:47 +0000 (22:49 +0900)] 
machine-id-setup: use id128_get_machine() at one more place

2 years agodiscover-image: use id128_get_machine() at one more place
Yu Watanabe [Sat, 1 Apr 2023 13:49:22 +0000 (22:49 +0900)] 
discover-image: use id128_get_machine() at one more place

2 years agospecifier: always convert missing machine-id file to EUNATCH
Yu Watanabe [Sat, 1 Apr 2023 13:48:14 +0000 (22:48 +0900)] 
specifier: always convert missing machine-id file to EUNATCH

Then, use id128_get_machine().

2 years agonspawn: ignore NULL machine ID in the container
Yu Watanabe [Sat, 1 Apr 2023 05:59:46 +0000 (14:59 +0900)] 
nspawn: ignore NULL machine ID in the container

Previously, when the NULL (all zero) machine ID is configured in the
container, nspawn refused to execute.

Now id128_get_machine() is used, so NULL machine ID is refused with
-ENOMEDIUM, and fallback to specified UUID or randomly generated one.

2 years agorepart: use id128_get_machine()
Yu Watanabe [Fri, 31 Mar 2023 07:00:37 +0000 (16:00 +0900)] 
repart: use id128_get_machine()

This also makes that the seed is actually randomized when the read
machine ID is NULL.

2 years agotest: add tests for id128_get_machine() and _at()
Yu Watanabe [Tue, 4 Apr 2023 02:43:06 +0000 (11:43 +0900)] 
test: add tests for id128_get_machine() and _at()

2 years agosd-id128: introduce id128_get_machine() and id128_get_machine_at()
Yu Watanabe [Fri, 31 Mar 2023 06:55:01 +0000 (15:55 +0900)] 
sd-id128: introduce id128_get_machine() and id128_get_machine_at()

2 years agofd-util: introduce dir_fd_is_root_or_cwd()
Yu Watanabe [Sat, 1 Apr 2023 16:25:46 +0000 (01:25 +0900)] 
fd-util: introduce dir_fd_is_root_or_cwd()

2 years agotest: add tests for ID128_REFUSE_NULL
Yu Watanabe [Tue, 4 Apr 2023 03:26:57 +0000 (12:26 +0900)] 
test: add tests for ID128_REFUSE_NULL

2 years agosd-id128: introduce ID128_REFUSE_NULL flag
Yu Watanabe [Tue, 4 Apr 2023 03:18:04 +0000 (12:18 +0900)] 
sd-id128: introduce ID128_REFUSE_NULL flag

2 years agoservice: minor modernizations
Lennart Poettering [Tue, 4 Apr 2023 10:21:00 +0000 (12:21 +0200)] 
service: minor modernizations

2 years agomanager: remove transient unit directory during startup
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2023 10:05:16 +0000 (12:05 +0200)] 
manager: remove transient unit directory during startup

I was testing transient units and user@.service crashed. I restarted it, and
tried to create a transient unit. It failed because
/run/user/1000/systemd/transient/ remained after the previous aborted run:
  Failed to start transient service unit: Unit run-u0.service was already loaded or has a fragment file.

Remove the directory during initial startup so we don't get confused by our own
files.

2 years agosd-bus: use macros for standard bus error names consistently 27128/head
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 21:07:33 +0000 (23:07 +0200)] 
sd-bus: use macros for standard bus error names consistently

Also add definitions for a few names that didn't have them and update
the list in the man page.

2 years agocore: a more informative error when SetProperties/StartTransientUnit fails
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 19:08:35 +0000 (21:08 +0200)] 
core: a more informative error when SetProperties/StartTransientUnit fails

I was changing how some properties are appended to the StartTransientUnit call
and messed up the message contents. When something is wrong with how the
message is structed, we would return a very generic
"Failed to start transient service unit: No such device or address".

Mention that it was property setting that failed, and translate ENXIO to a
different message. bus_unit_set_properties() or any of the children it calls
may also return other errors, in particular EBADMSG or ENOMEM, but the error
message that is generated for those is understandable, so we don't need to
"translate" them explicitly.

bus_unit_set_properties() is called from two places, so it seems nicer to
generate the message internally, rather than ask the caller to do that. Also,
now bus_unit_set_properties() always sets <error>, which is nicer for the
callers.

2 years agoman/sd_bus_message_open_container: mention two common errors
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 18:53:51 +0000 (20:53 +0200)] 
man/sd_bus_message_open_container: mention two common errors

2 years agoman/systemd.service: add example for char prefixes
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 18:16:01 +0000 (20:16 +0200)] 
man/systemd.service: add example for char prefixes

The prefixes can be specified for any part of the command. The docs imply this,
but it's not entirely obvious. Let's add an example.

2 years agoman: move description of command line substitution out of ExecStart=
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 18:05:18 +0000 (20:05 +0200)] 
man: move description of command line substitution out of ExecStart=

The description was split — part was under ExecStart= and part in "Command lines".
Now the whole generic part is moved to the separate section, and under ExecStart=
only the stuff that is specific to that option is described.

This just moves the text and removes some repetitions.

2 years agocore: unify two similar paths, avoid formatting of unused string
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 11:50:29 +0000 (13:50 +0200)] 
core: unify two similar paths, avoid formatting of unused string

After 'if (DEBUG_LOGGING)' is added, the two call sites are almost identical,
except that we forgot LOG_UNIT_INVOCATION_ID(unit).

I removed the handling of the log_oom(). It's a debug message only after all,
and it's unlikely to fail.

2 years agocore: simplify unit_escape_setting()
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2023 14:23:47 +0000 (16:23 +0200)] 
core: simplify unit_escape_setting()

The function had a provision for NULL input, and would return NULL, but that
looks like an error and all callers pass in a non-NULL arg and report oom on
NULL. So assert that the input is non-NULL.

All callers specifed the output buffer, so we can simplify the logic to only
make an allocation if appropriate and change the return type to 'const *'.

No functional change.

2 years agocore: typos in comments
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2023 14:15:12 +0000 (16:15 +0200)] 
core: typos in comments

2 years agoupdate TODO
Lennart Poettering [Tue, 4 Apr 2023 10:20:50 +0000 (12:20 +0200)] 
update TODO

2 years agosd-journal: allow to specify compression algorithm through env
Yu Watanabe [Tue, 4 Apr 2023 05:19:51 +0000 (14:19 +0900)] 
sd-journal: allow to specify compression algorithm through env

Fixes RHBZ#2183546 (https://bugzilla.redhat.com/show_bug.cgi?id=2183546).

Previously, journal file is always compressed with the default algorithm
set at compile time. So, if a newer algorithm is used, journal files
cannot be read by older version of journalctl that does not support the
algorithm.

Co-authored-by: Colin Walters <walters@verbum.org>
2 years agosd-journal: always use the compression algorithm specified in the header
Yu Watanabe [Tue, 4 Apr 2023 09:22:50 +0000 (18:22 +0900)] 
sd-journal: always use the compression algorithm specified in the header

Previously, data object may be compressed with an algorithm that is not
mentioned in the header.

2 years agocompress: introduce compression_supported() helper function
Yu Watanabe [Tue, 4 Apr 2023 05:34:32 +0000 (14:34 +0900)] 
compress: introduce compression_supported() helper function

2 years agosd-journal: cache results of parsing environment variables
Yu Watanabe [Tue, 4 Apr 2023 07:43:44 +0000 (16:43 +0900)] 
sd-journal: cache results of parsing environment variables

2 years agojournald: fix log message
Yu Watanabe [Tue, 4 Apr 2023 08:11:28 +0000 (17:11 +0900)] 
journald: fix log message

2 years agoservice: dump fdstore contents also in free-form debug dump
Lennart Poettering [Thu, 30 Mar 2023 14:38:47 +0000 (16:38 +0200)] 
service: dump fdstore contents also in free-form debug dump

2 years agoMerge pull request #27122 from yuwata/id128-at
Daan De Meyer [Tue, 4 Apr 2023 07:25:37 +0000 (09:25 +0200)] 
Merge pull request #27122 from yuwata/id128-at

undefined

2 years agochase: fix error handling
Yu Watanabe [Sat, 1 Apr 2023 12:58:08 +0000 (21:58 +0900)] 
chase: fix error handling

Fixes a bug introduced by 63bfd52f48a772c86ff84e3a1ba1fcd19e0008f8.

2 years agotest: add tests for id128_{read,write}_at() 27122/head
Yu Watanabe [Tue, 4 Apr 2023 02:39:33 +0000 (11:39 +0900)] 
test: add tests for id128_{read,write}_at()

2 years agosd-id128: introduce id128_write_at()
Yu Watanabe [Fri, 31 Mar 2023 07:12:39 +0000 (16:12 +0900)] 
sd-id128: introduce id128_write_at()

2 years agosd-id128: introduce id128_read_at()
Yu Watanabe [Fri, 31 Mar 2023 07:10:36 +0000 (16:10 +0900)] 
sd-id128: introduce id128_read_at()

2 years agosd-id128: rename Id128FormatFlag -> Id128Flag
Yu Watanabe [Sat, 1 Apr 2023 12:30:45 +0000 (21:30 +0900)] 
sd-id128: rename Id128FormatFlag -> Id128Flag

As the flag is not only for formatting.

2 years agosd-id128: rename argument and add missing assertion
Yu Watanabe [Sat, 1 Apr 2023 15:35:33 +0000 (00:35 +0900)] 
sd-id128: rename argument and add missing assertion

2 years agoRevert "sd-id128: make id128_read() optionally take root directory"
Yu Watanabe [Mon, 3 Apr 2023 01:39:00 +0000 (10:39 +0900)] 
Revert "sd-id128: make id128_read() optionally take root directory"

This reverts commit 830e52caa2bf1a29f56cb93e7ed85acb1bda11c3.

2 years agosrc: changed usage of basename() to path_extract_filename().
OMOJOLA JOSHUA DAMILOLA [Sat, 1 Apr 2023 18:52:32 +0000 (18:52 +0000)] 
src: changed usage of basename() to path_extract_filename().
TODO.

2 years agoMerge pull request #27114 from keszybz/trivial-cleanups
Luca Boccassi [Mon, 3 Apr 2023 17:55:49 +0000 (18:55 +0100)] 
Merge pull request #27114 from keszybz/trivial-cleanups

Trivial cleanups

2 years agopid1: drop two spurious empty line
Lennart Poettering [Mon, 3 Apr 2023 17:15:58 +0000 (19:15 +0200)] 
pid1: drop two spurious empty line

2 years agocore/main: also check the argument terminator
Mike Yuan [Mon, 3 Apr 2023 10:42:39 +0000 (18:42 +0800)] 
core/main: also check the argument terminator

For future-proof reasons, in case we will add
another option that starts with --deserialize.

Addresses https://github.com/systemd/systemd/commit/4f44d2c4f76922a4f48dd4473e6abaca40d7e555#r107285603

2 years agoudev-rules: check tokens order
Dmitry V. Levin [Sun, 26 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: check tokens order

When invoked by udevadm verify, warn about rules that have PROGRAM
assignments specified after RESULT checks.

2 years agoshared/exec-util: reduce scope of iterator variables 27114/head
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 19:22:17 +0000 (21:22 +0200)] 
shared/exec-util: reduce scope of iterator variables

2 years agocore/service: inline one variable
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 12:59:48 +0000 (14:59 +0200)] 
core/service: inline one variable

2 years agobasic/fs-util: typo fix
Zbigniew Jędrzejewski-Szmek [Thu, 30 Mar 2023 14:19:25 +0000 (16:19 +0200)] 
basic/fs-util: typo fix

2 years agoman/systemd-sysext: minor grammar optimizations
Zbigniew Jędrzejewski-Szmek [Thu, 30 Mar 2023 07:40:14 +0000 (09:40 +0200)] 
man/systemd-sysext: minor grammar optimizations

2 years agobasic/mkdir: simplify error handling
Zbigniew Jędrzejewski-Szmek [Wed, 29 Mar 2023 14:00:03 +0000 (16:00 +0200)] 
basic/mkdir: simplify error handling

If we created the dir successfully, we let chmod_and_chown_at() do its thing
and shouldn't go into the part where we check if the existing directory has the
right permissions and ownership and possibly adjust them. The code was doing
that, by relying on the fact that chmod_and_chown_at() does not return -EEXIST.
That's probably true, but seems unnecessarilly complicated.

Follow-up for c1b1492a94b43ca636eb383c3b058feff27ff7b1.

2 years agotpm2: add support for a trusted SRK
William Roberts [Fri, 24 Feb 2023 20:11:16 +0000 (14:11 -0600)] 
tpm2: add support for a trusted SRK

Prevent attackers from spoofing the tpmKey portion of the AuthSession by
adding a trusted key to the LUKS header metadata. Also, use a persistent
object rather than a transient object.

This provides the following benifits:
1. No way to MITM the tpmKey portion of the session, see [1] for
details.

2. Strengthens the encrypted sessions, note that the bindKey could be
   dropped now.

3. Speed, once it's created we just use it.

4. Owner Auth is needed to call create primary, so using the SRK
   creates a scratch space for normal users.

This is a "first to set" model, in where the first person to set the key
in the LUKS header wins. Thus, setup should be done in a known good
state. If an SRK, which is a primary key at a special persistent
address, is found, it will use whatever is there. If not, it creates an
SRK. The SRK follows the convetions used through the tpm2-software
organization code on GitHub [2], however, a split has occured between
Windows and Linux with respect to SRK templates. The Linux SRK is
generated with the unique field size set to 0, in Windows, it properly
sets the size to key size in bytes and the unique data to all 0's of that
size. Note the proper templates for SRKs is covered in spec [3].
However, the most important thing, is that both SRKs are passwordless,
and thus they should be interchangable. If Windows is the first to make
the SRK, systemd will gladly accept it and vice-versa.

1. Without the bindKey being utilized, an attacker was able to intercept
this and fake a key, thus being able to decrypt and encrypt traffic as
needed. Introduction of the bindKey strengthened this, but allows for
the attacker to brute force AES128CFB using pin guesses. Introduction of
the salt increases the difficulty of this attack as well as DA attacks
on the TPM objects itself.

2. https://github.com/tpm2-software

3. https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-v2.0-Provisioning-Guidance-Published-v1r1.pdf

Fixes: #20668
Fixes: #22637
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2 years agoMerge pull request #27044 from bluca/sysext_recursive_dir
Lennart Poettering [Mon, 3 Apr 2023 10:38:48 +0000 (12:38 +0200)] 
Merge pull request #27044 from bluca/sysext_recursive_dir

Ensure sysexts do not contain an os-release file, do not load sysexts from /usr[/local]/lib/extensions/

2 years agouser-sessions: do not remove /etc/nologin
Zbigniew Jędrzejewski-Szmek [Sat, 25 Mar 2023 10:34:47 +0000 (11:34 +0100)] 
user-sessions: do not remove /etc/nologin

pam_nologin looks for /etc/nologin and /run/nologin.
user-sessions creates (and removes) /run/nologin, but also removes
/etc/nologin. (This behaviour is unchanged since the introduction
of the binary in e92787416c691c3f34f47349e5eae3fa68eae856.)

By not removing pam_nologin we fully drop compatibility with PAM < 1.1.
This has the advantage that now /etc/nologin can be used by administrator to
disable user logins, e.g. for extended maintanance. We already specified
PAM >= 1.1.2 as dependency, so this was already covered.

The makes the code match the man page.

Fixes #26965.

2 years agoupdate 60-sensor.hwdb with toshiba tablet (#27103)
dmkUK [Sun, 2 Apr 2023 23:09:11 +0000 (00:09 +0100)] 
update 60-sensor.hwdb with toshiba tablet (#27103)

* update 60-sensor.hwdb with toshiba tablet

udevadm output after new matrix added

E: MODALIAS=dmi:bvnTOSHIBA:bvr2.00:bd01/09/2015:br2.0:efr19.0:svnTOSHIBA:pnTOSHIBAWT10-A-102:pvrPDW0BE-00800TEN:rvnType2-BoardManufacturer:rnType2-BoardProductName:rvrType2-BoardVersion:cvnChassisManufacturer:ct10:cvrChassisVersion:

P: /devices/platform/80860F41:02/i2c-2/i2c-13/13-000c
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-13/13-000c
E: SUBSYSTEM=i2c
E: MODALIAS=i2c:INVN6500-client

P: /devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00
E: SUBSYSTEM=i2c
E: DRIVER=inv-mpu6050-i2c
E: MODALIAS=acpi:INVN6500:
E: USEC_INITIALIZED=8659532
E: ID_VENDOR_FROM_DATABASE=Inviso, Inc.

P: /devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/iio:device0
N: iio:device0
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/iio:device0
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=246
E: MINOR=0
E: USEC_INITIALIZED=9662385
E: ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

P: /devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/trigger0
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/trigger0
E: SUBSYSTEM=iio

The orientation is the same as the WT10-A-103 already listed in 60.sensor.hwdb but not picked up by that rule.

2 years agocore: do early setup check for arguments with '=' too
Mike Yuan [Sun, 2 Apr 2023 10:56:12 +0000 (18:56 +0800)] 
core: do early setup check for arguments with '=' too

Follow-up for d2ebd50d7f9740dcf30e84efc75610af173967d2

We now modify our cmdline to use '=' for all arguments,
but didn't change early setup check to work with that.
So every daemon-reexec does a full setup, thus breaking
running user sessions.

Fixes #27106

2 years agoAdded unit test for strv_env_name_is_valid() function listed in env-util.c (#27100)
taniishkaaa [Sun, 2 Apr 2023 13:27:29 +0000 (18:57 +0530)] 
Added unit test for strv_env_name_is_valid() function listed in env-util.c (#27100)

tests: add test for strv_env_name_is_valid function listed in env-util.c

2 years agoMerge pull request #27096 from YHNdnzj/networkctl-modernize
Luca Boccassi [Sun, 2 Apr 2023 13:23:59 +0000 (14:23 +0100)] 
Merge pull request #27096 from YHNdnzj/networkctl-modernize

networkctl: modernize

2 years agoMerge pull request #27086 from keszybz/oomd-on-v1
Mike Yuan [Sun, 2 Apr 2023 08:21:53 +0000 (16:21 +0800)] 
Merge pull request #27086 from keszybz/oomd-on-v1

Do not pull in systemd-oomd on v1 to avoid repeated message in logs

2 years agopo: Translated using Weblate (Russian)
Andrei Stepanov [Sun, 2 Apr 2023 02:20:44 +0000 (04:20 +0200)] 
po: Translated using Weblate (Russian)

Currently translated at 100.0% (193 of 193 strings)

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

2 years agobuild(deps): bump github/codeql-action from 2.2.5 to 2.2.9
dependabot[bot] [Sat, 1 Apr 2023 09:57:38 +0000 (09:57 +0000)] 
build(deps): bump github/codeql-action from 2.2.5 to 2.2.9

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.5 to 2.2.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/32dc499307d133bb5085bae78498c0ac2cf762d5...04df1262e6247151b5ac09cd2c303ac36ad3f62b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #27087 from mrc0mmand/missing-coverage
Frantisek Sumsal [Sat, 1 Apr 2023 16:59:42 +0000 (18:59 +0200)] 
Merge pull request #27087 from mrc0mmand/missing-coverage

test: set ReadWritePaths= for test-.services when built w/ coverage

2 years agoMerge pull request #27067 from DaanDeMeyer/find-esp-at
Yu Watanabe [Sat, 1 Apr 2023 16:19:57 +0000 (01:19 +0900)] 
Merge pull request #27067 from DaanDeMeyer/find-esp-at

find-esp: Add openat() like helpers that operate on fds

2 years agobuild(deps): bump ossf/scorecard-action from 2.1.2 to 2.1.3
dependabot[bot] [Sat, 1 Apr 2023 09:57:34 +0000 (09:57 +0000)] 
build(deps): bump ossf/scorecard-action from 2.1.2 to 2.1.3

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/e38b1902ae4f44df626f11ba0734b14fb91f8f86...80e868c13c90f172d68d1f4501dee99e2479f7af)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/labeler from 4.0.2 to 4.0.3
dependabot[bot] [Sat, 1 Apr 2023 09:57:28 +0000 (09:57 +0000)] 
build(deps): bump actions/labeler from 4.0.2 to 4.0.3

Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/5c7539237e04b714afd8ad9b4aed733815b9fab4...ba790c862c380240c6d5e7427be5ace9a05c754b)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump github/super-linter from 4.9.7 to 4.10.1
dependabot[bot] [Sat, 1 Apr 2023 09:57:23 +0000 (09:57 +0000)] 
build(deps): bump github/super-linter from 4.9.7 to 4.10.1

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.9.7 to 4.10.1.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/bb2d833b08b6c288608686672b93a8a4589cdc49...454ba4482ce2cd0c505bc592e83c06e1e37ade61)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>