Yu Watanabe [Mon, 1 May 2023 03:52:50 +0000 (12:52 +0900)]
sd-journal: add _OBJECT_TYPE_INVALID as usual
Yu Watanabe [Mon, 1 May 2023 03:50:30 +0000 (12:50 +0900)]
sd-journal: align table
Yu Watanabe [Sat, 29 Apr 2023 22:02:34 +0000 (07:02 +0900)]
sd-journal: check that the journal file is not stored in .newest_by_boot_id on free
Yu Watanabe [Sat, 29 Apr 2023 22:00:31 +0000 (07:00 +0900)]
sd-journal: unset prioq index on failure
Otherwise, potentially, the assertion in
journal_file_unlink_newest_by_bood_id() will be triggered.
Yu Watanabe [Sat, 29 Apr 2023 21:57:49 +0000 (06:57 +0900)]
sd-journal: fix use-after-free
As commented in the code, we need to replace the pointer to the key,
hence, hashmap_replace() must be used, instead of hashmap_update().
Fixes #27459.
Dan Streetman [Thu, 8 Dec 2022 21:57:47 +0000 (16:57 -0500)]
tpm2: move openssl-required ifdef code out of policy-building function
don bright [Sun, 30 Apr 2023 03:33:13 +0000 (22:33 -0500)]
hwdb: add hardware rfkill key for Dell Latitude E6* models (#27462)
Hello
This pull req is adapting pull req #5772 (which fixed issue #5047), for the very similar computer Dell Latitude E6420 which has the same problem with the hardware switch to toggle wifi (aka rfkill). The symptom is the following repeated msgs in dmesg
[ 309.010284] atkbd serio0: Use 'setkeycodes e008 <keycode>' to make it known.
[ 309.016020] atkbd serio0: Unknown key pressed (translated set 2, code 0x88 on isa0060/serio0).
Adding this line to include E6 models causes these messages to stop showing in dmesg
Thank you
Brad Fitzpatrick [Mon, 17 Apr 2023 21:36:33 +0000 (14:36 -0700)]
man: clarify RoutingPolicyRule.TypeOfService docs
Yu Watanabe [Sat, 29 Apr 2023 19:28:45 +0000 (04:28 +0900)]
Merge pull request #27461 from bluca/coredumpctl_completion
coredumpctl: fix bash completion
Luca Boccassi [Tue, 25 Apr 2023 14:30:34 +0000 (15:30 +0100)]
coredumpctl: add --file/--root/--image to bash completion
Luca Boccassi [Tue, 25 Apr 2023 14:30:00 +0000 (15:30 +0100)]
coredumpctl: fix bash completion matching
When multi-word matching string is quoted, __contains_word compares
it as a whole to the passed option, so it doesn't work.
Frantisek Sumsal [Sat, 29 Apr 2023 07:44:03 +0000 (09:44 +0200)]
test: make sure the test units have a `test-` prefix
So when collecting coverage the test-.service dropin works as
expected.
Follow-up to
969f5f3cea.
Frantisek Sumsal [Sat, 29 Apr 2023 07:33:18 +0000 (09:33 +0200)]
test: match all messages with the FILE field
As the systemd-pstore process is quite short lived, it might sometimes
lack the necessary metadata to make matching against a unit or a syslog
tag work. Since we already use a cursor file to make the matching window
small as possible, let's just drop the unit match completely and hope
for the best.
Resolves: #27453
Luca Boccassi [Sat, 29 Apr 2023 11:35:24 +0000 (12:35 +0100)]
Merge pull request #27451 from yuwata/core-path-trigger-notify
core/path: do not install new job in .trigger_notify()
Yu Watanabe [Sat, 29 Apr 2023 02:51:57 +0000 (11:51 +0900)]
missing_fs: also define struct file_clone_range
Follow-up for
b640e274a7c363a2b6394c9dce5671d9404d2e2a.
Addresses https://github.com/systemd/systemd/commit/
b640e274a7c363a2b6394c9dce5671d9404d2e2a#r110996661.
Yu Watanabe [Fri, 28 Apr 2023 19:39:46 +0000 (04:39 +0900)]
test: add tests for "systemctl stop" vs triggering by path unit
Yu Watanabe [Sat, 29 Apr 2023 00:10:11 +0000 (09:10 +0900)]
test: create temporary units under /run
Yu Watanabe [Fri, 28 Apr 2023 19:31:53 +0000 (04:31 +0900)]
core/path: do not enqueue new job in .trigger_notify callback
Otherwise,
1. X.path triggered X.service, and the service has waiting start job,
2. systemctl stop X.service
3. the waiting start job is cancelled to install new stop job,
4. path_trigger_notify() is called, and may reinstall new start job,
5. the stop job cannot be installed, and triggeres assertion.
So, instead, let's add a defer event source, then enqueue the new start
job after the stop (or any other type) job finished.
Fixes https://github.com/systemd/systemd/issues/24577#issuecomment-
1522628906.
Yu Watanabe [Fri, 28 Apr 2023 19:30:32 +0000 (04:30 +0900)]
core/path: align table
Lennart Poettering [Fri, 28 Apr 2023 14:14:32 +0000 (16:14 +0200)]
pid1: unify implemenation of /run/ disk space safety check a bit
reload/reexec currently used a separate implementation of the /run/ disk
space check, different from the one used for switch-root, even though
the code is mostly the same. The one difference is that the former
checks are authoritative, the latter are just informational (that's
because refusing a reload/reexec is relatively benign, but refusing a
switch-root quite troublesome, since this code is entered when it's
already "too late" to turn turn back, i.e. when the preparatory
transaction to initiate the switch root are already fully executed.
Let's share some code, and unify codepaths.
(This is preparation for later addition of a "userspace reboot" concept)
No change in behaviour, just refactoring.
Lennart Poettering [Fri, 28 Apr 2023 14:56:39 +0000 (16:56 +0200)]
core/systemctl: when switching root default to /sysroot/
We hardcode the path the initrd uses to prepare the final mount point at
so many places, let's also imply it in "systemctl switch-root" if not
specified.
This adds the fallback both to systemctl and to PID 1 (this is because
both to — different – checks on the path).
Daan De Meyer [Fri, 28 Apr 2023 14:54:57 +0000 (16:54 +0200)]
libsystemd: Add missing memory pressure functions to public symbols
Mike Yuan [Fri, 28 Apr 2023 17:33:21 +0000 (01:33 +0800)]
Merge pull request #27445 from poettering/reflink-fix
remove duplication reflink ioctl invocation
Lennart Poettering [Fri, 28 Apr 2023 14:30:32 +0000 (16:30 +0200)]
systemctl: rework 'if' to 'switch' statement
Luca Boccassi [Fri, 28 Apr 2023 15:14:09 +0000 (16:14 +0100)]
Merge pull request #27437 from mrc0mmand/pstore
test: add a couple of tests for systemd-pstore
Lennart Poettering [Fri, 28 Apr 2023 13:16:00 +0000 (15:16 +0200)]
copy: shortcut reflink_range() to reflink() in some cases
Lennart Poettering [Fri, 28 Apr 2023 13:10:24 +0000 (15:10 +0200)]
copy: don't call clone ioctls twice
The btrfs name and the generic name have the same values, hence there's
no point in bothering with the former.
Frantisek Sumsal [Thu, 27 Apr 2023 21:17:52 +0000 (23:17 +0200)]
test: add a couple of tests for systemd-pstore
Luca Boccassi [Fri, 28 Apr 2023 10:34:41 +0000 (11:34 +0100)]
Merge pull request #27440 from yuwata/reflink-follow-ups
copy: follow ups for reflink()
Frantisek Sumsal [Fri, 28 Apr 2023 09:50:33 +0000 (11:50 +0200)]
pstore: avoid opening the dmesg.txt file if not requested
Even with Storage=journal we would still attempt to open the final
dmesg.txt file which causes a lot of noise in the journal:
```
[ 5.764111] H testsuite-82.sh[658]: + systemctl start systemd-pstore
[ 5.806385] H systemd[1]: Starting modprobe@efi_pstore.service...
[ 5.808656] H systemd[1]: modprobe@efi_pstore.service: Deactivated successfully.
[ 5.808971] H systemd[1]: Finished modprobe@efi_pstore.service.
[ 5.818845] H kernel: audit: type=1130 audit(
1682630623.637:114): pid=1 uid=0 auid=
4294967295 ses=
4294967295 subj=kernel msg='unit=modprobe@efi_pstore comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termin>
[ 5.818865] H kernel: audit: type=1131 audit(
1682630623.637:115): pid=1 uid=0 auid=
4294967295 ses=
4294967295 subj=kernel msg='unit=modprobe@efi_pstore comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termin>
[ 5.816052] H systemd[1]: Starting systemd-pstore.service...
[ 5.840703] H systemd-pstore[806]: PStore dmesg-efi-
168263062313014.
[ 5.841239] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.841428] H systemd-pstore[806]: PStore dmesg-efi-
168263062312014.
[ 5.841575] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.841712] H systemd-pstore[806]: PStore dmesg-efi-
168263062311014.
[ 5.841839] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.841989] H systemd-pstore[806]: PStore dmesg-efi-
168263062310014.
[ 5.842141] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.842274] H systemd-pstore[806]: PStore dmesg-efi-
168263062309014.
[ 5.842423] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.842589] H systemd-pstore[806]: PStore dmesg-efi-
168263062308014.
[ 5.842722] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.842865] H systemd-pstore[806]: PStore dmesg-efi-
168263062307014.
[ 5.843003] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.843153] H systemd-pstore[806]: PStore dmesg-efi-
168263062306014.
[ 5.843280] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.843434] H systemd-pstore[806]: PStore dmesg-efi-
168263062305014.
[ 5.843570] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.843702] H systemd-pstore[806]: PStore dmesg-efi-
168263062304014.
[ 5.843831] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.843958] H systemd-pstore[806]: PStore dmesg-efi-
168263062303014.
[ 5.844093] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.844250] H systemd-pstore[806]: PStore dmesg-efi-
168263062302014.
[ 5.844412] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.844619] H systemd-pstore[806]: PStore dmesg-efi-
168263062301014.
[ 5.844781] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.844956] H systemd-pstore[806]: PStore dmesg-efi-
168263062300014.
[ 5.845168] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/
1682630623/014/dmesg.txt: Operation not permitted
[ 5.851101] H systemd[1]: Finished systemd-pstore.service.
```
Yu Watanabe [Fri, 28 Apr 2023 05:02:42 +0000 (14:02 +0900)]
network-generator: shorten code a bit
Yu Watanabe [Fri, 28 Apr 2023 09:46:36 +0000 (18:46 +0900)]
Merge pull request #27424 from dtardon/auto-cleanup
More automatic cleanup
Frantisek Sumsal [Fri, 28 Apr 2023 09:09:22 +0000 (11:09 +0200)]
pstore: explicitly set the base when converting record ID
David Tardon [Fri, 21 Apr 2023 13:53:02 +0000 (15:53 +0200)]
logind-session-dbus: use _cleanup_
David Tardon [Fri, 21 Apr 2023 13:50:21 +0000 (15:50 +0200)]
logind-session-device: modernize session_device_free()
David Tardon [Fri, 21 Apr 2023 13:30:45 +0000 (15:30 +0200)]
homed-manager-bus: use _cleanup_
David Tardon [Fri, 28 Apr 2023 07:28:25 +0000 (09:28 +0200)]
transaction: make transaction_free() static
... as it's not needed outside transaction.c anymore.
David Tardon [Fri, 21 Apr 2023 13:15:38 +0000 (15:15 +0200)]
manager: use _cleanup_ in manager_propagate_reload()
David Tardon [Fri, 21 Apr 2023 13:14:17 +0000 (15:14 +0200)]
manager: use _cleanup_ in manager_add_job()
David Tardon [Fri, 21 Apr 2023 13:13:35 +0000 (15:13 +0200)]
transaction: introduce transaction_abort_and_free()
Will be used in following commits.
Yu Watanabe [Fri, 28 Apr 2023 05:18:48 +0000 (14:18 +0900)]
missing_fs: mention commit hash and version of ioctl commands introduced
Yu Watanabe [Fri, 28 Apr 2023 05:05:29 +0000 (14:05 +0900)]
copy: rename reflink_full() -> reflink_range()
The commit
b640e274a7c363a2b6394c9dce5671d9404d2e2a introduced reflink()
and reflink_full(). We usually name function xyz_full() for fully
parameterized version of xyz(), and xyz() is typically a inline alias of
xyz_full(). But in this case, reflink() and reflink_full() call
different ioctl().
Moreover, reflink_full() does partial reflink, while reflink() does full
file reflink. That's super confusing.
Let's rename reflink_full() to reflink_range(), the new name is
consistent with ioctl name, and should be fine.
David Edmundson [Wed, 8 Feb 2023 13:28:50 +0000 (13:28 +0000)]
xdg-autostart-service: handle gnome autostart phase better on other desktops
Autostart files which contain the line gnome-autostart-phase are currently
completely skipped by systemd. This is because these are handled internally by
gnome startup through other means.
The problem is a number of desktop files that need to run on KDE too have this
flag set. Ideally they should just create systemd user units, but we're not at
this point universally yet.
This patch changes the logic so if the flag is set, we set NotShowIn-gnome,
which in turn would just not load decided at runtime.
As an optimisation if we would get conflicting OnlyShowIn lines we still
skip the file completely.
Example:
$ rg 'Exec|Autostart-Phase' /etc/xdg/autostart/gnome-keyring-pkcs11.desktop
Exec=/usr/bin/gnome-keyring-daemon --start --components=pkcs11
X-GNOME-Autostart-Phase=PreDisplayServer
$ cat '/tmp/xxx/app-gnome\x2dkeyring\x2dpkcs11@autostart.service'
# Automatically generated by systemd-xdg-autostart-generator
[Unit]
SourcePath=/etc/xdg/autostart/gnome-keyring-pkcs11.desktop
...
[Service]
...
ExecCondition=/usr/lib/systemd/systemd-xdg-autostart-condition "Unity:MATE" "GNOME"
Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Daan De Meyer [Thu, 27 Apr 2023 18:37:50 +0000 (20:37 +0200)]
copy: Introduce reflink() and reflink_full()
The kernel has had filesystem independent reflink ioctls for a
while now, let's try to use them and fall back to the btrfs specific
ones if they're not supported.
David Tardon [Fri, 21 Apr 2023 13:06:28 +0000 (15:06 +0200)]
transaction: modernize transaction_free()
David Tardon [Fri, 21 Apr 2023 13:34:11 +0000 (15:34 +0200)]
initctl: use _cleanup_
David Tardon [Fri, 21 Apr 2023 13:34:49 +0000 (15:34 +0200)]
initctl: add assert
David Tardon [Fri, 21 Apr 2023 14:07:31 +0000 (16:07 +0200)]
specifier: use _cleanup_
David Tardon [Fri, 21 Apr 2023 12:44:06 +0000 (14:44 +0200)]
path-util: use _cleanup_
David Tardon [Fri, 21 Apr 2023 08:48:03 +0000 (10:48 +0200)]
logind: rename function to avoid confusion
David Tardon [Fri, 21 Apr 2023 08:44:43 +0000 (10:44 +0200)]
logind-core: drop unneeded check for NULL
David Tardon [Fri, 21 Apr 2023 08:44:26 +0000 (10:44 +0200)]
logind-core: modernize button_free()
David Tardon [Fri, 21 Apr 2023 12:40:54 +0000 (14:40 +0200)]
env-util: use more _cleanup_ in replace_env_argv()
David Tardon [Fri, 21 Apr 2023 12:24:47 +0000 (14:24 +0200)]
env-util: use _cleanup_ in replace_env_argv()
David Tardon [Thu, 27 Apr 2023 19:10:35 +0000 (21:10 +0200)]
env-util: rename variable
David Tardon [Fri, 21 Apr 2023 12:24:26 +0000 (14:24 +0200)]
env-util: use _cleanup_ in strv_env_delete()
Luca Boccassi [Thu, 27 Apr 2023 19:31:57 +0000 (20:31 +0100)]
Merge pull request #27346 from poettering/pam-fixes
pam-systemd: be more careful with sharing bus connections
Lennart Poettering [Thu, 27 Apr 2023 13:33:01 +0000 (15:33 +0200)]
shutdown: paranoia – close all fds we might get passed in
We don't expect any fds (beyond 0…2) to be passed from the service
manager into systemd-shutdown, but let's better be safe then sorry.
Lennart Poettering [Thu, 20 Apr 2023 12:02:39 +0000 (14:02 +0200)]
pam-systemd: disconnect bus connection when leaving session hook, even on error
This adds support for systematically destroying connections in
pam_sm_session_open() even on failure, so that under no circumstances
unserved dbus connection are around while the invoking process waits for
the session to end. Previously we'd only do this on success, now do it
in all cases.
This matters since so far we suggested people hook pam_systemd into
their pam stacks prefixed with "-", so that login proceeds even if
pam_systemd fails. This however means that in an error case our
cached connection doesn't get disconnected even if the session then is
invoked. This fixes that.
Lennart Poettering [Mon, 24 Apr 2023 12:32:54 +0000 (14:32 +0200)]
pam-util: include PID in PAM data field id
Let's systematically avoid sharing cached busses between processes (i.e.
from parent and child after fork()), by including the PID in the field
name.
With that we're never tempted to use a bus object the parent created in
the child.
(Note this is about *use*, not about *destruction*. Destruction needs to
be checked by other means.)
Franck Bui [Thu, 27 Apr 2023 07:04:00 +0000 (09:04 +0200)]
test: dont use anchor char '$' to match a part of a string
When anchoring the pattern using '$' regular expression operator it forces '=~'
operator to match the entire string.
Mike Yuan [Thu, 27 Apr 2023 14:40:09 +0000 (22:40 +0800)]
Merge pull request #25622 from YHNdnzj/tmpfiles-X-bit-support
tmpfiles: add conditionalized execute permission (X) support
Lennart Poettering [Thu, 27 Apr 2023 14:37:06 +0000 (16:37 +0200)]
Merge pull request #27376 from poettering/subcgroup
pid1: add DelegateSubgroup= option
Lennart Poettering [Thu, 27 Apr 2023 12:15:50 +0000 (14:15 +0200)]
test: extend test 19 to also verify DelegateSubgroup= works
Lennart Poettering [Mon, 24 Apr 2023 08:19:28 +0000 (10:19 +0200)]
nspawn: port over to /supervisor/ subcgroup being delegated to nspawn
Let's make use of the new DelegateSubgroup= feature and delegate the
/supervisor/ subcgroup already to nspawn, so that moving the supervisor
process there is unnecessary.
Lennart Poettering [Fri, 21 Apr 2023 19:06:22 +0000 (21:06 +0200)]
udev: port to DelegateSubgroup=
Lennart Poettering [Mon, 24 Apr 2023 08:11:46 +0000 (10:11 +0200)]
units: make system service manager create init.scope subcgroup for user service manager
This one is basically for free, since the service manager is already
prepared for being invoked in init.scope. Hence let's start it in the
right cgroup right-away.
Lennart Poettering [Mon, 24 Apr 2023 08:05:10 +0000 (10:05 +0200)]
core: change ownership of subcgroup we create recursively, it shall be owned by the user delegated to
If we create a subcroup (regardless if the '.control' subgroup we
always created or one configured via DelegateSubgroup=) it's inside of
the delegated territory of the cgroup tree, hence it should be owned
fully by the unit's users. Hence do so.
Lennart Poettering [Mon, 24 Apr 2023 08:05:04 +0000 (10:05 +0200)]
execute: don't apply journal + oomd xattrs to subcgroup
We don't need to apply the journal/oomd xattrs to the subcgroups we add,
since those daemons already look for the xattrs up the tree anyway.
Hence remove this.
This is in particular relevant as it means later changes to the xattr
don#t need to be replicated on the subcgroup either.
Lennart Poettering [Fri, 21 Apr 2023 16:22:35 +0000 (18:22 +0200)]
core: add DelegateSubgroup= setting
This implements a minimal subset of #24961, but in a lot more
restrictive way: we only allow one level of subcgroup (as that's enough
to address the no-processes in inner cgroups rule), and does not change
anything about threaded cgroup logic or similar, or make any of this new
behaviour mandatory.
All this does is this: all non-control processes we invoke for a unit
we'll invoke in a subgroup by the specified name.
We'll later port all our current services that use cgroup delegation
over to this, i.e. user@.service, systemd-nspawn@.service and
systemd-udevd.service.
Lennart Poettering [Fri, 21 Apr 2023 16:14:53 +0000 (18:14 +0200)]
cgroup: rework how we validate/escape cgroups
Let's clean up validation/escaping of cgroup names. i.e. split out code
that tests if name needs escaping. Return proper error codes, and extend
test a bit.
Mike Yuan [Thu, 9 Mar 2023 12:13:34 +0000 (20:13 +0800)]
test: tmpfiles: add tests on conditionalized execute bit
Mike Yuan [Fri, 16 Dec 2022 16:44:06 +0000 (00:44 +0800)]
tmpfiles: add conditionalized execute bit (X) support
According to setfacl(1), "the character X stands for
the execute permission if the file is a directory
or already has execute permission for some user."
After this commit, parse_acl() would return 3 acl
objects. The newly-added acl_exec object contains
entries that are subject to conditionalized execute
bit mangling. In tmpfiles, we would iterate the acl_exec
object, check the permission of the target files,
and remove the execute bit if necessary.
Here's an example entry:
A /tmp/test - - - - u:test:rwX
Closes #25114
Yu Watanabe [Thu, 27 Apr 2023 03:29:29 +0000 (12:29 +0900)]
Merge pull request #27413 from yuwata/core-job-cleanups
core/job: cleanups for job ID
Lennart Poettering [Wed, 26 Apr 2023 14:55:42 +0000 (16:55 +0200)]
units: restrict hugepages fs a bit
suid binaries and device nodes should not be placed there, hence forbid
it.
Of all the API VFS we mount from PID 1 or via a unit file this one is
the only one where we didn't add MS_NODEV/MS_NOSUID. Let's address that,
since there's really no reason why device nodes or suid binaries would
be placed in hugetlbfs.
Yu Watanabe [Sat, 22 Apr 2023 12:03:56 +0000 (21:03 +0900)]
core/service: make service_add_fd_store() always consume provided fd
No functional change, just refactoring.
Lennart Poettering [Wed, 26 Apr 2023 19:45:35 +0000 (21:45 +0200)]
image-policy: split out code that "extends" underspecified partition policy flags
When encoding partition policy flags we allow parts of the flags to be
"unspecified" (i.e. entirely zeros), which when actually checking the
policy we'll automatically consider equivalent to "any" (i.e. entirely
ones). This "extension" of the flags was so far done as part of
partition_policy_normalized_flags(). Let's split this logic out into a
new function partition_policy_flags_extend() that simply sets all bits
in a specific part of the flags field if they were entirely zeroes so
far.
When comparing policy objects for equivalence we so far used
partition_policy_normalized_flags() to compare the per-designator flags,
which thus meant that "underspecified" flags, and fully specified ones
that are set to "any" were considered equivalent. Which is great.
However, we forgot to do that for the fallback policy flags, the flags
that apply to all partitions for which no explicit policy flags are
specified.
Let's use the new partition_policy_flags_extend() call to compare them
in extended form, so that there two we can hide the difference between
"underspecified" and "any" flags.
Zbigniew Jędrzejewski-Szmek [Thu, 12 Jan 2023 08:02:08 +0000 (09:02 +0100)]
man: use ukify more in systemd-measure examples
ukify supports signing with multiple keys, so show an example of this, and just
let ukify print the calls to systemd-measure that will be done.
This also does other small cleanups:
- Use more realistic names in examples
- Use $ as the prompt for commands that don't require root (most don't).
Once we switch to operations that don't require a TPM, we should be able to get
rid of the remaining calls that require root.
- Ellipsize or linebreak various parts
- Use --uname. We warn if it is not specified and we have to do autodetection, so
let's nudge people towards including it rather than not.
Follow-up for
e069c57f0616d39363d36ac7f9c3e6ec8be01ab1.
Luca Boccassi [Wed, 26 Apr 2023 23:05:01 +0000 (00:05 +0100)]
Merge pull request #26877 from yuwata/fuzz-journal-remote
fuzz-journal-remote: several cleanups
Luca Boccassi [Wed, 26 Apr 2023 22:37:53 +0000 (23:37 +0100)]
Merge pull request #27355 from fbuihuu/kbd-improve-vc2x11-conversion
locale: improve vc -> x11 keyboard conversion
Luca Boccassi [Wed, 26 Apr 2023 22:22:59 +0000 (23:22 +0100)]
Merge pull request #27421 from bluca/coredump_filter
CoredumpFilter: fix stack overflow and invalid assignment with 'all'
Lennart Poettering [Wed, 26 Apr 2023 19:21:37 +0000 (21:21 +0200)]
image-policy: correct two comments
Lennart Poettering [Wed, 26 Apr 2023 19:23:42 +0000 (21:23 +0200)]
update TODO
Daan De Meyer [Wed, 26 Apr 2023 16:55:51 +0000 (18:55 +0200)]
Merge pull request #27415 from DaanDeMeyer/verity-minimize
repart: Add Minimize= support for verity hash partitions
Daan De Meyer [Wed, 26 Apr 2023 16:35:26 +0000 (18:35 +0200)]
Merge pull request #27419 from yuwata/sd-journal-entry-item
sd-journal: skip invalid entry item
Yu Watanabe [Wed, 26 Apr 2023 05:39:56 +0000 (14:39 +0900)]
core/job: use new job ID when we failed to deserialize job ID
This is for the case when we fail to deserialize job ID.
In job_install_deserialized(), we also check the job type, and that is
for the case when we failed to deserialize the job.
Let's gracefully handle the failure in deserializing the job ID.
This is paranoia, and just for safety. Should not change any behavior.
Yu Watanabe [Wed, 26 Apr 2023 05:37:26 +0000 (14:37 +0900)]
core/job: handle job ID overflow or conflict more sanely
This is paranoia, and just for safety. Should not change any behavior.
Yu Watanabe [Wed, 26 Apr 2023 05:24:12 +0000 (14:24 +0900)]
core/job: fix indentation
Yu Watanabe [Wed, 26 Apr 2023 05:23:12 +0000 (14:23 +0900)]
core/job: add one more assertion
In this stage, the unit should not have installed job of the type.
Yu Watanabe [Wed, 26 Apr 2023 04:59:34 +0000 (13:59 +0900)]
core/transaction: use hashmap_remove_value() to make not remove job with same ID
When we fail to deserialize job ID, or the current_job_id is overflowed,
we may have jobs with the same ID.
This is paranoia, and just for safety.
Note, we already use hashmap_remove_value() in job_uninstall().
Luca Boccassi [Wed, 26 Apr 2023 13:32:04 +0000 (14:32 +0100)]
test: add coverage for CoredumpFilter=all
Luca Boccassi [Wed, 26 Apr 2023 13:19:33 +0000 (14:19 +0100)]
coredump filter: add mask for 'all' using UINT32_MAX, not UINT64_MAX
The kernel returns ERANGE when UINT64_MAX is passed. Create a mask
and use UINT32_max, which is accepted, so that future bits will also
be set.
Luca Boccassi [Mon, 17 Apr 2023 23:40:43 +0000 (00:40 +0100)]
ukify: allow building PE addon
Make the kernel optional too, so that we can easily build and sign a PE addon,
that can be used to carry extra command line options.
Zbigniew Jędrzejewski-Szmek [Wed, 26 Apr 2023 14:40:01 +0000 (16:40 +0200)]
Merge pull request #27398 from yuwata/udev-rule-negative-match
udev-rule: fix negative match
Zbigniew Jędrzejewski-Szmek [Wed, 26 Apr 2023 14:37:59 +0000 (16:37 +0200)]
Merge pull request #27411 from yuwata/udev-iocost-follow-ups
udev/iocost: several follow ups
Luca Boccassi [Wed, 26 Apr 2023 13:18:04 +0000 (14:18 +0100)]
coredump filter: fix stack overflow with =all
We translate 'all' to UNIT64_MAX, which has a lot more 'f's. Use the
helper macro, since a decimal uint64_t will always be >> than a hex
representation.
root@image:~# systemd-run -t --property CoredumpFilter=all ls /tmp
Running as unit: run-u13.service
Press ^] three times within 1s to disconnect TTY.
*** stack smashing detected ***: terminated
[137256.320511] systemd[1]: run-u13.service: Main process exited, code=dumped, status=6/ABRT
[137256.320850] systemd[1]: run-u13.service: Failed with result 'core-dump'.
Zbigniew Jędrzejewski-Szmek [Wed, 26 Apr 2023 12:57:13 +0000 (14:57 +0200)]
Merge pull request #27408 from keszybz/creds-missing-message
Adjust messages when credentials are missing
Zbigniew Jędrzejewski-Szmek [Wed, 26 Apr 2023 12:55:41 +0000 (14:55 +0200)]
Merge pull request #26944 from aafeijoo-suse/systemd-network-generator-initrd-fix
network-generator: do not parse kernel command line more than once
Frantisek Sumsal [Wed, 26 Apr 2023 09:05:40 +0000 (11:05 +0200)]
test: tell dfuzzer to skip Reexecute()
As described in systemd/systemd#27204 reexecuting the daemon while
running in a systemd-run "session" causes the session end prematurely.
Let's skip the Reexecute() method in dfuzzer and trigger it manually
until the issue is resolved.
Daan De Meyer [Wed, 26 Apr 2023 09:52:54 +0000 (11:52 +0200)]
repart: Add Minimize= support for verity hash partitions
Fixes #27414