1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00
Commit Graph

62503 Commits

Author SHA1 Message Date
David Tardon
144ac494ec systemctl: print better message if default target is masked
If the default target is masked, `systemctl get-default` prints

  Failed to get default target: Operation not possible due to RF-kill

That's a bit too cryptic, so let's make it clear what's actually
happening.

Fixes #26589.

(cherry picked from commit 7c78a19322)
2023-03-03 10:32:57 +01:00
Lennart Poettering
791754f683 Revert "dissect-image: don't probe swap partitions needlessly"
This reverts commit df4524cb37.

This commit is just wrong. The thing is that we *don't* know
automatically that the partition contains a swap image, because it could
be encrypted.

Hence revert.

Fixes: #26595
(cherry picked from commit 41aca66ba4)
2023-03-03 10:32:20 +01:00
Dmitry V. Levin
d0e7841dce rules: remove redundant duplicate comparisons
$ grep -F -n -o 'ENV{DISKSEQ}=="?*", ' rules.d/60-persistent-storage.rules
139:ENV{DISKSEQ}=="?*",
139:ENV{DISKSEQ}=="?*",
140:ENV{DISKSEQ}=="?*",
140:ENV{DISKSEQ}=="?*",

Reported-by: Alexey Gladkov <legion@kernel.org>
Fixes: 17d97d4c90 ("udev: create disk/by-diskseq symlink only when the device has diskseq")
Fixes: 583dc6d933 ("udev: also create partition /dev/disk/by-diskseq/ symlinks")
(cherry picked from commit dc652e7dc3)
2023-03-03 10:31:47 +01:00
Lennart Poettering
dc98d58dd8 man: add two missing commands to synopsys
(cherry picked from commit aff131775b)
2023-03-03 10:30:56 +01:00
Yu Watanabe
e093acd062 core/dbus-socket: check the socket path is absolute
In config_parse_socket_listen(), we have checked the path is absolute,
however we have not in the dbus method.

(cherry picked from commit 4de2b47bde)
2023-03-03 10:27:56 +01:00
Yu Watanabe
a719c2ec2f sd-event: fix error handling
Follow-up for 6d2326e036.

(cherry picked from commit 1912f790fe)
2023-03-03 10:26:04 +01:00
Yu Watanabe
58c821af60 sd-event: always initialize sd_event.perturb
If the boot ID cannot be obtained, let's first fallback to the machine
ID, and if still cannot, then let's use 0.
Otherwise, no timer event source cannot be triggered.

Fixes #26549.

(cherry picked from commit 6d2326e036)
2023-03-03 10:23:47 +01:00
Yu Watanabe
2bfb07b22f systemctl: show "Until:" field only for service and scope units
Only service and scope units have RuntimeMaxUSec bus property.
To suppress the "Until:" field for other unit types, the entry must be
initialized with USEC_INFINITY.

Fixes #26473.

(cherry picked from commit b59052be26)
2023-03-03 10:20:13 +01:00
Zbigniew Jędrzejewski-Szmek
d9abd8babe tmpfiles.d: drop misleading comment
I'm not sure what "suffix" was meant by this comment, but the file has the usual suffix.
The file was added with the current name back in c4708f1323.
Maybe an earlier version of the patch did something different.

(cherry picked from commit 9c7188547c)
2023-03-03 10:17:37 +01:00
Aidan Dang
0f4dbe6367 Enable TPM by default with SetCredentialEncrypted
(cherry picked from commit d59025698f)
2023-03-03 10:13:38 +01:00
Jan Janssen
8d8240bdf6 stub: Fix unaligned read
(cherry picked from commit 024951fb22)
2023-03-03 10:10:33 +01:00
Zbigniew Jędrzejewski-Szmek
44c2ff5b1e efi: drop executable-stack bit from .elf file
An rpminspect test in Fedora/RHEL is flagging our stub files as having an
executable stack. The check is correct:

$ readelf --wide --program-headers build/src/boot/efi/linuxx64.elf.stub | rg -i stack
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10

It seems to be just an omission in the linker script… None of the objects that
are linked into the stub are marked as requiring an executable stack:

$ readelf --wide --sections build/src/boot/efi/*.c.o \
  /usr/lib/gnuefi/x64/libgnuefi.a \
  /usr/lib/gnuefi/x64/libefi.a \
  /usr/lib/gcc/x86_64-redhat-linux/12/libgcc.a \
  | rg '.note.GNU-stack.*X'
(nothing)

On aarch64 we end up with a nonexecutable stack, but on ia32 and x64 we get one,
so this might be just a matter of defaults in the linker. It doesn't matter
greatly, but let's mark the stack as non-executable to avoid the warning.

Note: '-Wl,-z' is not needed, things work with just '-z'.
(cherry picked from commit 1eca770933)
2023-03-03 10:10:12 +01:00
David Tardon
f2460b78b9 logind-session: make stopping of idle session visible to admins
(cherry picked from commit 6269ffe7ee)
2023-03-03 10:09:48 +01:00
Mike Yuan
1947b9939c sleep: check if we're on AC power before checking battery capacity
Before this commit, battery_is_low() returns
true if there's no battery on the system.
It's now modified to check if the system is
on AC power first, and returns false early
if that's the case.

Fixes #26492

(cherry picked from commit e0b3a70fab)
2023-03-03 10:09:43 +01:00
David Tardon
452cad62c8 install: fail early if specifier expansion failed
Before:

systemd[1]: Assertion 'path' failed at src/shared/install.c:288, function install_changes_add(). Aborting.
systemd[1]: Caught <ABRT> from our own process.
systemd[1]: Caught <ABRT>, dumped core as pid 2525.
systemd[1]: Freezing execution

After:

Failed to enable unit: Invalid specifier in user-%J.service

Fixes #26467.

Follow-up for: f5a0162

(cherry picked from commit f8979e8698)
2023-03-03 10:09:29 +01:00
Lennart Poettering
eae11e3f06 homectl: add missing break
(cherry picked from commit 464ec1dec7)
2023-03-03 10:07:54 +01:00
Yu Watanabe
9024afb994 core/manager: falling back to execute generators without sandboxing
When running in a container, like podman, docker or so, creating new mount
namespace may be disabled.

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

(cherry picked from commit a2275dcb9d)
2023-03-03 10:07:00 +01:00
Zbigniew Jędrzejewski-Szmek
aac692160e man/tmpfiles.d: adjust the table in synopsis, improve spelling
r and R take globs, so let's name the argument appropriately in the tl;dr listing.

Also, use 'clean-up' in the file name where it represents the verb "clean up",
and other minor spelling adjustments.

(cherry picked from commit 164297cd9a)
2023-03-03 10:06:11 +01:00
Frantisek Sumsal
d2739b8c14 test: disable pipefail when testing interactive firstboot
Otherwise we might get unexpected test fails due to SIGPIPE:

```
[   14.334917] testsuite-74.sh[565]: + grep -q '^root:.*:0:0:.*:/bin/fooshell$' test-root/etc/passwd
[   14.335670] testsuite-74.sh[681]: + systemd-firstboot --root=test-root --prompt-root-shell
[   14.336382] testsuite-74.sh[680]: + echo -ne '\n/bin/barshell\n'
[   14.336980] testsuite-74.sh[680]: .//usr/lib/systemd/tests/testdata/units/testsuite-74.firstboot.sh: line 166: echo: write error: Broken pipe
```

(cherry picked from commit 27c814666f)
2023-03-03 10:02:05 +01:00
Daan De Meyer
755431b233 ukify: Set fast_load option when parsing PE files
Let's skip parsing of some irrelevant information that we don't use
to speed up building UKIs with large initrds from +-15s to less than
1s.

(cherry picked from commit c87ff62210)
2023-03-03 10:01:53 +01:00
Ronan Pigott
343e90462f core: permit sending augmented enable/disable methods
systemctl disable some.service fails to acquire interactive permission
because the DisableUnitFilesWithFlagsAndInstallInto method isn't permitted

(cherry picked from commit d668ba131c)
2023-03-03 09:59:58 +01:00
Yu Watanabe
ba1cb4156b process-util: show requested process name in the log
This is useful for debugging issues like #26474.

(cherry picked from commit b9fadf2e2c)
2023-03-03 09:58:43 +01:00
Ronan Pigott
5140da8937 systemctl: edit: fix double free of instanced name
There is a double free of unit_name when an instance is used, causing
systemctl --user edit service@instance to abort.

(cherry picked from commit fe5cb7a7ae)
2023-03-03 09:57:46 +01:00
Mike Yuan
c4cdbb978f journalctl: fix output when --lines is used with --grep
Previously, we skip the entries before arg_lines
unconditionally, which doesn't behave correctly
when used with --grep. After this commit, when
a pattern is specified, we don't skip the entries
early, but rely on the count of the lines shown
to tell us when to stop. To achieve that we would
have to search backwards instead.

Fixes #25147

(cherry picked from commit db4691961c)
2023-03-03 09:57:28 +01:00
Yu Watanabe
6dafcad55c loop-util: fix error condition and return value
Fixes a bug introduced by da4fd28871.

(cherry picked from commit 2421dd7267)
2023-03-03 09:57:08 +01:00
Winterhuman
ec6c1fbf7d Correct journal misspell
(cherry picked from commit 1ec9b72258)
2023-03-03 09:56:49 +01:00
Yu Watanabe
6b6df9a845 cryptsetup: check the existence of salt by salt_size > 0
Follow-up for 504d0acf61.

The function may be called with non-NULL salt and salt_size == 0.

(cherry picked from commit 8c2264abb9)
2023-03-03 09:52:23 +01:00
Jan Janssen
cd5de2811a boot: Fix assertion failure
The TPM code expects a description unless the PCR index indicates that
no measurements have to take place. The assert was preempting this
check from happening.

Fixes: #26428
(cherry picked from commit f92428eae5)
2023-03-03 09:50:12 +01:00
Lennart Poettering
01b90e1588 pid1: generate compat warning for SystemCallArchitectures= if seccomp is off
(cherry picked from commit 6aa2c55522)
2023-03-03 09:48:30 +01:00
Yu Watanabe
a3177cbe54 core/mount: fix default target for /sysusr/usr and its child
Follow-up for 29a24ab28e.

(cherry picked from commit dbfc096095)
2023-03-03 09:48:11 +01:00
Luca Boccassi
3168bda640 mkosi: configure multiarch libdir in debian/ubuntu builds
Debian/Ubuntu use /usr/lib/<triplet> instead of /usr/lib64, so configure it
accordingly. This is especially important for cryptsetup token plugins,
as cryptsetup comes from the distro and is configured to look into those
directories.

(cherry picked from commit bbb40c4e6f)
2023-03-03 09:43:10 +01:00
Dan Streetman
51b7acfcef tpm2: fix build failure without openssl
(cherry picked from commit 0d7009d35d)
2023-03-03 09:41:39 +01:00
Joan Bruguera
a88e35bf95 resolved: Fall back to TCP if UDP is blocked
If UDP is blocked on the system (e.g. by iptables or BPF), the kernel will
return EPERM on some or all of the system calls (connect, sendmsg, etc.).
In this case, try to fall back to TCP, which hopefully will not be blocked.

(cherry picked from commit 3dd6336ad0)
2023-03-03 09:35:50 +01:00
Luca Boccassi
477fdc5afe NEWS: finalize 2023-02-15 19:11:52 +00:00
Luca Boccassi
3c145b7d04
Merge pull request #26427 from bluca/hwdb
Update news and hwdb
2023-02-15 19:08:36 +00:00
Luca Boccassi
0c1f5d50be hwdb: update 2023-02-15 18:05:43 +00:00
Luca Boccassi
1233a7cf1b NEWS: update contributors list 2023-02-15 18:03:15 +00:00
Luca Boccassi
504d0acf61 cryptsetup: do not assert when unsealing token without salt
Salt was added in v253. We are not checking whether it was actually found
(non-zero size), so when an old tpm+pin enrollment is opened things go boom.
For good measure, check both the buffer and the size in both places.

Assertion 'saltlen > 0' failed at src/shared/tpm2-util.c:2490, function tpm2_util_pbkdf2_hmac_sha256(). Aborting.
2023-02-15 18:01:28 +00:00
Yu Watanabe
c126c8ac81 ukify: fix padding length 2023-02-15 18:01:02 +00:00
Luca Boccassi
9ecf865433
Merge pull request #26417 from yuwata/sysusers-root-group
sysusers: also create root group
2023-02-15 17:03:59 +00:00
Yu Watanabe
fff1edc9f9
Merge pull request #26424 from ldv-alt/fix-typos
Fix a few typos in NEWS, docs and comments
2023-02-16 00:10:18 +09:00
Raul Tambre
6b4dc4d2f8 man/tc: Fix hexadecimals being with an O 2023-02-15 16:03:28 +01:00
Dmitry V. Levin
30fd9a2dab treewide: fix a few typos in NEWS, docs and comments 2023-02-15 10:41:03 +00:00
Yu Watanabe
729045ffae NEWS: mention that the default mDNS mode is now "yes"
C.f. issue #25252, PR #25255, and
RHBZ#2169786 (https://bugzilla.redhat.com/show_bug.cgi?id=2169786).
2023-02-15 10:41:03 +00:00
Dmitry V. Levin
8d3473f01d src: fix several typos in log messages 2023-02-15 10:41:03 +00:00
Yu Watanabe
6f31095105 test-sysusers: add test for basic.conf 2023-02-15 10:54:25 +09:00
Yu Watanabe
9361a712f8 sysusers: also add root group
Follow-up for 49bb7fe5f8.

Fixes an issue reported at
https://github.com/systemd/systemd/pull/26270#issuecomment-1428945403.
2023-02-15 10:29:10 +09:00
Jean-Tiare Le Bigot
112f81a547 hwdb: Add HP ENVY x360 2-in-1
Since #26144, RFKILL events are disabled for HP ENVY x360 Convertible.
This commit adds a variation of the name.
2023-02-15 10:25:37 +09:00
Mike Gilbert
7cd137e647 bootctl: avoid using __WORDSIZE macro
__WORDSIZE does not seem to be documented anywhere, and is probably
meant to be used internally by glibc headers.

In systemd, it was only being used in warning messages. We can avoid
using it by rewording the messages slightly.

Fixes a build error with musl libc.

Bug: https://bugs.gentoo.org/894430
2023-02-15 10:24:25 +09:00
Yu Watanabe
f0353cf2e9 core/execute: fix comment 2023-02-15 10:10:13 +09:00