1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00
Commit Graph

74299 Commits

Author SHA1 Message Date
Daan De Meyer
711f843e3a TEST-45-TIMEDATE: Use syslog identifier journalctl match
Using a unit match is racy whereas a syslog identifier match is
reliable.

(cherry picked from commit 24284098a4)
2024-07-05 20:00:04 +02:00
James Coglan
6ead24fcac resolved: allow the full TTL to be used by OPT records
Whereas RFC 1035 says the TTL field takes the "positive values of a
signed 32 bit number", and RFC 2181 says "Implementations should treat
TTL values received with the most significant bit set as if the entire
value received was zero,", the dns_packet_read_rr() function sets
rr->ttl to zero if the MSB is set.

However, EDNS(0) as specified in RFC 6891 repurposes the TTL field's 4
octets to store other information, c.f.:

                  +0 (MSB)                            +1 (LSB)
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    0: |         EXTENDED-RCODE        |            VERSION            |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    2: | DO|                           Z                               |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

The first octet extends the usual 4-bit RCODE from the packet header by
providing an additional 8 bits of space, extending the RCODE to 12 bits.
But, our handling of the TTL field means that the high bit in the first
octet is not actually usable, since setting it will mean these 4 octets
are replaced with 0. This may have the effect of making us believe a
server does not support DNSSEC when it actually set the DO bit in its
OPT record.

Here we change things so that the TTL is only set to zero for record
types other than OPT.

(cherry picked from commit 131787979c)
2024-07-05 20:00:04 +02:00
Daan De Meyer
dc0167b674 TEST-64-UDEV-STORAGE: Make nvme_subsystem expected pci symlinks more generic
When running the test on aarch64 the symlinks look as follows:

"""
[root@H ~]# ls /dev/disk/by-path
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0       platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part1  platform-4010000000.pcie-pci-0000:00:05.0-nvme-16
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part  platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part2  platform-4010000000.pcie-pci-0000:00:05.0-nvme-17
"""

So let's make the PCI patterns a little more generic so they match
both the x86 and the aarch64 paths.

(cherry picked from commit 72d121b601)
2024-07-05 20:00:04 +02:00
Zbigniew Jędrzejewski-Szmek
fb747bd8cd LICENSES/README: expand text to summarize state for binaries and libs
We would say how *sources* are licensed, but actually most user care about the
resulting binaries. So say how the *binaries* are licensed. I used the word
"effectively" because the permissive licenses don't set any requirements on the
binaries, so the license of sources is a complex mix, but the resulting
binaries have a simple effective license.

Also, make it clear that the GPLv2 license applies to udev programs, but not
the shared library. Based on private correspondence, there's some confusion
about this.

(cherry picked from commit bd7236912f)
2024-07-05 20:00:04 +02:00
Daan De Meyer
ffc8126cc6 test: pull in multi-user.target explicitly
Let's make sure we pull in multi-user.target so that we get a console
when a test fails and we're running meson test with --interactive.

(cherry picked from commit 32f3617fd7)
2024-07-05 20:00:04 +02:00
Daan De Meyer
b908f492bc TEST-64-UDEV-STORAGE: Fix python 3.9 compatibility
Using double quotes in f-strings only works from python 3.12 onwards.
Use single quotes to make sure python 3.9 works as well.

Also clean up quotes a little in general.

(cherry picked from commit 4e469c0af2)
2024-07-05 20:00:04 +02:00
Daan De Meyer
1c4f25c296 TEST-64-UDEV-STORAGE: Use bus pci slot 1 instead of 0
Trying to use bus pci slot 0 fails on aarch64 so let's use 1 instead.

The error:

"""
qemu-system-aarch64: -device virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25: Unsupported PCI slot 0 for standard hotplug controller. Valid slots are between 1 and 31.
"""

(cherry picked from commit 7f07f9c8cd)
2024-07-05 20:00:04 +02:00
Zbigniew Jędrzejewski-Szmek
9663bb7410 TEST-58-REPART: reverse order of diff args
I expect the test output to be the second argument, so we're diffing "expected"
and "output", not the other way around.

I noticed this when working on https://github.com/systemd/systemd/pull/33081.

(cherry picked from commit 6bb3ea655d)
2024-07-05 20:00:04 +02:00
Giovanni Baratta
2f455914f7 man/tmpfiles: remove outdated behavior regarding symlink ownership
Update the man page of tmpfiles.d to remove outdated comments regarding the behavior of ownership with symlinks.
The behavior has been changed in this commit 51207ca134

(cherry picked from commit d108198f39)
2024-07-05 20:00:04 +02:00
Mike Yuan
24dd273402 test-mountpoint-util: add a test for bind mounted symlinks
(cherry picked from commit b917e5b06b)
2024-07-05 20:00:04 +02:00
Mike Yuan
99cb4bdbbb mountpoint-util: do not assume symlinks are not mountpoints
They very much can be with the new mount API.

(cherry picked from commit 36e48f22af)
2024-07-05 20:00:04 +02:00
Lennart Poettering
4437967cab hostnamed: if polkit authentication fails for Varlink Describe() call, don't reply to client with an error
The logic of the Describe() call was supposed to be: if we can acquire
the PK priv to get the product UUID then let's return the product UUID,
and if we cannot then return the data without it.

This didn't work however, since the polkit varlink glue would
immediately propagate the error it acquired from polkit its own client.
Let's turn this off, optionally, so that hostnamed can handle this
nicely.

(cherry picked from commit b6464e80d6)
2024-07-05 20:00:04 +02:00
Florian Schmaus
fb7ec285c9 core/exec-invoke: use sched_setattr instead of sched_setscheduler
The kernel's sched_setattr interface allows for more control over a processes
scheduling attributes as the previously used sched_setscheduler interface.

Using sched_setattr is also the prerequisite for support of utilization
clamping (UCLAMP [1], see #26705) and allows to set sched_runtime. The latter,
sched_runtime, will probably become a relevant scheduling parameter of the
EEVDF scheduler [2, 3], and therefore will not only apply to processes
scheduled via SCHED_DEADLINE, but also for processes scheduled via
SCHED_OTHER/SCHED_BATCH (i.e., most processes).

1: https://docs.kernel.org/next/scheduler/sched-util-clamp.html
2: https://lwn.net/Articles/969062/
3: https://lwn.net/ml/linux-kernel/20240405110010.934104715@infradead.org/
(cherry picked from commit 016e9d8d08)
2024-07-05 20:00:04 +02:00
Kamil Szczęk
5911f1ec25 cryptsetup: improve TPM2 blob display
Just a tiny change to fix an eyesore in cryptsetup luksDump display :)

(cherry picked from commit 0828c6a2bf)
2024-07-05 20:00:04 +02:00
Lennart Poettering
57661f4ea9 util: make file_read() 64bit offset safe
File offsets in UEFI are 64bit on all archs, hence let's use that typo
too, and not create artificial confusion around types.

(cherry picked from commit 9573ab8f5a)
2024-07-05 20:00:04 +02:00
Mike Yuan
e2fb3dda24 man/capsule@.service: the capsule user is prefixed with "c-" rather than "p_"
(cherry picked from commit 6343d2ea50)
2024-07-05 20:00:04 +02:00
Carlo Teubner
2547de4629 man/capsule@.service.xml: fix typo
(cherry picked from commit 6733d691bb)
2024-07-05 20:00:04 +02:00
Mantas Mikulėnas
98928cf0a7 nspawn, vmspawn: honor the new window title switch
(cherry picked from commit 0bdaa99827)
2024-07-05 20:00:04 +02:00
Mantas Mikulėnas
9cbb3aadd5 run: add environment variable to prevent the setting of terminal title
This goes together with the existing SYSTEMD_TINT_BACKGROUND.

Closes https://github.com/systemd/systemd/issues/33301

(cherry picked from commit 27a2513013)
2024-07-05 20:00:04 +02:00
Yu Watanabe
81acc5b39a test-execute: add a test case for issue #33299
(cherry picked from commit 956a9f00b4)
2024-07-05 20:00:04 +02:00
Yu Watanabe
d008b3fb26 core: do not filter out write() if required in the very late stage
Before 12001b1bf0, write() is required for
if Type=exec. However, with the previous commit, now write() is also used
for sending handoff timestamp. Let's allow write() if necessary.

Fixes a regression caused by 12001b1bf0.
Fixes #33299.

(cherry picked from commit 84b79215cc)
2024-07-05 20:00:04 +02:00
Yu Watanabe
d580b1f850 core: use write() to send handoff timestamp
Before 12001b1bf0, the timestamp is sent
with write(), but the commit made the timestamp sent by send(), and
causes regressin #33299.

Note the invocation will still fail if write() is filtered by seccomp.
But, that is an old issue since Type=exec is introduced
(5686391b00).

Partially fixes a regression caused by 12001b1bf0.
Partially fixes #33299.

(cherry picked from commit 5161422bb5)
2024-07-05 20:00:04 +02:00
Yu Watanabe
52eeeb7d3d seccomp-util: split out seccomp_filter_set_add_by_name()
(cherry picked from commit b89a262eb5)
2024-07-05 20:00:04 +02:00
Eugeny Shcheglov
8e775590f1 Fix typo in CAP_BPF description (#33464)
description_good and description_bad are mixed up. Disabling CAP_BPF results in the inability to load BPF, not the other way around.

(cherry picked from commit 1750e30d23)
2024-07-05 20:00:04 +02:00
Yu Watanabe
54910267ba test-network: check if static routes not overridden by NDisc routes
(cherry picked from commit 62fb079a3b)
2024-07-05 20:00:04 +02:00
Yu Watanabe
4fda6e8f34 network/ndisc: do not remove static routes when received RA with zero lifetime
Similar to the previous commit, but for preventing from removing static
routes on receiving RA with zero lifetime.

Fixes a regresson caused by 479d3e1994.
Fixes #33346.

(cherry picked from commit fd436c8d67)
2024-07-05 20:00:04 +02:00
Yu Watanabe
34bef8dfac network/ndisc: do not override conflicting static routes
We have already ignored conflicting address configurations requested by
NDisc protocol. See ndisc_request_address().
Let's follow the same rule for routes. That is, if there are conflicting
static routes configured or requested, do not override them by NDisc.

Also, swap the order of checking existing route and existing request.

Fixes a regression caused by 972f1d17ab.
Prompted by #33346.

(cherry picked from commit 7af3e8cd00)
2024-07-05 20:00:04 +02:00
Mike Yuan
0b909bf685 core/exec-invoke: reopen OpenFile= fds with O_NOCTTY
(cherry picked from commit b9c5d812d5)
2024-07-05 20:00:04 +02:00
Mike Yuan
52371fe526 core: verify WorkingDirectory= is outside of API VFS only under mount namespacing
The purpose of the check is to prevent leaking API VFS fds
from host into a mount namespace/container. When mountns
is not used at all, the check is pointless and causes
inconvenience. E.g. file managers might need to be spawned
under those directories, and they surely won't run in mountns.

Suggested in https://github.com/systemd/systemd/pull/33454#issuecomment-2186351467
Fixes #33361

(cherry picked from commit 276bd392ec)
2024-07-05 20:00:04 +02:00
Yu Watanabe
ec5ac3ea53 terminal-util: use colon as separator for specifying color
Then, terminal will safely ignore unsupported features, like colored
underline.

Fixes a regression caused by 891abc9cf1.
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074073.
Fixes #33449.

(cherry picked from commit 6eabe9f2ff)
2024-07-05 20:00:04 +02:00
Diego Viola
421ccd7094 man: fix double is typo in systemd-tmpfiles
Signed-off-by: Diego Viola <diego.viola@gmail.com>
(cherry picked from commit a78394a49a)
2024-07-05 20:00:04 +02:00
Nick Rosbrook
778034f42e test: skip test-cgroup-id on ENOSYS from cg_cgroupid_open
Most container managers will block open_by_handle_at with seccomp to
mitigate a container escape attack. LXD in particular returns ENOSYS
rather than e.g. EPERM like nspawn. Skip this test if we get ENOSYS
from open_by_handle_at via cg_cgroupid_open.

(cherry picked from commit 82f57401d9)
2024-07-05 20:00:04 +02:00
Johannes Schneider
3174fae67b meson: bpf: propagate 'sysroot' for cross compilation
During cross-compilation of systemd, the compiler used to build the bpf's needs
to be pointed at the correct include searchpath. Which can be done by passing
the corresponding directory in through the cflags; for example in yocto/bitbake
this would work: CFLAGS += "--sysroot=${STAGING_DIR_TARGET}"

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
(cherry picked from commit b608bf5620)
2024-07-05 20:00:04 +02:00
Antonio Alvarez Feijoo
a6906475be kernel-install: correct the place where it works in man and help text
(cherry picked from commit 111f988992)
2024-07-05 20:00:04 +02:00
Maximilian Wilhelm
3e435e970d man/systemd.exec: list inaccessible files for ProtectKernelTunables
(cherry picked from commit 163bb43cea)
2024-07-05 20:00:04 +02:00
pyfisch
90b5cb35e9 Use consistent spelling of systemd.condition_first_boot argument
(cherry picked from commit 051d462b42)
2024-07-05 20:00:04 +02:00
Mike Yuan
b6316b8fac login/user-runtime-dir: free ignored sd_bus_error, avoid triggering assertion
Fixes #33388

(cherry picked from commit 909ba69070)
2024-07-05 20:00:04 +02:00
Mike Yuan
71546deef5 login/user-runtime-dir: use STRLEN where appropriate
Also, add missing trailing / to paths used in STRLEN/sizeof.

(cherry picked from commit 0b8a714b2b)
2024-07-05 20:00:04 +02:00
Lennart Poettering
fbfc88af5e pretty-print: take console glyph width into account when drawing progress bar
So far this used string length, not character width. Fix that.

(cherry picked from commit 1ad4e37da1)
2024-07-05 20:00:04 +02:00
Luca Boccassi
058fca7e6c mkosi: add support for TEST_SAVE_JOURNAL to integration test wrapper
Same variable and values as supported by the shell suite

(cherry picked from commit 59d4970a55)
2024-07-05 20:00:04 +02:00
Luca Boccassi
50ae476efd semaphore: pin packaging to ci/v256/stable branch
The packaging in debian/master is no longer compatible with v256-stable
so switch it
2024-07-05 11:38:42 +02:00
Luca Boccassi
771bb489bf test: skip TEST-69-SHUTDOWN on Debian
There is a regression in the login package, skip the test until
it is fixed. https://bugs.debian.org/1075733

(cherry picked from commit 92d9d5ca70)
2024-07-05 11:38:42 +02:00
Daan De Meyer
69c51768ef meson: Bump version to 256.2~devel
We need this so the packages built in CI are considered more recent
than the stable releases shipped by distributions.
2024-07-05 11:38:42 +02:00
Daan De Meyer
273b5622ac meson: Fix various versions
Follow up for 8b3b01c4b7

We switch to PROJECT_VERSION instead of PROJECT_VERSION_FULL where
we report our version and which is likely being parsed to avoid
breaking compat. If we didn't, the output would change from systemd
255 to systemd 255.1 which could break various tools.

(cherry picked from commit 6a4fcf8cef)
2024-07-05 11:38:42 +02:00
Chen Qi
9150ffc98a src/boot/efi/meson.build: ensure VERSION_TAG exists in case of cross build
The GIT_VERSION is changed to use VERSION_TAG, but in case of cross build
for src/boot/efi, it's not set, causing build error because the compiler cannot
know it's a macro thus treating it as some variable and error out.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
(cherry picked from commit 646ed5af00)
2024-07-05 11:38:42 +02:00
Daan De Meyer
1eb122033f mkosi: Build a disk image by default again
Now that we have a way to rebuild and reinstall systemd without
having to rebuild the image, let's default to building a disk image
again.

(cherry picked from commit 96110261ee)
2024-07-05 11:38:42 +02:00
Daan De Meyer
84d6fec8f9 meson: Deal with potential stable versions
The meson.version file might contain e.g. 256.2~devel in a stable
branch so let's make sure we deal with that.

(cherry picked from commit 8b3b01c4b7)
2024-07-05 11:38:42 +02:00
Luca Boccassi
851f991b1c mkosi: bump to latest commit
(cherry picked from commit ea6376d17f)
2024-07-05 11:38:42 +02:00
Daan De Meyer
3d3bc1d999 mkosi: Switch back to btrfs
Now that we're running on Noble instead of Jammy btrfs has the temp_fsid
feature which means we can mount the same image multiple times so let's
switch back to btrfs instead of ext4 as the filesystem as btrfs properly
records timestamps when building filesystems from a root directory unlike
ext4.

(cherry picked from commit 93440db8b5)
2024-07-05 11:38:42 +02:00
Daan De Meyer
ce41fdbfdc mkosi: Install btrfs-progs on CentOS as well
(cherry picked from commit 48e7d0e91e)
2024-07-05 11:38:42 +02:00