]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoportable: make sure to fsync after extracting/copying 28014/head
Luca Boccassi [Mon, 12 Jun 2023 22:51:51 +0000 (23:51 +0100)] 
portable: make sure to fsync after extracting/copying

Just in case we are on a flimsy filesystem/disk

2 years agoportable: do not extract empty unit files
Luca Boccassi [Mon, 12 Jun 2023 22:47:03 +0000 (23:47 +0100)] 
portable: do not extract empty unit files

Bare minimum sanity check, an empty unit is an invalid unit so
skip it early.

2 years agoupdate TODO
Lennart Poettering [Mon, 12 Jun 2023 21:00:47 +0000 (23:00 +0200)] 
update TODO

2 years agoboot: Unify protocol opening
Jan Janssen [Mon, 12 Jun 2023 13:12:05 +0000 (15:12 +0200)] 
boot: Unify protocol opening

We are using HandleProtocol everywhere except in these few cases. This
unifies on HandleProtocol as it is simpler to use and equivalent to
OpenProtocol.

The only difference between the two is that OpenProtocol attributes the
opened protocol to a firmware-owned handle instead of our image handle.
This has no real use for regular UEFI applications as any protocols
opened via BY_HANDLE or GET_PROTOCOL is not required to be closed. In
fact, when a protocol is uninstalled it will do nothing more than reduce
the open count for these.

2 years agoman: explain timesyncd epoch mtime touch files in a bit more detail
Lennart Poettering [Mon, 12 Jun 2023 12:06:10 +0000 (14:06 +0200)] 
man: explain timesyncd epoch mtime touch files in a bit more detail

Let's mention what /usr/lib/clock-epoch precisely does, and underline we
only *advance* the time based on it.

Inspired by Darkdragon-001's #23214.

Replaces #23214

2 years agoMerge pull request #27989 from poettering/message-append-string-set
Lennart Poettering [Mon, 12 Jun 2023 12:12:05 +0000 (14:12 +0200)] 
Merge pull request #27989 from poettering/message-append-string-set

common helpers for serializing Set of strings into bus message

2 years agobus-util: add bus_property_get_string_set() helper 27989/head
Lennart Poettering [Fri, 9 Jun 2023 19:45:31 +0000 (21:45 +0200)] 
bus-util: add bus_property_get_string_set() helper

This is a common implementation of a property getter for a Set of
strings.

2 years agobus-util: add bus_message_append_string_set() helper
Lennart Poettering [Fri, 9 Jun 2023 17:12:51 +0000 (19:12 +0200)] 
bus-util: add bus_message_append_string_set() helper

This new helper adds all strings from a Set object as a string array to
a message.

Various places where we have similar code are then ported over to this.

2 years agotest: drop test for IFLA_NUM_RX_QUEUES
Yu Watanabe [Sat, 10 Jun 2023 07:45:02 +0000 (16:45 +0900)] 
test: drop test for IFLA_NUM_RX_QUEUES

The attribute is not included in the netlink message if the kernel
built with CONFIG_RPS disabled.

Fixes #27969.

2 years agomeson: add systemd.pc and udev.pc to 'devel' target/tag
Luca Boccassi [Sun, 11 Jun 2023 23:41:49 +0000 (00:41 +0100)] 
meson: add systemd.pc and udev.pc to 'devel' target/tag

Same as the other pkg-config files, it is useful to install these in a specific
target that doesn't require compiling anything

2 years agotest: make coverage runs happy again
Frantisek Sumsal [Sun, 11 Jun 2023 07:02:52 +0000 (09:02 +0200)] 
test: make coverage runs happy again

2 years agoMerge pull request #27980 from bluca/tests
Yu Watanabe [Sat, 10 Jun 2023 08:46:10 +0000 (17:46 +0900)] 
Merge pull request #27980 from bluca/tests

add unit tests for *DirectorySymlink= and deserialize_strv helper

2 years agoexecute: fix minor type confusion
Lennart Poettering [Fri, 9 Jun 2023 19:57:51 +0000 (21:57 +0200)] 
execute: fix minor type confusion

The .gl_pathc field is size_t, hence count in size_t too, to not
accidentally drop 32 of 64bits on the floor.

2 years agohwdb: fix arrow keys on HP Elite Dragonfly G3
Benjamin Raison [Fri, 9 Jun 2023 22:34:28 +0000 (00:34 +0200)] 
hwdb: fix arrow keys on HP Elite Dragonfly G3

2 years agobattery-util: debug log when we're unsure about the battery level
Mike Yuan [Fri, 9 Jun 2023 16:30:41 +0000 (00:30 +0800)] 
battery-util: debug log when we're unsure about the battery level

2 years agoman: 'flag' parameter in portable1 spec is now used
Luca Boccassi [Fri, 9 Jun 2023 15:14:59 +0000 (16:14 +0100)] 
man: 'flag' parameter in portable1 spec is now used

It has been used for a while, and it is described fully a couple of
paragraphs below, but this snippet was not deleted.

2 years agotree-wide: fix typos of "boottime"/"BOOTTIME"
Nick Rosbrook [Fri, 9 Jun 2023 16:21:11 +0000 (12:21 -0400)] 
tree-wide: fix typos of "boottime"/"BOOTTIME"

2 years agoserialize: add deserialize_strv helper 27980/head
Luca Boccassi [Thu, 1 Jun 2023 18:32:29 +0000 (19:32 +0100)] 
serialize: add deserialize_strv helper

2 years agotest-execute: add unit tests for *DirectorySymlink=
Luca Boccassi [Fri, 2 Jun 2023 22:00:18 +0000 (23:00 +0100)] 
test-execute: add unit tests for *DirectorySymlink=

2 years agoxdg-autostart-generator: extend start timeout
Lennart Poettering [Thu, 8 Jun 2023 13:29:17 +0000 (15:29 +0200)] 
xdg-autostart-generator: extend start timeout

The current start + stop timeouts for xdg autostart files are *very*
short with 5s. On a busy system this might be too easy to hit even in
unintended case.

Apparently, the intention here was to cut the shutdown logic short.
(https://github.com/systemd/systemd/issues/27919#issuecomment-1580576178)
Let's hence stick to the very short timeout for that (under the
assumption that apps are written in a safe enough style to not lose data
if killed too early). But for starting XGD autostrat services, use our
regular timeouts.

See: #27919

2 years agoboot: Fix memory leak
Jan Janssen [Thu, 8 Jun 2023 17:04:22 +0000 (19:04 +0200)] 
boot: Fix memory leak

2 years agoMerge pull request #26059 from DaanDeMeyer/cred-glob
Luca Boccassi [Thu, 8 Jun 2023 19:40:37 +0000 (20:40 +0100)] 
Merge pull request #26059 from DaanDeMeyer/cred-glob

creds: Add ImportCredential=

2 years agoMerge pull request #26848 from yuwata/kernel-install
Luca Boccassi [Thu, 8 Jun 2023 19:23:10 +0000 (20:23 +0100)] 
Merge pull request #26848 from yuwata/kernel-install

kernel-install: rewrite in C

2 years agointegritysetup: support mode=(journal|bitmap|direct)
Alfred Klomp [Thu, 8 Jun 2023 11:26:24 +0000 (13:26 +0200)] 
integritysetup: support mode=(journal|bitmap|direct)

Add a parameter to the integritytab file to set the mode in which to
open the integrity volume. The mode can be journaled (the default),
bitmap without a journal, or direct mode without a journal or a bitmap.

This change removes the `no-journal' option because it is redundant,
being replaced with `mode=direct'.

Supercedes commit bcc1ee56c, from a week ago, which implemented
`no-journal'.

Resolves #27587

2 years agoman/os-release: Add VENDOR_NAME= and VENDOR_URL= keys to os-release
Philip Withnall [Wed, 31 May 2023 14:49:42 +0000 (15:49 +0100)] 
man/os-release: Add VENDOR_NAME= and VENDOR_URL= keys to os-release

These will be used in UIs to refer to the company or organization which
produces the OS separately from referring to the OS itself.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #27777
2 years agoman: document that "systemctl mask" doesn't work for units whose file is in /etc
Lennart Poettering [Thu, 8 Jun 2023 14:59:15 +0000 (16:59 +0200)] 
man: document that "systemctl mask" doesn't work for units whose file is in /etc

Fixes: #27965
2 years agoMerge pull request #27712 from ddstreet/tpm2_simplify_srk
Luca Boccassi [Thu, 8 Jun 2023 17:52:31 +0000 (18:52 +0100)] 
Merge pull request #27712 from ddstreet/tpm2_simplify_srk

Tpm2 simplify srk

2 years agoac-power: fix a typo
Mike Yuan [Mon, 5 Jun 2023 15:03:58 +0000 (23:03 +0800)] 
ac-power: fix a typo

2 years agoman: reference naming of triggered services of timer unit
Lennart Poettering [Thu, 8 Jun 2023 12:20:42 +0000 (14:20 +0200)] 
man: reference naming of triggered services of timer unit

Fixes: #27116
2 years agoMerge pull request #27968 from poettering/may-gc-tweaks
Lennart Poettering [Thu, 8 Jun 2023 12:54:09 +0000 (14:54 +0200)] 
Merge pull request #27968 from poettering/may-gc-tweaks

pid1: some minor GC logic tweaks

2 years agoMerge pull request #27961 from poettering/journalctl-user-unit-man-fix
Mike Yuan [Thu, 8 Jun 2023 12:19:07 +0000 (20:19 +0800)] 
Merge pull request #27961 from poettering/journalctl-user-unit-man-fix

journalctl: fix --user when invoked by system users

2 years agounits: Use ImportCredential= where applicable 26059/head
Daan De Meyer [Thu, 8 Jun 2023 12:09:36 +0000 (14:09 +0200)] 
units: Use ImportCredential= where applicable

2 years agocreds: Add ImportCredential=
Daan De Meyer [Fri, 13 Jan 2023 15:22:46 +0000 (16:22 +0100)] 
creds: Add ImportCredential=

ImportCredential= takes a credential name and searches for a matching
credential in all the credential stores we know about it. It supports
globs which are expanded so that all matching credentials are loaded.

2 years agotpm2: add tpm2_get_legacy_template() and tpm2_get_srk_template() 27712/head
Dan Streetman [Fri, 17 Feb 2023 17:59:18 +0000 (12:59 -0500)] 
tpm2: add tpm2_get_legacy_template() and tpm2_get_srk_template()

Add functions to get either the 'legacy' or standard SRK template, for RSA or
ECC. The 'legacy' templates are those used with earlier code, where a transient
key was created to use for tpm sealing; the standard SRK is the persistent
shared key as defined in TCG guidance docs.

This also replaces tpm2_get_primary_template() with the new functions; that
function's use of flags is confusing and unnecessary.

2 years agotpm2: add tpm2_read_public()
Dan Streetman [Thu, 18 May 2023 00:03:00 +0000 (20:03 -0400)] 
tpm2: add tpm2_read_public()

2 years agotpm2: add tpm2_get_capability_handle(), tpm2_esys_handle_from_tpm_handle()
Dan Streetman [Fri, 17 Feb 2023 17:50:31 +0000 (12:50 -0500)] 
tpm2: add tpm2_get_capability_handle(), tpm2_esys_handle_from_tpm_handle()

Add tpm2_get_capability_handle() to query if a "TPM handle" (meaning, a
location/address in TPM storage) is populated in the TPM, and
tpm2_get_capability_handles() to query for a specific number of handles.

Add tpm2_esys_handle_from_tpm_handle() to create an "esys handle" (an opaque
reference for use with the TPM EAPI that represents a TPM handle address) for an
existing TPM handle.

Since the TPM handle already exists in the TPM, this also also requires
updating the cleanup code for Tpm2Handle objects to close the object (free its
resources only from the EAPI code, but leave the handle in the TPM) instead of
flush the object (which frees its EAPI resources and removes it from the TPM).

2 years agoexecute: Make credential_search_path() more flexible
Daan De Meyer [Tue, 17 Jan 2023 10:10:04 +0000 (11:10 +0100)] 
execute: Make credential_search_path() more flexible

Let's also allow looking up only the encrypted credential search
path.

2 years agocore: do not GC units/jobs that are in the D-Bus queue 27968/head
Lennart Poettering [Thu, 8 Jun 2023 09:11:49 +0000 (11:11 +0200)] 
core: do not GC units/jobs that are in the D-Bus queue

Let's make sure that D-Bus messages are always sent out when pending,
before we might GC a unit/job.

This is kinda a follow-up for 8db998981a4fefd0122bcf5f965726b63c9045c2,
and a similar logic really applies: GC should only be done if we
processed everything else, generated evertyhing else and really don't
need it anymore.

2 years agounit: don't gc unit in oom queue
Lennart Poettering [Thu, 8 Jun 2023 09:11:28 +0000 (11:11 +0200)] 
unit: don't gc unit in oom queue

This is a follow-up for 8db998981a4fefd0122bcf5f965726b63c9045c2, and
follows a similar logic: a pending OOM event really trumps everything:
we should not GC a unit while it is pending.

2 years agoman: document how calendar times catch up after system suspend/hibernation
Lennart Poettering [Thu, 8 Jun 2023 08:33:36 +0000 (10:33 +0200)] 
man: document how calendar times catch up after system suspend/hibernation

Fixes: #26166
2 years agoupdate TODO
Lennart Poettering [Thu, 8 Jun 2023 07:55:18 +0000 (09:55 +0200)] 
update TODO

2 years agoman: document that journalctl --user requires Storage=persistent 27961/head
Lennart Poettering [Wed, 7 Jun 2023 14:23:45 +0000 (16:23 +0200)] 
man: document that journalctl --user requires Storage=persistent

Fixes: #25061
2 years agosd-journal: when SD_JOURNAL_CURRENT_USER is set, and called from system UID, imply...
Lennart Poettering [Wed, 7 Jun 2023 13:19:25 +0000 (15:19 +0200)] 
sd-journal: when SD_JOURNAL_CURRENT_USER is set, and called from system UID, imply SD_JOURNAL_SYSTEM

Fixes: #26742 #23679
2 years agojournald: move uid_for_system_journal() to uid-alloc-range.h
Lennart Poettering [Wed, 7 Jun 2023 13:16:50 +0000 (15:16 +0200)] 
journald: move uid_for_system_journal() to uid-alloc-range.h

Let's move this helper call from journald specific code to src/basic/,
so that we can use it from sd-journal.

While we are at it, slightly extend it to also cover container uids,
which are also routed to the system journal now.

This places the call in uid-alloc-range.[ch] which contains similar
functions that match UID ranges for specific purposes.

2 years agoshared: move uid-alloc-range.[ch] from src/shared/ → src/basic/
Lennart Poettering [Wed, 7 Jun 2023 13:15:42 +0000 (15:15 +0200)] 
shared: move uid-alloc-range.[ch] from src/shared/ → src/basic/

This way we can use it in libsystemd

2 years agoman: suffix --unit with an equal sign, since it expects an argument
Lennart Poettering [Wed, 7 Jun 2023 12:54:34 +0000 (14:54 +0200)] 
man: suffix --unit with an equal sign, since it expects an argument

As per our usual syntax in the docs.

2 years agotpm2: replace _cleanup_tpm2_* macros with _cleanup_()
Dan Streetman [Wed, 17 May 2023 21:16:23 +0000 (17:16 -0400)] 
tpm2: replace _cleanup_tpm2_* macros with _cleanup_()

Remove _cleanup_tpm2_context_ and _cleanup_tpm2_handle_ macros, replacing their
use with _cleanup_(tpm2_context_unrefp) and _cleanup_(tpm2_handle_freep),
respectively.

2 years agoman: drop documentation of internal lookup flags
Lennart Poettering [Wed, 7 Jun 2023 21:37:11 +0000 (23:37 +0200)] 
man: drop documentation of internal lookup flags

This removes documentation of SD_RESOLVED_REQUIRE_PRIMARY and
SD_RESOLVED_CLAMP_TTL, which are internal flags, and not usable from
outside of resolved. They are refused by D-Bus APIs, for a reason.

Various other fixes/clean-ups of the relevant docs (including reordering
of the flags docs by "grouping" rather than bit values).

Fixes: #26619
2 years agoMerge pull request #27958 from mrc0mmand/test-functions-tweaks
Luca Boccassi [Wed, 7 Jun 2023 20:54:01 +0000 (21:54 +0100)] 
Merge pull request #27958 from mrc0mmand/test-functions-tweaks

test: a couple of assorted test-functions tweaks

2 years agopam_systemd_home: suppress LOG_DEBUG msgs if debugging is off
David Tardon [Wed, 7 Jun 2023 13:16:18 +0000 (15:16 +0200)] 
pam_systemd_home: suppress LOG_DEBUG msgs if debugging is off

This is a "sequel" to commit 2675747f3cdd6f1e6236bbb2f79abfa53fb307f1 .

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2210770
2 years agopreset: enable systemd-networkd-wait-online.service by default
Lennart Poettering [Wed, 7 Jun 2023 14:37:52 +0000 (16:37 +0200)] 
preset: enable systemd-networkd-wait-online.service by default

As #25459 points out our default preset is contradictory. Let's fix
that.

This enables systemd-networkd-wait-online.service, as we enable
systemd-networkd.service which enables that anyway.

This is safe since network-online.target should not be pulled in by
default.

Fixes: #25459
2 years agoMerge pull request #27960 from DaanDeMeyer/update-mkosi
Daan De Meyer [Wed, 7 Jun 2023 14:37:02 +0000 (16:37 +0200)] 
Merge pull request #27960 from DaanDeMeyer/update-mkosi

mkosi: Update to latest

2 years agotest: wrap agetty & getfacl when running with sanitizers 27958/head
Frantisek Sumsal [Wed, 7 Jun 2023 14:26:21 +0000 (16:26 +0200)] 
test: wrap agetty & getfacl when running with sanitizers

The list is getting slightly ridiculous.

2 years agomkosi: Update to latest 27960/head
Daan De Meyer [Wed, 7 Jun 2023 13:59:03 +0000 (15:59 +0200)] 
mkosi: Update to latest

mkosi's match syntax was changed so we update our config files to
use the new match syntax which mimicks the systemd condition syntax.

2 years agotest: drop $SKIP_INITRD
Frantisek Sumsal [Wed, 7 Jun 2023 13:21:10 +0000 (15:21 +0200)] 
test: drop $SKIP_INITRD

It's pointless nowadays, since we always need an initrd for the test VMs
as we require modules that are usually not compiled in the kernel.

2 years agotest: rebuild the ldconfig cache after changing its configuration
Frantisek Sumsal [Wed, 7 Jun 2023 13:19:44 +0000 (15:19 +0200)] 
test: rebuild the ldconfig cache after changing its configuration

Follow-up to ba79e8c2cc.

2 years agoman: mention that OnCalendar= combines well with systemd-time-wait-sync.service
Lennart Poettering [Wed, 7 Jun 2023 12:31:02 +0000 (14:31 +0200)] 
man: mention that OnCalendar= combines well with systemd-time-wait-sync.service

Fixes: #23440
2 years agoFix zsh completion for "localectl set-locale"
Cyril Roelandt [Wed, 7 Jun 2023 12:33:19 +0000 (14:33 +0200)] 
Fix zsh completion for "localectl set-locale"

When running:

    $ localectl set-locale LC_MESSAGES=<TAB>

One is prompted with a list of locale fields instead of the list of
valid locales. This is because by calling "compset -P1 '*='", we modify
the $PREFIX special parameter before testing whether it contains an
equal sign. Therefore

    if [[ -prefix 1 *\= ]]

is always false, and we always suggest a list of locale fields to the
user.

Fixes: #27955
2 years agokbd-model-map: change the order of Hungarian keymaps
Balló György [Wed, 7 Jun 2023 11:33:18 +0000 (13:33 +0200)] 
kbd-model-map: change the order of Hungarian keymaps

This changes the console layout from 'hu101' to 'hu' when the user calls 'localectl set-x11-keymap hu', because 'hu' is the expected layout instead of 'hu101' for most users.

2 years agoMerge pull request #27629 from ddstreet/tpm2_verify_sym_params
Daan De Meyer [Wed, 7 Jun 2023 11:48:54 +0000 (13:48 +0200)] 
Merge pull request #27629 from ddstreet/tpm2_verify_sym_params

Tpm2 verify sym params

2 years agoMerge pull request #27882 from DaanDeMeyer/repart-truncate
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jun 2023 11:32:11 +0000 (13:32 +0200)] 
Merge pull request #27882 from DaanDeMeyer/repart-truncate

copy: Add COPY_TRUNCATE

2 years agoresolved: add comment clarifying why we decompress DNS names when parsing SRV
Lennart Poettering [Wed, 7 Jun 2023 10:23:25 +0000 (12:23 +0200)] 
resolved: add comment clarifying why we decompress DNS names when parsing SRV

Fixes: #22838
2 years agoman: document which IP ports resolved listens on, and what for
Lennart Poettering [Wed, 7 Jun 2023 10:47:09 +0000 (12:47 +0200)] 
man: document which IP ports resolved listens on, and what for

Fixes: #23045
2 years agoMerge pull request #27885 from DaanDeMeyer/please-dont-make-me-write-more-openat...
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jun 2023 11:25:33 +0000 (13:25 +0200)] 
Merge pull request #27885 from DaanDeMeyer/please-dont-make-me-write-more-openat-helpers

Add more openat like helper functions

2 years agopam: add call to pam_umask
Michal Sekletar [Wed, 31 May 2023 16:50:12 +0000 (18:50 +0200)] 
pam: add call to pam_umask

Setting umask for user sessions via UMASK setting in /etc/login.defs is
a well-known feature. Let's make sure that user manager also runs with
this umask value.

Follow-up for 5e37d1930b41b24c077ce37c6db0e36c745106c7.

2 years agosd-login: add sd_session_get_leader interface
Thorsten Kukuk [Tue, 6 Jun 2023 12:52:22 +0000 (14:52 +0200)] 
sd-login: add sd_session_get_leader interface

2 years agoMerge pull request #27925 from DaanDeMeyer/repart-encrypt
Daan De Meyer [Tue, 6 Jun 2023 19:36:09 +0000 (21:36 +0200)] 
Merge pull request #27925 from DaanDeMeyer/repart-encrypt

repart: Do online encryption when loop devices are available

2 years agounits: change TimeoutSec=0 to TimeoutSec=infinity
Lennart Poettering [Tue, 6 Jun 2023 07:29:51 +0000 (09:29 +0200)] 
units: change TimeoutSec=0 to TimeoutSec=infinity

Follow-up for #27936

Let's also update a bunch of static unit files, matching what we just
did for the generators.

2 years agoMerge pull request #27938 from keszybz/ukify-build-verb
Luca Boccassi [Tue, 6 Jun 2023 17:22:45 +0000 (18:22 +0100)] 
Merge pull request #27938 from keszybz/ukify-build-verb

Add 'ukify build' verb, expand tests

2 years agoukify: add 'build' verb 27938/head
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 11:23:49 +0000 (13:23 +0200)] 
ukify: add 'build' verb

The old syntax with linux + initrds as positional arguments is still accepted,
but a warning is emitted. We should remove the support for this after the
next release or so.

Adding a single verb by itself is not very useful, but opens the door to adding
other verbs.

2 years agotest_ukify: pass through path to addon stub
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 11:03:41 +0000 (13:03 +0200)] 
test_ukify: pass through path to addon stub

Without this, the tests would generally be skipped, since we haven't made a
release with the addon stub yet. But even if the file is there, we always want
to test the freshly-built item.

2 years agotest_ukify: no stinky root needed for signing
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 10:18:56 +0000 (12:18 +0200)] 
test_ukify: no stinky root needed for signing

C.f. b2efe286587e11e2aa4a6c7e4a2c15da3bb58a2a.

2 years agoukify: simplify creation of parser
Zbigniew Jędrzejewski-Szmek [Mon, 5 Jun 2023 13:47:00 +0000 (15:47 +0200)] 
ukify: simplify creation of parser

00e5933f57c6e336ebed18601299acc6855bb3c2 made all the positional arguments
optional, so let's take advantage of this to simplify variuos callers.

2 years agorepart: Do online encryption when loop devices are available 27925/head
Daan De Meyer [Mon, 5 Jun 2023 11:15:04 +0000 (13:15 +0200)] 
repart: Do online encryption when loop devices are available

Online encryption is much faster then offline encryption when using
cryptsetup. To take advantage of this, when loop devices are available,
let's use online encryption instead off offline encryption to encrypt
partitions.

The online encryption logic is the same logic as was removed in
48a09a8fff480aab9a68e95e95cc37f6b1438751, except that it's now
integrated with PartitionTarget to ensure that logic outside of
partition_target_encrypt() has to minimally change regardless of
whether we're doing online or offline encryption.

2 years agoMerge pull request #27918 from yuwata/chase-filename
Daan De Meyer [Tue, 6 Jun 2023 13:01:37 +0000 (15:01 +0200)] 
Merge pull request #27918 from yuwata/chase-filename

chase: handle root path more carefully in chase_and_open()

2 years agobtrfs-util: Add btrfs_subvol_snapshot_at() 27885/head
Daan De Meyer [Thu, 1 Jun 2023 12:59:59 +0000 (14:59 +0200)] 
btrfs-util: Add btrfs_subvol_snapshot_at()

2 years agochattr-util: Make chattr_full() an openat() style function
Daan De Meyer [Thu, 1 Jun 2023 12:52:56 +0000 (14:52 +0200)] 
chattr-util: Make chattr_full() an openat() style function

2 years agobtrfs-util: Add btrfs_subvol_set_read_only_at()
Daan De Meyer [Thu, 1 Jun 2023 12:43:30 +0000 (14:43 +0200)] 
btrfs-util: Add btrfs_subvol_set_read_only_at()

2 years agorm-rf: Add rm_rf_at()
Daan De Meyer [Thu, 1 Jun 2023 12:36:47 +0000 (14:36 +0200)] 
rm-rf: Add rm_rf_at()

2 years agobtrfs-util: Add btrfs_subvol_remove_at()
Daan De Meyer [Thu, 1 Jun 2023 12:32:39 +0000 (14:32 +0200)] 
btrfs-util: Add btrfs_subvol_remove_at()

We also remove btrfs_subvol_remove_fd() because btrfs_subvol_remove_at()
is more general.

2 years agotest-chase: Add one more test for chase_and_openat()
Daan De Meyer [Fri, 2 Jun 2023 09:05:10 +0000 (11:05 +0200)] 
test-chase: Add one more test for chase_and_openat()

2 years agochase: Allow passing NULL as the empty path to chaseat()
Daan De Meyer [Fri, 2 Jun 2023 09:00:48 +0000 (11:00 +0200)] 
chase: Allow passing NULL as the empty path to chaseat()

Per coding style, we should accept NULL as the empty path.

2 years agotest-chase: Fix comment
Daan De Meyer [Fri, 2 Jun 2023 08:55:24 +0000 (10:55 +0200)] 
test-chase: Fix comment

2 years agofd-util: Add path_is_root_at()
Daan De Meyer [Thu, 1 Jun 2023 12:26:35 +0000 (14:26 +0200)] 
fd-util: Add path_is_root_at()

A generalization of dir_fd_is_root() that allows passing a path
component.

2 years agobtrfs-util: Add btrfs_is_subvol_at()
Daan De Meyer [Thu, 1 Jun 2023 11:58:29 +0000 (13:58 +0200)] 
btrfs-util: Add btrfs_is_subvol_at()

2 years agostat-util: Add is_fs_type_at()
Daan De Meyer [Thu, 1 Jun 2023 11:57:58 +0000 (13:57 +0200)] 
stat-util: Add is_fs_type_at()

2 years agostat-util: Follow coding style in xstatfsat()
Daan De Meyer [Thu, 1 Jun 2023 11:57:04 +0000 (13:57 +0200)] 
stat-util: Follow coding style in xstatfsat()

Allow passing NULL to indicate the empty path per coding style.

2 years agofs-util: Allow passing NULL path to xopenat()
Daan De Meyer [Thu, 1 Jun 2023 11:56:05 +0000 (13:56 +0200)] 
fs-util: Allow passing NULL path to xopenat()

We recently codified in the coding style that for openat() style APIs,
an empty path can be passed both as the empty string and as NULL, so
let's make sure we follow that style in xopenat().

2 years agocopy: Merge copy_directory() and copy_directory_fd() into copy_directory_at()
Daan De Meyer [Thu, 1 Jun 2023 11:42:39 +0000 (13:42 +0200)] 
copy: Merge copy_directory() and copy_directory_fd() into copy_directory_at()

Let's merge these two into a single function that can handle both
variants and more.

2 years agogenerators: change TimeoutSec=0 to TimeoutSec=infinity
Lennart Poettering [Tue, 6 Jun 2023 07:29:51 +0000 (09:29 +0200)] 
generators: change TimeoutSec=0 to TimeoutSec=infinity

With these settings we intend to turn off timeouts for possibly
interactive/slow commands. The officially documented way to turn off the
time-outs is to setting them to infinity. So far we set them to zero
here though.

This lead to some confusiong, for example #18224. Let's fix this by
uniformly spelling out TimeoutSec=infinity.

This doesn't change behaviour. It just makes our generated files match
what we document, without relying on historic compat support.

Fixes: #18224
2 years agoMerge pull request #27933 from mrc0mmand/selinux
Frantisek Sumsal [Tue, 6 Jun 2023 09:18:50 +0000 (11:18 +0200)] 
Merge pull request #27933 from mrc0mmand/selinux

test: a couple of TEST-06-SELINUX tweaks

2 years agoman: document OnSuccessJobMode=
Frantisek Sumsal [Tue, 6 Jun 2023 08:16:04 +0000 (10:16 +0200)] 
man: document OnSuccessJobMode=

Introduced in 294446dcb9.

2 years agotests: fix shellcheck warnings
Luca Boccassi [Mon, 5 Jun 2023 21:48:06 +0000 (22:48 +0100)] 
tests: fix shellcheck warnings

2 years agotpm2: verify symmetric parms in tpm2_context_new() 27629/head
Dan Streetman [Fri, 17 Feb 2023 17:59:18 +0000 (12:59 -0500)] 
tpm2: verify symmetric parms in tpm2_context_new()

This adds tpm2_get_capability_algs(), tpm2_supports_alg(), and
tpm2_test_parms(). These functions allow verifying that the TPM supports
specific algs and parameters.

When creating a new context, this checks if the TPM supports the symmetric algs
we use. If the TPM does not support the symmetric algs and parameters we
require, we log and return error.

2 years agotpm2: add tpm2_get_capability(), tpm2_cache_capabilities(), tpm2_capability_pcrs()
Dan Streetman [Mon, 2 Jan 2023 01:19:12 +0000 (20:19 -0500)] 
tpm2: add tpm2_get_capability(), tpm2_cache_capabilities(), tpm2_capability_pcrs()

This adds a function to query specific capabilities from the TPM. That is then
used in a function to query the allocation of PCRs in the TPM, i.e. which PCR
banks and indexes are available, and caches the PCR allocation when the TPM
context is created.

2 years agotest: a couple of assorted cleanups 27933/head
Frantisek Sumsal [Mon, 5 Jun 2023 20:41:46 +0000 (22:41 +0200)] 
test: a couple of assorted cleanups

- sort binaries
- send stdout/stderr of the autorelabel service to console as well

2 years agotest: load the SELinux module outside of the VM
Frantisek Sumsal [Mon, 5 Jun 2023 20:35:05 +0000 (22:35 +0200)] 
test: load the SELinux module outside of the VM

Turns out we can, apart from just building the module, "shove" it into
the SELinux database in a chroot as well. This brings quite significant
time savings, as the SELinux db rebuild takes 2 - 5 minutes in a VM
without acceleration (and takes currently ~half of the runtime of the test
in the C8S job).

2 years agotest: add a reasoning why we don't use the SELinux-provided units
Frantisek Sumsal [Mon, 5 Jun 2023 20:32:27 +0000 (22:32 +0200)] 
test: add a reasoning why we don't use the SELinux-provided units

2 years agocgls/cgtop: spell field/column "CGroup" rather than "Control Group"
Lennart Poettering [Mon, 5 Jun 2023 16:40:26 +0000 (18:40 +0200)] 
cgls/cgtop: spell field/column "CGroup" rather than "Control Group"

In the documentation we usually spell the concept "control group".
Internally in code we usually call it "cgroup" or "CGroup". In systemctl output we
called the field "CGroup" so far, i.e. a capitalized version of the
internal name. This is of course very unsystematic. Let's clean this up
a bit: let's now say:

* in docs, continue to spell it out "control groups"
* in brief output call it "CGroup"
* internally call it "cgroup" or "CGroup"

Fixes: #14429
2 years agoMerge pull request #27912 from mrc0mmand/cryptsetup-tests
Yu Watanabe [Mon, 5 Jun 2023 18:34:59 +0000 (03:34 +0900)] 
Merge pull request #27912 from mrc0mmand/cryptsetup-tests

test: add a couple more tests for systemd-cryptsetup