]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 months agojournalctl-show: split out seek_journal() 31879/head
Yu Watanabe [Thu, 21 Mar 2024 10:18:02 +0000 (19:18 +0900)] 
journalctl-show: split out seek_journal()

No functional change, just refactoring.

2 months agojournalctl: split journalctl.c into small pieces
Yu Watanabe [Wed, 20 Mar 2024 18:50:09 +0000 (03:50 +0900)] 
journalctl: split journalctl.c into small pieces

And introduces per-action functions.
No functional change, just refactoring.

2 months agojournalctl: use correct type for flags
Yu Watanabe [Tue, 19 Mar 2024 10:04:10 +0000 (19:04 +0900)] 
journalctl: use correct type for flags

This also moves its declaration, as it is not changed in the loop.

2 months agojournalctl: merge three if blocks for seeking to the initial position
Yu Watanabe [Tue, 19 Mar 2024 09:54:24 +0000 (18:54 +0900)] 
journalctl: merge three if blocks for seeking to the initial position

No functional change, just refactoring.

2 months agodaemon-util: introduce notify_reloading helper
Mike Yuan [Tue, 26 Mar 2024 09:40:01 +0000 (17:40 +0800)] 
daemon-util: introduce notify_reloading helper

Prompted by #31951

2 months agoMerge pull request #29721 from poettering/systemd-project
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2024 12:19:33 +0000 (13:19 +0100)] 
Merge pull request #29721 from poettering/systemd-project

New capsule@.service feature

2 months agobuild(deps): bump pkg/opensuse from `af49127` to `acdb1cd`
dependabot[bot] [Tue, 26 Mar 2024 09:21:52 +0000 (09:21 +0000)] 
build(deps): bump pkg/opensuse from `af49127` to `acdb1cd`

Bumps pkg/opensuse from `af49127` to `acdb1cd`.

---
updated-dependencies:
- dependency-name: pkg/opensuse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoefi: Measure into both CC and TPM if available. (#31939)
Dionna Amalie Glaze [Tue, 26 Mar 2024 09:26:59 +0000 (02:26 -0700)] 
efi: Measure into both CC and TPM if available. (#31939)

* efi: Measure into both CC and TPM if available.

It's possible that both measurement protocols are made available, so
instead of assuming only one or the other are available, measure into
both to avoid a problem like CVE-2021-42299.

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
2 months agoMerge pull request #31801 from flatcar-hub/krnowak/sysext-config
Luca Boccassi [Tue, 26 Mar 2024 09:23:19 +0000 (09:23 +0000)] 
Merge pull request #31801 from flatcar-hub/krnowak/sysext-config

systemd-sysext: Add support for env vars, ephemeral layers and some fixes

2 months agoMerge pull request #31947 from yuwata/test-recently-fixed-issues
Yu Watanabe [Tue, 26 Mar 2024 05:56:58 +0000 (14:56 +0900)] 
Merge pull request #31947 from yuwata/test-recently-fixed-issues

Tests for recently fixed issues

2 months agotest: add test cases for journalctl --facility=/--output=help 31947/head
Yu Watanabe [Mon, 25 Mar 2024 19:18:16 +0000 (04:18 +0900)] 
test: add test cases for journalctl --facility=/--output=help

Follow-up for d44233503f29ad6f79914c8e6137fc2d260d9f89.

2 months agotest: add test cases for systemd-analyze --global
Yu Watanabe [Mon, 25 Mar 2024 19:10:01 +0000 (04:10 +0900)] 
test: add test cases for systemd-analyze --global

Follow-up for ac97053618387ca1fa0d378cde7957aab8f0476c.

2 months agoci: build with clang-18
Frantisek Sumsal [Tue, 5 Mar 2024 11:24:19 +0000 (12:24 +0100)] 
ci: build with clang-18

2 months agoDocument SYSTEMD_REPART_MKFS_* in repart.d manual
Gaël Donval [Thu, 14 Mar 2024 13:00:01 +0000 (13:00 +0000)] 
Document SYSTEMD_REPART_MKFS_* in repart.d manual

2 months agohome/homework: use FOREACH_ARRAY more
Mike Yuan [Mon, 25 Mar 2024 12:33:18 +0000 (20:33 +0800)] 
home/homework: use FOREACH_ARRAY more

Prompted by #31932

2 months agoMerge pull request #31932 from bluca/coverity
Yu Watanabe [Mon, 25 Mar 2024 18:04:51 +0000 (03:04 +0900)] 
Merge pull request #31932 from bluca/coverity

Fix coverity issues

2 months agokernel-install/60-ukify: do not rebuild existing UKIs
Vitaly Kuznetsov [Mon, 25 Mar 2024 10:18:25 +0000 (11:18 +0100)] 
kernel-install/60-ukify: do not rebuild existing UKIs

In case kernel-install is called to install what's already a UKI, 60-ukify
must be skipped. E.g. when distro shipped and signed UKI is being installed,
it is counter-productive to try to rebuild it with ukify. Also, the existing
script is not ready to handle UKIs with embedded initramfs.

Note, it is already possible to disable 60-ukify by setting
KERNEL_INSTALL_UKI_GENERATOR to something but in case it is not set, 60-ukify
assumes it should run.

2 months agoMerge pull request #31899 from yuwata/sd-journal-add-match
Yu Watanabe [Mon, 25 Mar 2024 17:56:58 +0000 (02:56 +0900)] 
Merge pull request #31899 from yuwata/sd-journal-add-match

sd-journal: introduce two helpers for adding journal filter

2 months agoMerge pull request #31807 from yuwata/sd-ndisc-send
Yu Watanabe [Mon, 25 Mar 2024 17:55:33 +0000 (02:55 +0900)] 
Merge pull request #31807 from yuwata/sd-ndisc-send

sd-ndisc: introduce sd_ndisc_send()

2 months agoMerge pull request #31938 from YHNdnzj/journalctl-facility
Yu Watanabe [Mon, 25 Mar 2024 17:23:50 +0000 (02:23 +0900)] 
Merge pull request #31938 from YHNdnzj/journalctl-facility

journalctl: explicitly check < 0 for error

2 months agoMerge pull request #31870 from CodethinkLabs/base-image-tweaks
Daan De Meyer [Mon, 25 Mar 2024 17:04:49 +0000 (18:04 +0100)] 
Merge pull request #31870 from CodethinkLabs/base-image-tweaks

Base image tweaks

2 months agomkosi: Add selinux support to CentOS and Fedora initrds 31870/head
Richard Maw [Wed, 20 Mar 2024 15:22:36 +0000 (15:22 +0000)] 
mkosi: Add selinux support to CentOS and Fedora initrds

The base initrd is also used by the system image
so selinux should be there even if not enabled by the base image.

2 months agomkosi: Remove testuser from base/mkosi.postinst.chroot
Richard Maw [Wed, 20 Mar 2024 14:33:17 +0000 (14:33 +0000)] 
mkosi: Remove testuser from base/mkosi.postinst.chroot

The testuser user is only needed for integration tests,
which are used in the system user and this config
can be provided as drop-ins instead of inline in postinst scripts.

2 months agojournalctl: explicitly check < 0 for error 31938/head
Mike Yuan [Mon, 25 Mar 2024 15:11:27 +0000 (23:11 +0800)] 
journalctl: explicitly check < 0 for error

2 months agobasic/string-table: remove unnecessary brackets
Mike Yuan [Mon, 25 Mar 2024 15:10:52 +0000 (23:10 +0800)] 
basic/string-table: remove unnecessary brackets

2 months agoMerge pull request #31730 from yuwata/network-dhcp-server-lease-file-follow-ups
Luca Boccassi [Mon, 25 Mar 2024 14:32:05 +0000 (14:32 +0000)] 
Merge pull request #31730 from yuwata/network-dhcp-server-lease-file-follow-ups

network: several follow-ups for DHCP server lease file

2 months agoUse .git suffix for all submodule urls
Daan De Meyer [Mon, 25 Mar 2024 12:49:42 +0000 (13:49 +0100)] 
Use .git suffix for all submodule urls

2 months agologs-show: use journal_add_matchf() and journal_add_match_pair() 31899/head
Yu Watanabe [Thu, 21 Mar 2024 20:51:15 +0000 (05:51 +0900)] 
logs-show: use journal_add_matchf() and journal_add_match_pair()

2 months agonetworkctl: use journal_add_matchf() and journal_add_match_pair()
Yu Watanabe [Thu, 21 Mar 2024 20:33:08 +0000 (05:33 +0900)] 
networkctl: use journal_add_matchf() and journal_add_match_pair()

2 months agojournal-gateway: use journal_add_match_pair() and add_match_boot_id()
Yu Watanabe [Thu, 21 Mar 2024 20:26:02 +0000 (05:26 +0900)] 
journal-gateway: use journal_add_match_pair() and add_match_boot_id()

2 months agocoredumpctl: use strv_skip()
Yu Watanabe [Thu, 21 Mar 2024 20:18:41 +0000 (05:18 +0900)] 
coredumpctl: use strv_skip()

No functional change, just refactoring.

2 months agocoredumpctl: use journal_add_match_pair()
Yu Watanabe [Thu, 21 Mar 2024 20:14:33 +0000 (05:14 +0900)] 
coredumpctl: use journal_add_match_pair()

Also,
- use is_path(),
- drop unused pid.

2 months agotest: add missing return value check in test-dirent-util 31932/head
Luca Boccassi [Mon, 25 Mar 2024 12:05:28 +0000 (12:05 +0000)] 
test: add missing return value check in test-dirent-util

CID#1540029

Follow-up for 6a57d86bf9d7f8d6f5d339f57665dfb2e1d191c5

2 months agomkosi: Use new environment variables for Arch
Daan De Meyer [Mon, 25 Mar 2024 11:27:56 +0000 (12:27 +0100)] 
mkosi: Use new environment variables for Arch

These were changed to be prefixed with _systemd_ so let's account
for that.

2 months agohomework: add missing assert
Luca Boccassi [Mon, 25 Mar 2024 12:02:20 +0000 (12:02 +0000)] 
homework: add missing assert

'cache' is used unconditionally in this function, so add an assert.

CID#1540860

2 months agohwdb: Add mapping for ACPI quickstart keys on Toshiba Z830
Hans de Goede [Sun, 24 Mar 2024 14:04:47 +0000 (15:04 +0100)] 
hwdb: Add mapping for ACPI quickstart keys on Toshiba Z830

The Toshiba Z830 has 3 hotkeys which use the ACPI PNP0C32 quickstart spec:
https://archive.org/details/microsoft-acpi-dirapplaunch

These devices have an ACPI method called GHID() which suggests
it returns a value from the "HID Usage Tables" document, but these
methods simple returns a follow number for the button (1, 2 and 3).

The first 2 buttons are for what the manual calls "TOSHIBA eco button"
and "TOSHIBA Presentation button", since there is no good match for
these simply map them to KEY_PROG1 and KEY_PROG2.

The third button is intended to toggle the touchpad on/off, map
this to F21 which GNOME/KDE will interpret as touchpad toggle.

2 months agobuild(deps): bump pkg/arch from `4d1ecb0` to `3b86b91`
dependabot[bot] [Mon, 25 Mar 2024 09:13:21 +0000 (09:13 +0000)] 
build(deps): bump pkg/arch from `4d1ecb0` to `3b86b91`

Bumps pkg/arch from `4d1ecb0` to `3b86b91`.

---
updated-dependencies:
- dependency-name: pkg/arch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agobuild(deps): bump pkg/fedora from `2e32a33` to `f1d3866`
dependabot[bot] [Mon, 25 Mar 2024 09:13:26 +0000 (09:13 +0000)] 
build(deps): bump pkg/fedora from `2e32a33` to `f1d3866`

Bumps pkg/fedora from `2e32a33` to `f1d3866`.

---
updated-dependencies:
- dependency-name: pkg/fedora
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agobuild(deps): bump pkg/debian from `3b47281` to `1932e19`
dependabot[bot] [Mon, 25 Mar 2024 09:13:18 +0000 (09:13 +0000)] 
build(deps): bump pkg/debian from `3b47281` to `1932e19`

Bumps pkg/debian from `3b47281` to `1932e19`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agotest: Add cases for failures to import the hierarchy 31801/head
Krzesimir Nowak [Thu, 29 Feb 2024 07:19:16 +0000 (08:19 +0100)] 
test: Add cases for failures to import the hierarchy

2 months agosysext: Fail when trying to import mutable layer that's a symlink to hierarchy
Krzesimir Nowak [Wed, 28 Feb 2024 15:34:05 +0000 (16:34 +0100)] 
sysext: Fail when trying to import mutable layer that's a symlink to hierarchy

2 months agotest, sysext: Actually fail the whole operation if sd-merge worker failed
Krzesimir Nowak [Wed, 28 Feb 2024 14:41:46 +0000 (15:41 +0100)] 
test, sysext: Actually fail the whole operation if sd-merge worker failed

This also fixes a wrong merge failure check.

2 months agotest: Add test cases for sysext ephemeral-import mode
Krzesimir Nowak [Thu, 29 Feb 2024 07:18:43 +0000 (08:18 +0100)] 
test: Add test cases for sysext ephemeral-import mode

2 months agoman: Document sysext ephemeral-import mode
Krzesimir Nowak [Wed, 28 Feb 2024 13:50:05 +0000 (14:50 +0100)] 
man: Document sysext ephemeral-import mode

2 months agosysext: Implement ephemeral import mode
Krzesimir Nowak [Wed, 28 Feb 2024 13:23:22 +0000 (14:23 +0100)] 
sysext: Implement ephemeral import mode

To enable it, use "ephemeral-import" either for mutable mode environment
variable or for value of "--mutable=" flag.

This is a combination of "ephemeral" and "import" modes. It results in a
mutable hierarchy that includes contents of the mutable extension data, but the
modifications are thrown away when the hierarchy is unmerged.

2 months agotest: Extend sysext tests with cases using ephemeral mode
Krzesimir Nowak [Wed, 28 Feb 2024 08:59:18 +0000 (09:59 +0100)] 
test: Extend sysext tests with cases using ephemeral mode

2 months agoman: Document sysext ephemeral mode
Krzesimir Nowak [Wed, 28 Feb 2024 08:42:25 +0000 (09:42 +0100)] 
man: Document sysext ephemeral mode

2 months agosysext: Implement ephemeral mode
Krzesimir Nowak [Wed, 28 Feb 2024 08:17:27 +0000 (09:17 +0100)] 
sysext: Implement ephemeral mode

To enable it, use "ephemeral" either for mutable mode environment variable or
for value of "--mutable=" flag.

Instead of using mutable dir in /var/lib/extensions.mutable/<hierarchy>, we
create a directory for overlayfs upperdir and workdir in the same tmpfs mount
that sysext worker process creates in /run/systemd/sysext. As the path for the
workdir will be gone when the worker quits, there is no need to do any
additional cleanup. As such, there is also no need to store a path to workdir
in the metadata directory.

2 months agosysext: Add missing --mutable mode in help output
Krzesimir Nowak [Tue, 27 Feb 2024 15:29:08 +0000 (16:29 +0100)] 
sysext: Add missing --mutable mode in help output

2 months agoman: Install sysext man pages when ENABLE_SYSEXT is true
Krzesimir Nowak [Tue, 19 Mar 2024 13:47:36 +0000 (14:47 +0100)] 
man: Install sysext man pages when ENABLE_SYSEXT is true

2 months agotest: Extend sysext tests with cases using env var for mutable mode
Krzesimir Nowak [Tue, 27 Feb 2024 13:52:30 +0000 (14:52 +0100)] 
test: Extend sysext tests with cases using env var for mutable mode

2 months agotest: Fail sysext test if reusing a root directory
Krzesimir Nowak [Tue, 19 Mar 2024 13:40:57 +0000 (14:40 +0100)] 
test: Fail sysext test if reusing a root directory

2 months agodocs: Document SYSTEMD_SYSEXT_MUTABLE_MODE env var
Krzesimir Nowak [Wed, 20 Mar 2024 07:34:41 +0000 (08:34 +0100)] 
docs: Document SYSTEMD_SYSEXT_MUTABLE_MODE env var

2 months agosysext: Add support for mutable mode environment variables
Krzesimir Nowak [Tue, 19 Mar 2024 13:01:00 +0000 (14:01 +0100)] 
sysext: Add support for mutable mode environment variables

The environment variable names are SYSTEMD_SYSEXT_MUTABLE_MODE for
systemd-sysext and SYSTEMD_CONFEXT_MUTABLE_MODE for systemd-confext. These
override the default mutable mode setting, but can be still overridden by a
command-line flag.

2 months agosysext: Move parsing mutable mode to a separate function
Krzesimir Nowak [Tue, 19 Mar 2024 12:20:46 +0000 (13:20 +0100)] 
sysext: Move parsing mutable mode to a separate function

2 months agobasic/virt: Fix virtualbox detection on proprietary system via board_vendor
Friedrich Altheide [Wed, 20 Mar 2024 16:48:39 +0000 (17:48 +0100)] 
basic/virt: Fix virtualbox detection on proprietary system via board_vendor

Identify an virtualbox instance even if product_name, sys_vendor and bios_vendor reflect the
information of the real hardware, by checking if board_vendor == "Oracle Corporation"

This fixes #13429 again
The previous fix was removed in #21127

2 months agopo: Translated using Weblate (French)
Pierre GRASSER [Fri, 22 Mar 2024 10:36:04 +0000 (11:36 +0100)] 
po: Translated using Weblate (French)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Pierre GRASSER <pierre.grasser@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fr/
Translation: systemd/main

2 months agotest: explain how Ubuntu CI log URLs are created
Luca Boccassi [Sun, 24 Mar 2024 13:02:56 +0000 (13:02 +0000)] 
test: explain how Ubuntu CI log URLs are created

Not trivially obvious, so add a couple of paragraph to explain it

2 months agoshared: Fix TPM2 unsealing when PCR values change
Gabríel Arthúr Pétursson [Wed, 20 Mar 2024 16:48:36 +0000 (16:48 +0000)] 
shared: Fix TPM2 unsealing when PCR values change

Recreate the encryption session on each retry. It's invalidated along
with the policy session when freed, failing subsequent retries.

Unsealing HMAC key.
WARNING:esys:src/tss2-esys/api/Esys_Unseal.c:295:Esys_Unseal_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_Unseal.c:98:Esys_Unseal() Esys Finish ErrorCode (0x00000128)
A PCR value changed during the TPM2 policy session, restarting HMAC key unsealing (30 tries left).
Missing encryption session
Failed to unseal secret using TPM2: Invalid argument

Fixes #31881

2 months agoMerge pull request #31919 from YHNdnzj/analyze-verify
Luca Boccassi [Sun, 24 Mar 2024 11:50:44 +0000 (11:50 +0000)] 
Merge pull request #31919 from YHNdnzj/analyze-verify

Some fixes/improvements for analyze

2 months agoMerge pull request #31916 from YHNdnzj/socket-load-service
Luca Boccassi [Sun, 24 Mar 2024 11:43:37 +0000 (11:43 +0000)] 
Merge pull request #31916 from YHNdnzj/socket-load-service

core/socket: validate service unit load state before continuing

2 months agoMerge pull request #31886 from DaanDeMeyer/logind
Mike Yuan [Sun, 24 Mar 2024 11:19:12 +0000 (19:19 +0800)] 
Merge pull request #31886 from DaanDeMeyer/logind

logind: Add fallback for when the PIDFDs= property is not available

2 months agoMerge pull request #31917 from keszybz/path-equal-ptr-drop
Luca Boccassi [Sun, 24 Mar 2024 11:10:58 +0000 (11:10 +0000)] 
Merge pull request #31917 from keszybz/path-equal-ptr-drop

Drop unnecessary path_equal_ptr() wrapper

2 months agoMerge pull request #31913 from YHNdnzj/dynamic-user-unref
Luca Boccassi [Sun, 24 Mar 2024 11:10:10 +0000 (11:10 +0000)] 
Merge pull request #31913 from YHNdnzj/dynamic-user-unref

core/dynamic-user: trivial modernization

2 months agobpf-socket-bind: fix unexpected behavior with either 0 allow or deny rules
networkException [Sun, 10 Mar 2024 17:55:06 +0000 (18:55 +0100)] 
bpf-socket-bind: fix unexpected behavior with either 0 allow or deny rules

This patch fixes an issue where, when not specifiying either at least one
`SocketBindAllow` or `SocketBindDeny` rule, behavior for the bind syscall
filtering would be unexpected.

For example, when trying to bind to a port with only "SocketBindDeny=any"
given, the syscall would succeed:

> systemd-run -t -p "SocketBindDeny=any" nc -l 8080

Expected with this set of rules (also in accordance with the documentation)
would be an Operation not permitted error.

This behavior occurs because a default initialized socket_bind_rule struct
matches what "any" represents. When creating the bpf list all elements get
default initialized, as such represeting "any". Seemingly it is necressarry
to set the size of the map to at least one, as such if no allow rule is
given default initialization and minimal map size cause one any allow rule
to be in the map, causing the behavior observed above.

This patch solves this by introducing a new "match nothing" magic stored in
the rule's address family and setting such a rule as the first one if no
rule is given, making sure that default initialized rule structs are never
used.

Resolves #30556

2 months agoAdded resolution for Huion Kamvas Pro 19
mkubiak [Sat, 23 Mar 2024 16:53:01 +0000 (17:53 +0100)] 
Added resolution for Huion Kamvas Pro 19

2 months agoMerge pull request #31552 from AdrianVovk/homed-update-policy-v2-split
Luca Boccassi [Sun, 24 Mar 2024 10:11:09 +0000 (10:11 +0000)] 
Merge pull request #31552 from AdrianVovk/homed-update-policy-v2-split

Homed update policy: offline updates & use keyring

2 months agoanalyze: refuse --global dot/verify 31919/head
Mike Yuan [Fri, 22 Mar 2024 16:35:09 +0000 (00:35 +0800)] 
analyze: refuse --global dot/verify

I don't quite understand the rationale of making these
verbs work with --global back in the day. But realistically
they interact with/spawn manager, while there's no
--global runtime scope manager. And to verify/inspect user
units it's sufficient to just use --user.

Fixes #31911

2 months agoanalyze-dot: also show BindsTo= in --require
Mike Yuan [Fri, 22 Mar 2024 19:18:42 +0000 (03:18 +0800)] 
analyze-dot: also show BindsTo= in --require

2 months agoanalyze-dot: minor modernization
Mike Yuan [Fri, 22 Mar 2024 16:34:53 +0000 (00:34 +0800)] 
analyze-dot: minor modernization

2 months agoanalyze-security: use FOREACH_ARRAY
Mike Yuan [Fri, 22 Mar 2024 16:49:45 +0000 (00:49 +0800)] 
analyze-security: use FOREACH_ARRAY

2 months agocore/socket: use FOREACH_ARRAY at one more place 31916/head
Mike Yuan [Sat, 23 Mar 2024 17:07:30 +0000 (01:07 +0800)] 
core/socket: use FOREACH_ARRAY at one more place

2 months agocore/socket: clean up socket peer handling a bit
Mike Yuan [Sat, 23 Mar 2024 11:55:27 +0000 (19:55 +0800)] 
core/socket: clean up socket peer handling a bit

Currently, SocketPeer object acquired through
socket_acquire_peer() are referenced twice
in socket_enter_running and service_set_socket_fd,
and the reference taken by former gets dropped
through _cleanup_. This is a bit confusing.
Let's just pass ownership instead.

2 months agocore/socket: remove duplicate unit_add_two_dependencies
Mike Yuan [Sat, 23 Mar 2024 09:27:46 +0000 (17:27 +0800)] 
core/socket: remove duplicate unit_add_two_dependencies

2 months agocore/socket: validate service unit load state before continuing
Mike Yuan [Sat, 23 Mar 2024 09:26:55 +0000 (17:26 +0800)] 
core/socket: validate service unit load state before continuing

Fixes #31915

2 months agocore: introduce UNIT_IS_LOAD_ERROR helper
Mike Yuan [Sat, 23 Mar 2024 09:37:36 +0000 (17:37 +0800)] 
core: introduce UNIT_IS_LOAD_ERROR helper

2 months agoshared/install: use PATH_IN_SET() 31917/head
Zbigniew Jędrzejewski-Szmek [Sat, 23 Mar 2024 12:30:24 +0000 (13:30 +0100)] 
shared/install: use PATH_IN_SET()

2 months agoDrop unnecessary path_equal_ptr() wrapper
Zbigniew Jędrzejewski-Szmek [Sat, 23 Mar 2024 12:18:24 +0000 (13:18 +0100)] 
Drop unnecessary path_equal_ptr() wrapper

path_equal already works with NULL pointers.

2 months agocore/swap: another try on memory mgmt
Mike Yuan [Sat, 23 Mar 2024 08:53:50 +0000 (16:53 +0800)] 
core/swap: another try on memory mgmt

Follow-up for ba31a5018f99864c22dd4e0f10712456c7abc934

Another stupid mistake... Shouldn't have
written anything when I was tired.

2 months agoFix bpf-framework build failure with gcc-bpf
Michael Biebl [Fri, 22 Mar 2024 12:26:45 +0000 (13:26 +0100)] 
Fix bpf-framework build failure with gcc-bpf

The -mkernel option was dropped in
https://github.com/gcc-mirror/gcc/commit/da445a5858299ed2a72af1089c225a438ab93ce2

We also need to ensure that the include paths are properly set for the
linux kernel headers.

Fixes: #31869
2 months agoMerge pull request #31907 from mrc0mmand/efi-shenanigans
Zbigniew Jędrzejewski-Szmek [Sat, 23 Mar 2024 11:04:14 +0000 (12:04 +0100)] 
Merge pull request #31907 from mrc0mmand/efi-shenanigans

efi: check if all sections of our EFI binaries are properly aligned

2 months agoMerge pull request #31779 from keszybz/elf2efi-clang-18
Zbigniew Jędrzejewski-Szmek [Sat, 23 Mar 2024 11:02:34 +0000 (12:02 +0100)] 
Merge pull request #31779 from keszybz/elf2efi-clang-18

Make elf2efi work with clang-18

2 months agoTEST-46-HOMED: Disable auth rate-limiting 31552/head
Adrian Vovk [Tue, 5 Mar 2024 17:25:42 +0000 (12:25 -0500)] 
TEST-46-HOMED: Disable auth rate-limiting

Rate limiting authentication attempts in the test can cause somewhat
sporadic test failures: adding a test case might suddenly cause future
test cases to fail because of too many authentication attempts too
quickly

We're not trying to test the rate-limiting, we're trying to test the
functionality of homed. So we effectively disable rate-limiting on all
the home areas we create

2 months agoupdate TODO
Adrian Vovk [Thu, 1 Feb 2024 19:15:48 +0000 (14:15 -0500)] 
update TODO

2 months agohomework: Implement offline updates
Adrian Vovk [Thu, 1 Feb 2024 18:35:03 +0000 (13:35 -0500)] 
homework: Implement offline updates

This makes it possible to update a home record (and blob directory) of a
home area that's either completely absent (i.e. on a USB stick that's
unplugged) or just inaccessible due to lack of authentication

2 months agohomework: Accept volume key from keyring
Adrian Vovk [Thu, 1 Feb 2024 16:43:48 +0000 (11:43 -0500)] 
homework: Accept volume key from keyring

This bypasses authentication (i.e. user_record_authenticate) if the
volume key was loaded from the keyring and no secret section is
provided.

This also changes Update() and Resize() to always try and load the
volume key from the keyring. This makes the secret section optional for
these methods while still letting them function (as long as the home
area is active)

2 months agohomework: Always upload volume key to keyring
Adrian Vovk [Thu, 1 Feb 2024 04:49:24 +0000 (23:49 -0500)] 
homework: Always upload volume key to keyring

This commit makes homework always upload the LUKS volume key into the
kernel keyring. This is different from previous behavior in three
notable ways:

- Previously, we'd only upload if auto-resize was on. In preparation for
upcoming changes, now we always upload

- Previously, we'd upload the user's actual password (or a password
obtained from a FIDO key or similar). Now, we upload the LUKS volume key
itself, to remove a layer of unnecessary indirection.

- Previously, Lock() wouldn't remove the key from the kernel keyring.
This, of course, defeats the purpose of Lock(), so now it removes the
key

This commit also allows the LUKS volume to be unlocked using the volume
key we obtained from the keyring.

2 months agohomed: Ensure closed FD is handled before bus req
Adrian Vovk [Thu, 21 Mar 2024 17:51:16 +0000 (13:51 -0400)] 
homed: Ensure closed FD is handled before bus req

Before this fix, the following sequence of events was possible:
1. A client holding a Ref() FD closes their FD
2. kernel sends notification that all clients closed their FDs
3. Another client obtains its own Ref() FD from homed
4. homed handles the notification that all clients have closed their
   Ref() FDs. Thus it loses track of the fact that the session is
   actually still being held open by the client from step 3

This change makes sure that homed won't respond to bus messages (and
thus won't open more Ref() FDs) until it has handled all notifications
about the existing FDs being closed.

logind has had a very similar fix applied to it in
e11544a8305ab9dea097c74bb16e296150c9cc10

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

2 months agocore/dynamic-user: trivial modernization 31913/head
Mike Yuan [Fri, 22 Mar 2024 19:43:30 +0000 (03:43 +0800)] 
core/dynamic-user: trivial modernization

2 months agocore/execute: use STR_IN_SET where appropriate
Mike Yuan [Fri, 22 Mar 2024 17:26:22 +0000 (01:26 +0800)] 
core/execute: use STR_IN_SET where appropriate

2 months agoMerge pull request #31670 from CodethinkLabs/vmspawn/generate_ssh_keys
Luca Boccassi [Fri, 22 Mar 2024 16:28:03 +0000 (16:28 +0000)] 
Merge pull request #31670 from CodethinkLabs/vmspawn/generate_ssh_keys

vmspawn: generate ssh keys

2 months agoMerge pull request #31908 from DaanDeMeyer/mkosi
Luca Boccassi [Fri, 22 Mar 2024 16:22:42 +0000 (16:22 +0000)] 
Merge pull request #31908 from DaanDeMeyer/mkosi

Various mkosi fixes

2 months agotree-wide: Add allow_pidfd argument to bus_append_scope_pidref() 31886/head
Daan De Meyer [Fri, 22 Mar 2024 16:03:35 +0000 (17:03 +0100)] 
tree-wide: Add allow_pidfd argument to bus_append_scope_pidref()

2 months agomkosi: Switch to Arch Linux packaging sources main branch 31908/head
Daan De Meyer [Fri, 22 Mar 2024 15:49:46 +0000 (16:49 +0100)] 
mkosi: Switch to Arch Linux packaging sources main branch

https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/merge_requests/8
was merged so let's switch branches to the main branch.

2 months agomkosi: Disable debug package generation on Arch Linux
Daan De Meyer [Fri, 22 Mar 2024 15:49:10 +0000 (16:49 +0100)] 
mkosi: Disable debug package generation on Arch Linux

This is extremely slow since the latest pacman release, and since
we don't strip binaries, not really needed either.

2 months agotools/elf2efi: elif→if to make pylint happy 31779/head
Zbigniew Jędrzejewski-Szmek [Fri, 22 Mar 2024 14:44:17 +0000 (15:44 +0100)] 
tools/elf2efi: elif→if to make pylint happy

2 months agotools/elf2efi: skip empty .got section and its .relro_padding
Zbigniew Jędrzejewski-Szmek [Thu, 14 Mar 2024 09:33:11 +0000 (10:33 +0100)] 
tools/elf2efi: skip empty .got section and its .relro_padding

Resolves https://github.com/systemd/systemd/issues/31637.

lld-18 does the section setup differently than older versions. There is a bunch
of ordering chagnes, but it also inserts the following:

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
...
  9 .got          00000000  00000000000283c0  00000000000283c0  000283c0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 10 .relro_padding 00000c40  00000000000283c0  00000000000283c0  000283c0  2**0
                  ALLOC
 11 .data         00000024  00000000000293c0  00000000000293c0  000283c0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
...

This causes a problem for us, because we try to map the .got to .rodata,
and the subsequent .data to .data, and round down the VMA to the nearest
page, which causes the PE sections to overlap.

https://github.com/llvm/llvm-project/pull/66042 adds .relro_padding to make
sure that the RELRO segment is properly write protected and allocated. For our
binaries, the .got section is empty, so we can skip it safely, and the
.relro_padding section is not useful once .got has been dropped.

We don't expect .got sections, but they are apparently inserted on i386 and
aarch64 builds. Emit a warning until we figure out why they are there.

2 months agomkosi: Enable log context
Daan De Meyer [Fri, 22 Mar 2024 14:15:01 +0000 (15:15 +0100)] 
mkosi: Enable log context

2 months agomkosi: Make sure man and man-db are installed everywhere
Daan De Meyer [Fri, 22 Mar 2024 14:12:20 +0000 (15:12 +0100)] 
mkosi: Make sure man and man-db are installed everywhere

2 months agotest: Install test journals
Daan De Meyer [Fri, 22 Mar 2024 11:08:52 +0000 (12:08 +0100)] 
test: Install test journals

Let's package these just like we package other test data.