]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
16 months agorepart: Add note about UIDs/GIDs of copied files and directories 26153/head
Daan De Meyer [Mon, 23 Jan 2023 15:43:58 +0000 (16:43 +0100)] 
repart: Add note about UIDs/GIDs of copied files and directories

16 months agoRevert "repart: Ensure files end up owned by root in generated filesystems"
Daan De Meyer [Mon, 23 Jan 2023 13:47:00 +0000 (14:47 +0100)] 
Revert "repart: Ensure files end up owned by root in generated filesystems"

This reverts commit e59678b2cf42e4206ddabc959d3cf9a5a865ecdc.

We also modify the repart integration tests to make them pass with the
changes in this commit. In short, we have to make sure every file is
owned by the user executing repart. We use tee instead of cat since it
makes that easier. This also has the benefit of improving debugability
as seeing the config file contents on stdout makes it easier to know
which test is failing.

16 months agoRevert "repart: Make sure all files in the image are owned by root"
Daan De Meyer [Mon, 23 Jan 2023 13:41:33 +0000 (14:41 +0100)] 
Revert "repart: Make sure all files in the image are owned by root"

This reverts commit d2ac7698cb43807a2dd0af727599db486180ebf1.

16 months agoFix typo in parameter name
edupont [Thu, 19 Jan 2023 13:24:56 +0000 (14:24 +0100)] 
Fix typo in parameter name

16 months agobpf: disable -fstack-protector in meson
Sam James [Fri, 13 Jan 2023 05:17:56 +0000 (05:17 +0000)] 
bpf: disable -fstack-protector in meson

In Gentoo, we recently started making Clang behave the same way as
our GCC, with -fstack-protector and some friends enabled by default.

SSP doesn't make sense for BPF, so disable it explicitly.

See also e.g. https://www.spinics.net/lists/netdev/msg556400.html.

Bug: https://bugs.gentoo.org/890004

16 months agotest: update Ubuntu CI docs
Frantisek Sumsal [Thu, 19 Jan 2023 12:54:19 +0000 (13:54 +0100)] 
test: update Ubuntu CI docs

16 months agonetwork: do not enter failed state when received an invalid RA
Yu Watanabe [Tue, 17 Jan 2023 04:20:13 +0000 (13:20 +0900)] 
network: do not enter failed state when received an invalid RA

Fixes the issue reported at https://github.com/systemd/systemd/issues/25891#issuecomment-1368509262.

16 months agomeson: ukify depends on GNU_EFI
Ludwig Nussel [Wed, 18 Jan 2023 09:25:58 +0000 (10:25 +0100)] 
meson: ukify depends on GNU_EFI

ukify is rather efi specific and the manpage is already conditional on
HAVE_GNU_EFI so make the program also depend on HAVE_GNU_EFI

16 months agotestsuite-77: Fix race condition
Daan De Meyer [Wed, 18 Jan 2023 15:31:35 +0000 (16:31 +0100)] 
testsuite-77: Fix race condition

Use a socket unit to make sure the socket exists before we start
the client that accesses it.

16 months agoMerge pull request #23706 from medhefgo/efi-clang
Luca Boccassi [Wed, 18 Jan 2023 22:24:39 +0000 (22:24 +0000)] 
Merge pull request #23706 from medhefgo/efi-clang

boot: Add printf functions

16 months agotpm2: add salt to pin
William Roberts [Wed, 18 Jan 2023 14:45:53 +0000 (08:45 -0600)] 
tpm2: add salt to pin

Add a salt to the pin and store it in the TPM2 LUKS header for future
this. This adds entropy to user supplied pins and helps brute forcing
the passphrase on the key residing in the TPM or brute forcing bind key
encrypted sessions with low entropy passphrases.

Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
Signed-off-by: William Roberts <william.c.roberts@intel.com>
16 months agoman: note that cgroup-based sandboxing is not bypassed by '+'
Luca Boccassi [Sun, 15 Jan 2023 18:54:16 +0000 (18:54 +0000)] 
man: note that cgroup-based sandboxing is not bypassed by '+'

DeviceAllow= and others are applied to the whole cgroup via bpf, so
using '+' on an Exec line will not bypass them. Explain this in the
manpage.

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

16 months agoMerge pull request #25790 from joshua-zivkovic/JZ/plotjson-main
Lennart Poettering [Wed, 18 Jan 2023 17:11:12 +0000 (18:11 +0100)] 
Merge pull request #25790 from joshua-zivkovic/JZ/plotjson-main

systemd-analyze: Add JSON and table output to systemd-analyze's plot

16 months agoMerge pull request #26082 from kraxel/uki
Lennart Poettering [Wed, 18 Jan 2023 17:10:30 +0000 (18:10 +0100)] 
Merge pull request #26082 from kraxel/uki

bootctl: add is-uki command

16 months agoboot: Drop use of Print 23706/head
Jan Janssen [Tue, 23 Aug 2022 08:51:36 +0000 (10:51 +0200)] 
boot: Drop use of Print

The custom print helpers have been replaced with explicit checks at the
call site to keep this in line with the way it is done in userspace. Any
calls where the check has been ommited should not need them as the value
is expected to alawys be around.

16 months agoboot: Drop use of xpool_print/SPrint
Jan Janssen [Sun, 5 Jun 2022 13:08:07 +0000 (15:08 +0200)] 
boot: Drop use of xpool_print/SPrint

16 months agotree-wide: Use __func__ in asserts
Jan Janssen [Thu, 18 Aug 2022 11:43:19 +0000 (13:43 +0200)] 
tree-wide: Use __func__ in asserts

clang puts the whole function signature in __PRETTY_FUNCTION__, which is
a bit excessive for something that can already be figured out by using
the line number.

16 months agoboot: Add log_trace debugging helper
Jan Janssen [Thu, 18 Aug 2022 11:41:49 +0000 (13:41 +0200)] 
boot: Add log_trace debugging helper

16 months agoboot: Introduce log_wait
Jan Janssen [Sun, 5 Jun 2022 11:19:21 +0000 (13:19 +0200)] 
boot: Introduce log_wait

Instead of stalling for every log message as it appears we now wait for
several messages at strategic locations.

16 months agoboot: Use printf for error logging
Jan Janssen [Fri, 10 Jun 2022 17:06:57 +0000 (19:06 +0200)] 
boot: Use printf for error logging

This also drops the _stall suffix in anticipation of the next commit.

16 months agoboot: Add printf functions
Jan Janssen [Fri, 10 Jun 2022 16:55:24 +0000 (18:55 +0200)] 
boot: Add printf functions

16 months agosystemd-analyze: Add --json=, --table and -no-legend tests for plot 25790/head
joshuazivkovic [Fri, 13 Jan 2023 09:17:27 +0000 (09:17 +0000)] 
systemd-analyze: Add --json=, --table and -no-legend tests for plot

16 months agosystemd-analyze: Add tab complete logic for plot
joshuazivkovic [Wed, 14 Dec 2022 12:31:59 +0000 (12:31 +0000)] 
systemd-analyze: Add tab complete logic for plot

16 months agosystemd-analyze: Update man/systemd-analyze.xml with Plot JSON and table
joshuazivkovic [Wed, 14 Dec 2022 12:31:22 +0000 (12:31 +0000)] 
systemd-analyze: Update man/systemd-analyze.xml with Plot JSON and table

16 months agosystemd-analyze: Add table and JSON output implementation to plot
Joshua Zivkovic [Wed, 2 Nov 2022 08:55:50 +0000 (08:55 +0000)] 
systemd-analyze: Add table and JSON output implementation to plot

16 months agotest-network: reprocess the loopback network interface
Yu Watanabe [Wed, 18 Jan 2023 09:53:42 +0000 (18:53 +0900)] 
test-network: reprocess the loopback network interface

Fixes the issue reported at https://github.com/systemd/systemd-centos-ci/pull/585#issuecomment-1385537641.

16 months agoMerge pull request #26021 from fbuihuu/some-journald-improvements
Lennart Poettering [Wed, 18 Jan 2023 14:05:40 +0000 (15:05 +0100)] 
Merge pull request #26021 from fbuihuu/some-journald-improvements

Some journald improvements

16 months agobootctl: add kernel-inspect command 26082/head
Gerd Hoffmann [Tue, 17 Jan 2023 21:06:06 +0000 (22:06 +0100)] 
bootctl: add kernel-inspect command

Takes a kernel image as argument. Prints details about the kernel.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
16 months agobootctl: add kernel-identity command
Gerd Hoffmann [Mon, 16 Jan 2023 17:58:21 +0000 (18:58 +0100)] 
bootctl: add kernel-identity command

The command takes a kernel as argument and checks what kind of kernel
the image is.  Returns one of uki, pe or unknown.

16 months agoMerge pull request #26092 from poettering/dissect-sector-size
Lennart Poettering [Wed, 18 Jan 2023 13:14:39 +0000 (14:14 +0100)] 
Merge pull request #26092 from poettering/dissect-sector-size

auto-detect intended sector size from DDI disk images, and configure loopback devices for it

16 months agocore: add GetUnitByPIDFD method and use it in systemctl
Luca Boccassi [Mon, 16 Jan 2023 23:46:01 +0000 (23:46 +0000)] 
core: add GetUnitByPIDFD method and use it in systemctl

A pid can be recycled, but a pidfd is pinned. Add a new method that is safer
as it takes a pidfd as input.
Return not only the D-Bus object path, but also the unit id and the last
recorded invocation id, as they are both useful (especially the id, as
converting from a path object to a unit id from a script requires another
round-trip via D-Bus).

Note that the manager still tracks processes by pid, so theorethically this
is not fully error-proof, but on the other hand the method response is
synchronous and the manager is single-threaded, so once a call is being
processed the unit database will not change anyway. Once the manager
switches to use pidfds everywhere, this can be further hardened.

16 months agohwdb: Add mic mute key mappings for Dell G16 Series
Koba Ko [Wed, 18 Jan 2023 03:22:50 +0000 (11:22 +0800)] 
hwdb: Add mic mute key mappings for Dell G16 Series

add Dell G16 series to use the mic mute hotkey.

16 months agorepart: auto-probe sector size when not specified 26092/head
Lennart Poettering [Tue, 17 Jan 2023 20:42:21 +0000 (21:42 +0100)] 
repart: auto-probe sector size when not specified

16 months agohomework: when creating/resizing GPT partitions, also set sector size explicitly
Lennart Poettering [Tue, 17 Jan 2023 20:42:02 +0000 (21:42 +0100)] 
homework: when creating/resizing GPT partitions, also set sector size explicitly

16 months agodissect: show sector size in info output
Lennart Poettering [Tue, 17 Jan 2023 17:52:09 +0000 (18:52 +0100)] 
dissect: show sector size in info output

16 months agoloop-util: always tell kernel explicitly about loopback sector size
Lennart Poettering [Tue, 17 Jan 2023 17:50:59 +0000 (18:50 +0100)] 
loop-util: always tell kernel explicitly about loopback sector size

Let's not leave the sector size unspecified: either set a user supplied
value, or auto-detect the right size by probing the disk image
accordingly.

16 months agodissect-image: add probe_sector_size() helper for detecting sector size of a GPT...
Lennart Poettering [Tue, 17 Jan 2023 17:06:05 +0000 (18:06 +0100)] 
dissect-image: add probe_sector_size() helper for detecting sector size of a GPT disk image

When we operate with DDIs with sector sizes != 512 we need to configure
the loopback device to match it, otherwise the image and the kernel
block device will disagree what things are.

Let's add a prober that tries to determine the sector size of a GPT DDI.
It does this by looking for the GPT partition table header at the
various byte offsets they must be located on, given a specific sector
size. It will try sector size 512, 1024, 2048 and 4096. Of these only
the 512 and 4096 really make sense IRL I guess, but let's be thorough.

16 months agoloop-util: insist on setting the sector size correctly
Lennart Poettering [Tue, 17 Jan 2023 14:49:31 +0000 (15:49 +0100)] 
loop-util: insist on setting the sector size correctly

If we attach a disk image to a loopback device the sector size of the
image must match the one of the loopback device, hence be more careful
here.

16 months agoblockdev-util: add simple wrapper around BLKSSZGET
Lennart Poettering [Tue, 17 Jan 2023 19:12:30 +0000 (20:12 +0100)] 
blockdev-util: add simple wrapper around BLKSSZGET

Just adds some typesafety and generates an error if the field is not
initialized in the block device yet.

16 months agoMerge pull request #26044 from DaanDeMeyer/repart-sector-size
Daan De Meyer [Wed, 18 Jan 2023 08:54:50 +0000 (09:54 +0100)] 
Merge pull request #26044 from DaanDeMeyer/repart-sector-size

repart: Allow configuring sector size

16 months agotest: bump D-Bus service start timeout if we run without accel
Frantisek Sumsal [Tue, 17 Jan 2023 17:04:30 +0000 (18:04 +0100)] 
test: bump D-Bus service start timeout if we run without accel

The default (25s) doesn't seem to be enough in some cases (especially
in VMs without acceleration), causing spurious timeouts:

[  174.297658] dbus-daemon[647]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.0' (uid=0 pid=645 comm="hostnamectl " label="kernel")
[  184.202313] systemd[1]: systemd-update-utmp-runlevel.service: Consumed 1.253s CPU time.
[  197.335422] systemd[1]: Started dbus.service.
[  199.211468] testsuite-71.sh[639]: + assert_in 'Static hostname: H' ''
[  199.347192] dbus-daemon[647]: [system] Failed to activate service 'org.freedesktop.hostname1': timed out (service_start_timeout=25000ms)
[  199.394879] testsuite-71.sh[657]: + set +ex
[  199.438918] testsuite-71.sh[657]: FAIL: 'Static hostname: H' not found in:
[  200.966006] systemd-logind[631]: Watching system buttons on /dev/input/event0 (Power Button)
[  201.008178] systemd-logind[631]: Watching system buttons on /dev/input/event1 (AT Translated Set 2 keyboard)
[  201.034106] systemd-logind[631]: New seat seat0.
[  201.238267] sh[658]: + systemctl poweroff --no-block
[  201.329890] systemd[1]: Starting systemd-hostnamed.service...
[  202.156622] systemd[1]: systemd-update-utmp-runlevel.service: Deactivated successfully.
[  204.818913] hostnamectl[645]: Failed to query system properties: Connection timed out
[  205.195583] systemd[1]: testsuite-71.service: Main process exited, code=exited, status=1/FAILURE
[  205.227237] systemd[1]: testsuite-71.service: Failed with result 'exit-code'.
[  205.712780] systemd[1]: Failed to start testsuite-71.service.

16 months agoMerge pull request #26081 from yuwata/udev-symlink-remove
Luca Boccassi [Tue, 17 Jan 2023 21:59:12 +0000 (21:59 +0000)] 
Merge pull request #26081 from yuwata/udev-symlink-remove

udev: support -= operator for SYMLINK

16 months agocoredump: use fstatvfs to check the available space
Dmitry V. Levin [Tue, 17 Jan 2023 08:00:00 +0000 (08:00 +0000)] 
coredump: use fstatvfs to check the available space

Given that we already have the file descriptor opened for writing, it
would make sense to call fstatvfs with that file descriptor rather than
statvfs with the directory path that was used to open that descriptor.

16 months agodoc: document how we expect empty lines to be used
Lennart Poettering [Tue, 17 Jan 2023 14:49:01 +0000 (15:49 +0100)] 
doc: document how we expect empty lines to be used

16 months agorepart: Allow configuring sector size 26044/head
Daan De Meyer [Thu, 12 Jan 2023 21:42:30 +0000 (22:42 +0100)] 
repart: Allow configuring sector size

Let's allow users to configure the (logical) sector size of their
image. This is required when building images for a 4k sector size
disk on a 512b sector size host or vice-versa.

16 months agomkfs-util: Shorten strv operations error handling
Daan De Meyer [Tue, 17 Jan 2023 18:49:15 +0000 (19:49 +0100)] 
mkfs-util: Shorten strv operations error handling

16 months agoboot: Fix missed argument to Print()
Jan Janssen [Tue, 17 Jan 2023 14:51:42 +0000 (15:51 +0100)] 
boot: Fix missed argument to Print()

This fixes 3e87a057a796b57bf9540b948823fbefef6693d7, which passed the
path to the wrong Print() call. Miraculously, this was printing the
correct path during testing and was therefore missed.

16 months agounits: don't install pcrphase-related units without gnu-efi
Frantisek Sumsal [Tue, 17 Jan 2023 11:14:13 +0000 (12:14 +0100)] 
units: don't install pcrphase-related units without gnu-efi

since we don't have systemd-pcrphase built anyway, which breaks the tests:

...
I: Attempting to install /usr/lib/systemd/systemd-networkd-wait-online (based on unit file reference)
I: Attempting to install /usr/lib/systemd/systemd-network-generator (based on unit file reference)
I: Attempting to install /usr/lib/systemd/systemd-oomd (based on unit file reference)
I: Attempting to install /usr/lib/systemd/systemd-pcrphase (based on unit file reference)
W: Failed to install '/usr/lib/systemd/systemd-pcrphase'
make: *** [Makefile:4: setup] Error 1
make: Leaving directory '/root/systemd/test/TEST-01-BASIC'

Follow-up to 04959faa632272a8fc9cdac3121b2e4af721c1b6.

16 months agosend dhcpv6 release when stopping
chris [Sat, 7 Jan 2023 20:11:28 +0000 (21:11 +0100)] 
send dhcpv6 release when stopping

16 months agotpm2: replace magic number
Dan Streetman [Fri, 9 Dec 2022 20:05:49 +0000 (15:05 -0500)] 
tpm2: replace magic number

16 months agoMerge pull request #25006 from poettering/pcr15
Lennart Poettering [Tue, 17 Jan 2023 10:04:03 +0000 (11:04 +0100)] 
Merge pull request #25006 from poettering/pcr15

cryptsetup: measure LUKS volume keys to PCR 15

16 months agoMerge pull request #26005 from medhefgo/boot-hypervisor
Lennart Poettering [Tue, 17 Jan 2023 09:53:23 +0000 (10:53 +0100)] 
Merge pull request #26005 from medhefgo/boot-hypervisor

boot: Detect hypervisors using SMBIOS info

16 months agoupdate TODO 25006/head
Lennart Poettering [Fri, 14 Oct 2022 19:21:46 +0000 (21:21 +0200)] 
update TODO

16 months agotest: add simple integration test for checking PCR extension works as it should
Lennart Poettering [Fri, 16 Dec 2022 15:25:34 +0000 (16:25 +0100)] 
test: add simple integration test for checking PCR extension works as it should

16 months agoman: document new machine-id/fs measurement options
Lennart Poettering [Mon, 17 Oct 2022 13:20:53 +0000 (15:20 +0200)] 
man: document new machine-id/fs measurement options

16 months agotpm2: add common helper for checking if we are running on UKI with TPM measurements
Lennart Poettering [Mon, 17 Oct 2022 12:50:56 +0000 (14:50 +0200)] 
tpm2: add common helper for checking if we are running on UKI with TPM measurements

Let's introduce a common implementation of a function that checks
whether we are booted on a kernel with systemd-stub that has TPM PCR
measurements enabled. Do our own userspace measurements only if we
detect that.

PCRs are scarce and most likely there are projects which already make
use of them in other ways. Hence, instead of blindly stepping into their
territory let's conditionalize things so that people have to explicitly
buy into our PCR assignments before we start measuring things into them.
Specifically bind everything to an UKI that reported measurements.

This was previously already implemented in systemd-pcrphase, but with
this change we expand this to all tools that process PCR measurement
settings.

The env var to override the check is renamed to SYSTEMD_FORCE_MEASURE,
to make it more generic (since we'll use it at multiple places now).
This is not a compat break, since the original env var for that was not
included in any stable release yet.

16 months agogenerators: optionally, measure file systems at boot
Lennart Poettering [Sun, 16 Oct 2022 21:25:04 +0000 (23:25 +0200)] 
generators: optionally, measure file systems at boot

If we use gpt-auto-generator, automatically measure root fs and /var.

Otherwise, add x-systemd.measure option to request this.

16 months agounits: rework growfs units to be just a regular unit that is instantiated
Lennart Poettering [Sun, 16 Oct 2022 20:45:17 +0000 (22:45 +0200)] 
units: rework growfs units to be just a regular unit that is instantiated

The systemd-growfs@.service units are currently written in full for each
file system to grow. Which is kinda pointless given that (besides an
optional ordering dep) they contain always the same definition. Let's
fix that and add a static template for this logic, that the generator
simply instantiates (and adds an ordering dep for).

This mimics how systemd-fsck@.service is handled. Similar to the wait
that for root fs there's a special instance systemd-fsck-root.service
we also add a special instance systemd-growfs-root.service for the root
fs, since it has slightly different deps.

Fixes: #20788
See: #10014

16 months agogenerator: teach generator_add_symlink() to instantiate specified unit
Lennart Poettering [Sun, 16 Oct 2022 20:39:31 +0000 (22:39 +0200)] 
generator: teach generator_add_symlink() to instantiate specified unit

if we want generators to instantiate a template service, we need to
teach generator_add_symlink() the concept.

Just some preparation for a later commit.

While we are at it, modernize the function around
path_extract_filename() + path_extract_directory()

16 months agounits: measure /etc/machine-id into PCR 15 during early boot
Lennart Poettering [Sun, 16 Oct 2022 16:21:12 +0000 (18:21 +0200)] 
units: measure /etc/machine-id into PCR 15 during early boot

We want PCR 15 to be useful for binding per-system policy to. Let's
measure the machine ID into it, to ensure that every OS we can
distinguish will get a different PCR (even if the root disk encryption
key is already measured into it).

16 months agopcrphase: make tool more generic, reuse for measuring machine id/fs uuids
Lennart Poettering [Fri, 14 Oct 2022 21:29:48 +0000 (23:29 +0200)] 
pcrphase: make tool more generic, reuse for measuring machine id/fs uuids

See: #24503

16 months agogpt-auto-generator: automatically measure root/var volume keys into PCR 15
Lennart Poettering [Fri, 14 Oct 2022 13:54:09 +0000 (15:54 +0200)] 
gpt-auto-generator: automatically measure root/var volume keys into PCR 15

let's enable PCR 15 measurements automatically if gpt-auto discovery is
used and systemd-stub is also used.

16 months agoman: document the new crypttab measurement options
Lennart Poettering [Fri, 14 Oct 2022 13:27:34 +0000 (15:27 +0200)] 
man: document the new crypttab measurement options

16 months agocryptsetup: add tpm2-measure-pcr= and tpm2-measure-bank= crypttab options
Lennart Poettering [Wed, 12 Oct 2022 07:56:32 +0000 (09:56 +0200)] 
cryptsetup: add tpm2-measure-pcr= and tpm2-measure-bank= crypttab options

These options allow measuring the volume key used for unlocking the
volume to a TPM2 PCR. This is ideally used for the volume key of the
root file system and can then be used to bind other resources to the
root file system volume in a secure way.

See: #24503

16 months agotpm2-util: optionally do HMAC in tpm2_extend_bytes() in case we process sensitive...
Lennart Poettering [Fri, 14 Oct 2022 12:38:35 +0000 (14:38 +0200)] 
tpm2-util: optionally do HMAC in tpm2_extend_bytes() in case we process sensitive data

When measuring data into a PCR we are supposed to hash the data on the
CPU and then pass the hash value over the wire to the TPM2. That's all
good as long as the data we intend to measure is not sensitive.

Let's be extra careful though if we want to measure sensitive data, for
example the root file system volume key. Instead of just hashing that
and passing it over the wire to the TPM2, let's do a HMAC signature
instead. It's also a hash operation, but should protect our secret
reasonably well and not leak direct information about it to wiretappers.

16 months agotpm2-util: split out code that extends a PCR from pcrphase
Lennart Poettering [Tue, 11 Oct 2022 16:20:14 +0000 (18:20 +0200)] 
tpm2-util: split out code that extends a PCR from pcrphase

This way we can reuse it later outside of pcrphase

16 months agotpm2-util: split out code that derives "good" TPM2 banks into an strv from pcrphase...
Lennart Poettering [Tue, 11 Oct 2022 16:07:46 +0000 (18:07 +0200)] 
tpm2-util: split out code that derives "good" TPM2 banks into an strv from pcrphase and generalize it in tpm2-util.c

That way we can reuse it later from different places.

16 months agotest-udev: add a brief test for -= operator for SYMLINK 26081/head
Yu Watanabe [Tue, 17 Jan 2023 05:35:44 +0000 (14:35 +0900)] 
test-udev: add a brief test for -= operator for SYMLINK

16 months agoudev: support '-=' operator for SYMLINK
Franck Bui [Tue, 17 Jan 2023 05:30:48 +0000 (14:30 +0900)] 
udev: support '-=' operator for SYMLINK

For some (corner) cases, it might be desirable to disable the generation of
some persistent storage symlinks that 60-persistent-storage.rules creates.

For example on big setups with a high number of partitions which uses the same
label name, this can result in a noticeable slow-down in the (re)start of the
udevd as there are many contenders for the symlink /dev/disk/by-partlabel.

However it's currently pretty hard to overwrite just some specific part of the
rule file. Indeed one need to copy and modify the whole rule file in /etc but
will lost any upcoming updates/fixes that the distro might release in the
future.

With this simple patch, one can now disable the generation of the
"by-partlabel" symlinks (for example) with the following single rule:

$ cat /etc/udev/rules.d/99-no-by-partlabel.rules
ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK-="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"

Closes #24607.

16 months agoMerge pull request #26004 from poettering/cleanuo-erase-moar
Yu Watanabe [Tue, 17 Jan 2023 05:04:02 +0000 (14:04 +0900)] 
Merge pull request #26004 from poettering/cleanuo-erase-moar

tree-wide: use CLEANUP_ERASE() at many places

16 months agosd-dhcp-client: gracefully handle invalid ether type client ID
Yu Watanabe [Mon, 16 Jan 2023 04:08:55 +0000 (13:08 +0900)] 
sd-dhcp-client: gracefully handle invalid ether type client ID

Currently, sd-dhcp-server accepts spurious client IDs, then the leases
exposed by networkd may be invalid. Let's make networkctl gracefully
show such leases.

Fixes #25984.

16 months agobusctl: simplify peeking the type
Lennart Poettering [Mon, 16 Jan 2023 13:16:14 +0000 (14:16 +0100)] 
busctl: simplify peeking the type

let's peek the type before we enter the variant, not after, so that we
can reuse it as-is, instead having to recombine it later.

Follow-up for: #26049

16 months agosd-dhcp6: always append the default status message generated from status code
Yu Watanabe [Mon, 16 Jan 2023 03:40:53 +0000 (12:40 +0900)] 
sd-dhcp6: always append the default status message generated from status code

Fixes #25988.

16 months agonetwork: fix memleak
Yu Watanabe [Mon, 16 Jan 2023 13:07:06 +0000 (22:07 +0900)] 
network: fix memleak

Fixes a bug introduced by af2aea8bb64b0dc42ecbe5549216eb567681a803.

Fixes #25883 and #25891.

16 months agoMerge pull request #26071 from yuwata/network-dhcp-quick-ack
Luca Boccassi [Mon, 16 Jan 2023 19:41:03 +0000 (19:41 +0000)] 
Merge pull request #26071 from yuwata/network-dhcp-quick-ack

network: make TCP quick ACK mode for dynamic routes configurable

16 months agoMerge pull request #26054 from aplanas/fix_user_creds
Luca Boccassi [Mon, 16 Jan 2023 19:40:05 +0000 (19:40 +0000)] 
Merge pull request #26054 from aplanas/fix_user_creds

creds-util: some fixes related with TPM2 and capabilities

16 months agoMerge pull request #26051 from YHNdnzj/systemctl-list-dependencies-type
Luca Boccassi [Mon, 16 Jan 2023 19:38:58 +0000 (19:38 +0000)] 
Merge pull request #26051 from YHNdnzj/systemctl-list-dependencies-type

systemctl: list-dependencies: support --type= and --state=

16 months agoboot: Skip soft-brick warning when in a VM 26005/head
Jan Janssen [Mon, 16 Jan 2023 15:22:17 +0000 (16:22 +0100)] 
boot: Skip soft-brick warning when in a VM

This part of the warning is annoying to look at not really true when
running inside of a VM.

16 months agoboot: Detect hypervisors using SMBIOS info
Jan Janssen [Tue, 10 Jan 2023 13:44:29 +0000 (14:44 +0100)] 
boot: Detect hypervisors using SMBIOS info

This allows skipping secure boot enrollment wait time on other arches.

16 months agomemory-util: add CLEANUP_ERASE_PTR() macro and use it 26004/head
Lennart Poettering [Tue, 10 Jan 2023 11:39:14 +0000 (12:39 +0100)] 
memory-util: add CLEANUP_ERASE_PTR() macro and use it

16 months agotree-wide: use CLEANUP_ERASE() at various places
Lennart Poettering [Tue, 10 Jan 2023 11:39:58 +0000 (12:39 +0100)] 
tree-wide: use CLEANUP_ERASE() at various places

Let's use this new macro wherever it makes sense, as it allows us to
shorten or clean-up paths, and makes it less likely to miss a return
path.

16 months agojournald: split find_journal() up 26021/head
Franck Bui [Mon, 14 Mar 2022 13:53:38 +0000 (14:53 +0100)] 
journald: split find_journal() up

No functional change.

16 months agojournald: introduce journal_file_parse_uid_from_filename() helper
Franck Bui [Mon, 14 Mar 2022 12:54:06 +0000 (13:54 +0100)] 
journald: introduce journal_file_parse_uid_from_filename() helper

16 months agojournald: rename vacuum_offline_user_journals()
Franck Bui [Tue, 15 Mar 2022 14:00:34 +0000 (15:00 +0100)] 
journald: rename vacuum_offline_user_journals()

The name was misleading because the function actually archives offline
journals, ie it doesn't try to remove them to make some room.

No functional change.

16 months agoupdate TODO
Lennart Poettering [Mon, 16 Jan 2023 13:05:54 +0000 (14:05 +0100)] 
update TODO

16 months agoMerge pull request #25999 from DaanDeMeyer/mkosi
Daan De Meyer [Mon, 16 Jan 2023 13:24:04 +0000 (14:24 +0100)] 
Merge pull request #25999 from DaanDeMeyer/mkosi

ci: Update mkosi action to latest commit

16 months agomount: handle bind mount of file with non-existing target
David Tardon [Fri, 13 Jan 2023 14:58:39 +0000 (15:58 +0100)] 
mount: handle bind mount of file with non-existing target

When the target (Where=) of a mount does not exist, systemd tries to
create it. But previously, it'd always been created as a directory. That
doesn't work if one wants to bind-mount a file to a target that doesn't
exist.

Fixes: #17184
16 months agocreds-util: merge the TPM2 detection for initrd 26054/head
Alberto Planas [Mon, 16 Jan 2023 12:35:49 +0000 (13:35 +0100)] 
creds-util: merge the TPM2 detection for initrd

This patch merge the TPM2 detection paths when we are inside and outside
an initrd.

Signed-off-by: Alberto Planas <aplanas@suse.com>
16 months agocreds-util: do not try TPM2 if there is not support
Alberto Planas [Mon, 16 Jan 2023 10:16:53 +0000 (11:16 +0100)] 
creds-util: do not try TPM2 if there is not support

During the credentials encryption, if systemd it is compiled with TPM2
support, it will try to use it depending on the key flags passed.

The current code only checks if the system has a functional TPM2 if the
case of the INITRD flag.

This patch do a similar check in the case that it is outside initrd (but
still automatic).

Signed-off-by: Alberto Planas <aplanas@suse.com>
16 months agocreds-util: check for CAP_DAC_READ_SEARCH
Alberto Planas [Fri, 13 Jan 2023 14:31:39 +0000 (15:31 +0100)] 
creds-util: check for CAP_DAC_READ_SEARCH

In make_credential_host_secret, the credential.secret file is generated
first as a temporary anonymous file that is later instantiated with
linkat(2).  This system call requires CAP_DAC_READ_SEARCH capability
when the flag AT_EMPTY_PATH is used.

This patch check if the capability is effective, and if not uses the
alternative codepath for creating named temporary files.

Non-root users can now create per-user credentials with:

  export SYSTEMD_CREDENTIAL_SECRET=$HOME/.config/systemd/credential.secret
  systemd-creds setup

Signed-off-by: Alberto Planas <aplanas@suse.com>
16 months agosystemctl: list-dependencies: support --type= and --state= 26051/head
Mike Yuan [Fri, 13 Jan 2023 08:52:29 +0000 (16:52 +0800)] 
systemctl: list-dependencies: support --type= and --state=

Closes #25975

16 months agoman: clarify applicability of IPv6AcceptRA option
Łukasz Stelmach [Mon, 16 Jan 2023 07:33:55 +0000 (08:33 +0100)] 
man: clarify applicability of IPv6AcceptRA option

There is no reason to not accept RAs on bondX devices (devices that
aggregate other devices). It makes sense for aggregated devies though.

16 months agogpt-auto: harden ESP/XBOOTLDR mounts with "noexec,nosuid,nodev"
Mike Yuan [Mon, 16 Jan 2023 06:57:24 +0000 (14:57 +0800)] 
gpt-auto: harden ESP/XBOOTLDR mounts with "noexec,nosuid,nodev"

When these partitions are probed by gpt-auto,
they will always be hardened with such options.

See also: https://github.com/systemd/systemd/issues/25776#issuecomment-1364115711

Closes #25776

16 months agoman: udev_enumerate_new: fix typo
Ulrich Ölmann [Sun, 15 Jan 2023 17:24:39 +0000 (18:24 +0100)] 
man: udev_enumerate_new: fix typo

16 months agoNEWS: mention QuickAck= 26071/head
Yu Watanabe [Mon, 16 Jan 2023 05:37:11 +0000 (14:37 +0900)] 
NEWS: mention QuickAck=

16 months agoNEWS: move one entry to the correct section
Yu Watanabe [Mon, 16 Jan 2023 05:36:53 +0000 (14:36 +0900)] 
NEWS: move one entry to the correct section

16 months agonetwork: introduce QuickAck= for [DHCPv4] and [IPv6AcceptRA]
Yu Watanabe [Mon, 16 Jan 2023 05:31:58 +0000 (14:31 +0900)] 
network: introduce QuickAck= for [DHCPv4] and [IPv6AcceptRA]

Closes #25906.

16 months agoukify: Fix version string
Daan De Meyer [Sun, 15 Jan 2023 16:08:11 +0000 (17:08 +0100)] 
ukify: Fix version string

Let's make sure we mimick the version of our other CLI tooling.

16 months agodocs/man: remove reference to default vsock CID
Luca Boccassi [Sun, 15 Jan 2023 20:11:23 +0000 (20:11 +0000)] 
docs/man: remove reference to default vsock CID

This was dropped on reviewers' request in the revision that got merged,
but reference in two documents was not updated. Fix it.

Follow-up for: https://github.com/systemd/systemd/pull/25918

16 months agomkosi: Use meson setup 25999/head
Daan De Meyer [Sun, 15 Jan 2023 19:41:33 +0000 (20:41 +0100)] 
mkosi: Use meson setup