Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 12:30:54 +0000 (14:30 +0200)]
NEWS: add entries after 252-rc1, update contrib list
Lennart Poettering [Tue, 18 Oct 2022 10:08:53 +0000 (12:08 +0200)]
update TODO
Luca Boccassi [Tue, 18 Oct 2022 09:49:29 +0000 (11:49 +0200)]
Merge pull request #25004 from keszybz/transient-drop-ins
Allow drop-ins for transient units
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 09:34:16 +0000 (11:34 +0200)]
Merge pull request #25007 from keszybz/rename-dbus-dump
manager: rename dbus method
Ted X. Toth [Thu, 13 Oct 2022 19:58:26 +0000 (12:58 -0700)]
manager: use target process context to set socket context
Use target process context to set socket context when using SELinuxContextFromNet
not systemd's context. Currently when using the SELinuxContextFromNet option for
a socket activated services, systemd calls getcon_raw which returns init_t and
uses the resulting context to compute the context to be passed to the
setsockcreatecon call. A socket of type init_t is created and listened on and
this means that SELinux policy cannot be written to control which processes
(SELinux types) can connect to the socket since the ref policy allows all
'types' to connect to sockets of the type init_t. When security accessors see
that any process can connect to a socket this raises serious concerns. I have
spoken with SELinux contributors in person and on the mailing list and the
consensus is that the best solution is to use the target executables context
when computing the sockets context in all cases.
[zjs review/comment:
This removes the branch that was added in
16115b0a7b7cdf08fb38084d857d572d8a9088dc.
16115b0a7b7cdf08fb38084d857d572d8a9088dc did two things: it had the branch here
in 'socket_determine_selinux_label()' and a code in 'exec_child()' to call
'label_get_child_mls_label(socket_fd, command->path, &label)'.
Before this patch, the flow was:
'''
mac_selinux_get_child_mls_label:
peercon = getpeercon_raw(socket_fd);
if (!exec_label)
exec_label = getfilecon_raw(exe);
socket_open_fds:
if (params->selinux_context_net) #
label = mac_selinux_get_our_label(); # this part is removed
else #
label = mac_selinux_get_create_label_from_exe(path);
socket_address_listen_in_cgroup(s, &p->address, label);
exec_child():
exec_context = mac_selinux_get_child_mls_label(fd, executable, context->selinux_context);
setexeccon(exec_context);
'''
]
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 13:03:16 +0000 (15:03 +0200)]
analyze: use DumpUnitsMatchingPatternsByFileDescriptor
Similarly to DumpByFileDescriptor vs Dump,
DumpUnitsMatchingPatternsByFileDescriptor is used in preference. Dissimilarly,
a fallback to DumpUnitsMatchingPatterns is not done on error, because there is
no need for backwards compatibility.
The code is still more verbose than I'd like, but there are four different code
paths with slightly different rules in each case, so it's hard to make this all
very brief. Since we have a separate file dedicated to making those calls, the
verbose-but-easy-to-follow implementation should be OK.
Closes #24989.
I only did a quick test that all both variants works locally and over ssh.
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 05:36:20 +0000 (07:36 +0200)]
Merge pull request #24777 from medhefgo/stub
stub: Use LoadImage/StartImage
Luca Boccassi [Mon, 17 Oct 2022 21:11:13 +0000 (23:11 +0200)]
Merge pull request #25035 from keszybz/manager-method-names
Manager method names
Frantisek Sumsal [Mon, 17 Oct 2022 16:11:21 +0000 (18:11 +0200)]
test: call sync() before checking the test logs
Otherwise we might hit a race where we read the test log just before
it's fully written to the disk:
```
======================================================================
FAIL: test_interleaved (__main__.ExecutionResumeTest.test_interleaved)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/systemd/test/test-exec-deserialization.py", line 170, in test_interleaved
self.check_output(expected_output)
File "/root/systemd/test/test-exec-deserialization.py", line 111, in check_output
self.assertEqual(output, expected_output)
AssertionError: 'foo\n' != 'foo\nbar\n'
foo
+ bar
```
With some debug:
```
test_interleaved (__main__.ExecutionResumeTest.test_interleaved) ...
Assertion failed; file contents just after the assertion:
b'foo\n'
File contents 5 seconds later:
b'foo\nbar\n'
FAIL
```
Seen quite often in CentOS CI on the fast baremetal machines.
Luca Boccassi [Mon, 17 Oct 2022 19:52:00 +0000 (21:52 +0200)]
Merge pull request #25039 from mrc0mmand/test-tewaks
A couple of minor tweaks for recent CI fails
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 18:49:18 +0000 (20:49 +0200)]
Merge pull request #24992 from yuwata/sd-device-monitor-receive-buffer
sd-device-monitor: dynamically allocate receive buffer
Lennart Poettering [Mon, 17 Oct 2022 13:21:49 +0000 (15:21 +0200)]
man: add missing reference to systemd-pcrphase-sysinit.service
Luca Boccassi [Mon, 17 Oct 2022 15:12:16 +0000 (17:12 +0200)]
Merge pull request #25036 from keszybz/plurals
Remove usage of "noun(s)" in messages and docs
David Edmundson [Tue, 11 Oct 2022 10:18:13 +0000 (11:18 +0100)]
xdg-autostart-service: Add comments to tilde expansion, use path_join()
Follow-ups for https://github.com/systemd/systemd/pull/24658
Daan De Meyer [Mon, 17 Oct 2022 14:06:39 +0000 (16:06 +0200)]
Update TODO
Daan De Meyer [Mon, 17 Oct 2022 12:53:16 +0000 (14:53 +0200)]
mkosi: Switch to Fedora 37
Official release date is close so let's switch mkosi CI to it already.
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 12:01:16 +0000 (14:01 +0200)]
meson: drop repeated output in error message
Zbigniew Jędrzejewski-Szmek [Sat, 15 Oct 2022 14:06:20 +0000 (16:06 +0200)]
tree-wide: replace "plural(s)" by "plurals"
(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.
There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 12:23:04 +0000 (14:23 +0200)]
manager: add DumpUnitsMatchingPatternsByFileDescriptor()
Frantisek Sumsal [Mon, 17 Oct 2022 13:00:12 +0000 (15:00 +0200)]
test: use SIGKILL to kill the container if necessary
TEST-69 uses a Python wrapper around the systemd-nspawn call, which on
error calls the `spawn.terminate()` method. However, with no arguments
it will only use SIGHUP and SIGINT signals - this might leave a stuck
container around, causing fails if the test is run again. With `force=True`
SIGKILL is used as well (if necessary).
Yu Watanabe [Mon, 17 Oct 2022 12:48:27 +0000 (21:48 +0900)]
test: add test for large uevent message
Jan Janssen [Fri, 14 Oct 2022 09:09:12 +0000 (11:09 +0200)]
boot: Rework shim image verification
This moves the shim security arch override to the new
ReinstallProtocolInterface based interface. This also has the benefit to
reduce the time window in which we have this override active and also
actually removes it, which was not previously done.
The shim hooks themselves are also modernized too. The upcalls should
really not be neccessary if shim is happy with the provided binary.
Yu Watanabe [Thu, 13 Oct 2022 16:18:47 +0000 (01:18 +0900)]
sd-device-monitor: dynamically allocate receive buffer
If udevd broadcasts a processed device with huge amount of properties,
then clients cannot receive the device.
Fixes #24987.
Jan Janssen [Wed, 21 Sep 2022 10:56:20 +0000 (12:56 +0200)]
stub: Allow loading unsigned kernel images
Jan Janssen [Wed, 21 Sep 2022 10:39:46 +0000 (12:39 +0200)]
boot: Use proper security arch protocol names
This is how the Platform Intregration Specification defines these.
Jan Janssen [Wed, 21 Sep 2022 10:23:36 +0000 (12:23 +0200)]
boot: Remove unused parameters from pe_kernel_info
Only the compat entry address is used now. This also now only returns
the compat entry address. If the image is native we do not need to try
calling into the entry address again as we would already have done so
from StartImage (and failed).
Jan Janssen [Wed, 21 Sep 2022 09:07:53 +0000 (11:07 +0200)]
stub: Use LoadImage/StartImage to start the kernel
This is the proper way to start any EFI binary. The fact this even ever
worked was because the kernel does not have any PE relocations.
The only downside is that the embedded kernel image has to be signed and
trusted by the firmware under secure boot. A future commit will try to
deal with that.
Jan Janssen [Wed, 21 Sep 2022 08:42:40 +0000 (10:42 +0200)]
stub: Rename image parameter
This is really the parent image for the kernel that is to be run.
Renaming it as such prevents confusion with any image handles that are
about to be created.
Frantisek Sumsal [Mon, 17 Oct 2022 12:38:00 +0000 (14:38 +0200)]
test: drop one layer of escaping
Frantisek Sumsal [Mon, 17 Oct 2022 12:31:25 +0000 (14:31 +0200)]
test: ignore gcov errors in TEST-34
TEST-34 complains in `test_check_writable` when running with gcov, as
the build directory tree is not writable with DynamicUser=true. As I had
no luck with $GCOV_PREFIX and other runtime gcov configuration, let's
just ignore the gcov errors for this test.
Lennart Poettering [Sun, 16 Oct 2022 22:14:21 +0000 (00:14 +0200)]
cryptsetup: drop redundant parens/drop ternary op
A ternary op is a bit weird to use if we end up assigning a variable to
itself in one of the branches. Hence use a plain if check.
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 09:31:52 +0000 (11:31 +0200)]
man: fix method name
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 08:48:52 +0000 (10:48 +0200)]
core: simplify the return convention in manager_load_unit()
This function was returning 0 or 1 on success. It has many callers, and it
wasn't clear if any of them care about the distinction. It turns out they don't
and the return values were done for convenience because manager_load_unit_prepare()
returns 0 or 1. Let's invert the code in the static function to follow the usual
pattern where 0 means "no work was done" and 1 means "work was done", and make
the non-static function always return 0 to make the code easier to read, and
also add comments that explain what is happening.
No functional change.
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 07:01:12 +0000 (09:01 +0200)]
core: modernize style of return param naming
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 11:44:28 +0000 (13:44 +0200)]
Merge pull request #24919 from anitazha/varlinkserialize
varlink/pid1 fixes for systemd-oomd (addresses #20330)
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 11:24:07 +0000 (13:24 +0200)]
Merge pull request #24986 from keszybz/news-systemd-measure
NEWS: rework the description of systemd-measure a bit again
Lennart Poettering [Mon, 17 Oct 2022 10:27:41 +0000 (12:27 +0200)]
pcrphase: fix --help text
We don't take a command, we just take a "word" which we'll extend into
PCR 11.
Lennart Poettering [Fri, 14 Oct 2022 18:53:42 +0000 (20:53 +0200)]
pcrphase: add two additional phases
This adds two more phases to the PCR boot phase logic: "sysinit" +
"final".
The "sysinit" one is placed between sysinit.target and basic.target.
It's good to have a milestone in this place, since this is after all
file systems/LUKS volumes are in place (which sooner or later should
result in measurements of their own) and before services are started
(where we should be able to rely on them to be complete).
This is particularly useful to make certain secrets available for
mounting secondary file systems, but making them unavailable later.
This breaks API in a way (as measurements during runtime will change),
but given that the pcrphase stuff wasn't realeased yet should be OK.
Quentin Deslandes [Tue, 6 Sep 2022 13:42:43 +0000 (14:42 +0100)]
tests: add nspawn's rootidmap integration test
Add integration test to testsuite-13.sh to ensure rootidmap option map
user IDs as expected.
Luca Boccassi [Mon, 17 Oct 2022 10:00:02 +0000 (12:00 +0200)]
Merge pull request #24938 from msizanoen1/journald-harden-clock-jump
journald: harden against forward clock jumps before unclean shutdown
Luca Boccassi [Mon, 17 Oct 2022 09:36:55 +0000 (11:36 +0200)]
Merge pull request #25003 from DaanDeMeyer/mkosi-fixes
mkosi: Add Centos Stream 8 back to CI
Lennart Poettering [Sun, 16 Oct 2022 16:16:53 +0000 (18:16 +0200)]
update TODO
Daan De Meyer [Fri, 14 Oct 2022 12:30:12 +0000 (14:30 +0200)]
mkosi: Add Centos Stream 8 back to CI
We can build all of systemd's features again on CentOS Stream 8, so
let's add it back to CI.
Daan De Meyer [Fri, 14 Oct 2022 12:53:41 +0000 (14:53 +0200)]
mkosi: Make sure bpf-framework works on CentOS Stream 8 as well
Daan De Meyer [Fri, 14 Oct 2022 12:27:48 +0000 (14:27 +0200)]
README: Fix libbpf minimum version
This didn't get properly updated as part of #24511
Daan De Meyer [Fri, 14 Oct 2022 12:26:50 +0000 (14:26 +0200)]
mkosi: Reenable bpf-framework
This got changed by mistake by #24511. Since we still support the
same libbpf version, we can keep this enabled everywhere.
Daan De Meyer [Fri, 14 Oct 2022 12:21:43 +0000 (14:21 +0200)]
qrcode-util: Add support for libqrencode 3.0
They didn't actually change API between major versions, so let's
support the previous version as well so we can add CentOS 8 Stream
back to CI.
Jan Janssen [Sun, 16 Oct 2022 07:36:21 +0000 (09:36 +0200)]
stub: Fix booting with old kernels
This fixes a regression introduced in
e1636807 that removed setting this
value as it seemingly was not used by the kernel and would actively
break above 4G boots. But old kernels (4.18 in particular) will not boot
properly if it is not filled out by us.
The original issue was using the truncated value to then jump into the
kernel entry point, which we do not do anymore. So setting this value
again on newer kernels is fine.
Lennart Poettering [Fri, 14 Oct 2022 13:46:04 +0000 (15:46 +0200)]
gpt-auto: rename all functions that operate on a DissectedPartition object add_partition_xyz()
The function for handling regular mounts based on DissectedPartition
objects is called add_partition_mount(), so let's follow this scheme for
all other functions that handle them, too. This nicely separates out the
low-level functions (which get split up args) from the high-level
functions (which get a DissectedPartition object): the latter are called
add_partition_xyz() the former just add_xyz().
This makes naming a bit more systematic. No change in behaviour.
Lennart Poettering [Sun, 16 Oct 2022 20:37:26 +0000 (22:37 +0200)]
generator: modernize generator_open_unit_file()
Lennart Poettering [Fri, 14 Oct 2022 13:30:06 +0000 (15:30 +0200)]
gpt-auto-generator: use our usual ret_xyz parameter naming
Lennart Poettering [Fri, 14 Oct 2022 13:27:53 +0000 (15:27 +0200)]
man: mention that pcrphase also measures into PCR 11
Lennart Poettering [Fri, 14 Oct 2022 12:42:37 +0000 (14:42 +0200)]
cryptsetup: use errno-flavoured logging where we have an errno
Lennart Poettering [Tue, 11 Oct 2022 16:22:21 +0000 (18:22 +0200)]
tpm2-util: fix parameter name
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 19:52:43 +0000 (21:52 +0200)]
TEST-15: add one more test for drop-in precedence
msizanoen1 [Tue, 11 Oct 2022 11:16:41 +0000 (18:16 +0700)]
journal: fix indentation in managed_journal_file_open_reliably
msizanoen1 [Sat, 8 Oct 2022 12:41:18 +0000 (19:41 +0700)]
journald: harden against forward clock jumps before unclean shutdown
Try harder to inherit the sequence number and ID from the old journal
file before rotating it away.
This helps the libsystemd journal file selection code make better decisions
even in the face of massive incorrect forward clock jumps prior to an
unclean shutdown.
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 12:02:45 +0000 (14:02 +0200)]
TEST-15: add test for transient units with drop-ins
We want to test four things:
- that the transient units are successfully started when drop-ins exist
- that the transient setings override the defaults
- the drop-ins override the transient settings (the same as for a normal unit)
- that things are the same before and after a reload
To make things more fun, we start and stop units in two different ways: via
systemctl and via a direct busctl invocation. This gives us a bit more coverage
of different code paths.
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 10:54:34 +0000 (12:54 +0200)]
TEST-15: also test hierarchical drop-ins for slices
Slices are worth testing too, because they don't need a fragment path so they
behave slightly differently than service units. I'm making this a separate
patch from the actual tests that I wanted to add later because it's complex
enough on its own.
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 10:42:35 +0000 (12:42 +0200)]
TEST-15: allow helper functions to accept other unit types
clear_services() is renamed to clear_units() and now takes a full
unit name including the suffix as an argument.
_clear_service() is renamed to clear_unit() and changed likewise.
create_service() didn't have the same underscore prefix, and I don't think
it's useful or needed for a local function, so it is removed.
No functional change.
Zbigniew Jędrzejewski-Szmek [Fri, 14 Oct 2022 13:02:20 +0000 (15:02 +0200)]
manager: allow transient units to have drop-ins
In https://github.com/containers/podman/issues/16107, starting of a transient
slice unit fails because there's a "global" drop-in
/usr/lib/systemd/user/slice.d/10-oomd-per-slice-defaults.conf (provided by
systemd-oomd-defaults package to install some default oomd policy). This means
that the unit_is_pristine() check fails and starting of the unit is forbidden.
It seems pretty clear to me that dropins at any other level then the unit
should be ignored in this check: we now have multiple layers of drop-ins
(for each level of the cgroup path, and also "global" ones for a specific
unit type). If we install a "global" drop-in, we wouldn't be able to start
any transient units of that type, which seems undesired.
In principle we could reject dropins at the unit level, but I don't think that
is useful. The whole reason for drop-ins is that they are "add ons", and there
isn't any particular reason to disallow them for transient units. It would also
make things harder to implement and describe: one place for drop-ins is good,
but another is bad. (And as a corner case: for instanciated units, a drop-in
in the template would be acceptable, but a instance-specific drop-in bad?)
Thus, $subject.
While at it, adjust the message. All the conditions in unit_is_pristine()
essentially mean that it wasn't loaded (e.g. it might be in an error state),
and that it doesn't have a fragment path (now that drop-ins are acceptable).
If there's a job for it, it necessarilly must have been loaded. If it is
merged into another unit, it also was loaded and found to be an alias.
Based on the discussion in the bugs, it seems that the current message
is far from obvious ;)
Fixes https://github.com/containers/podman/issues/16107,
https://bugzilla.redhat.com/show_bug.cgi?id=
2133792.
Celeste Liu [Sun, 16 Oct 2022 02:47:17 +0000 (10:47 +0800)]
seccomp: add riscv_flush_icache to allow list
This system call is harmless because it only enforces ordering between stores
and instruction cache fetch.
fixed #24991
Related: https://github.com/felixonmars/archriscv-packages/issues/1840
Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
Yu Watanabe [Sat, 15 Oct 2022 00:30:22 +0000 (09:30 +0900)]
udev: drop unused source file
Follow-up for
5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.
Lennart Poettering [Fri, 14 Oct 2022 16:02:31 +0000 (18:02 +0200)]
seccomp: drop per arch conditionalization in filter groups
We list plenty of arch-specific syscalls in our filter groups, treat the
s390 syscalls the same.
We handle gracefully anyway if some syscall doesn't exist locally on the
kernel or arch, let's rely on it. This has the benefit that
"systemd-analyze" will comprehensively tell you the syscalls filtered on
any arch for any arch.
And less conditionalization is good anyway.
Pyfisch [Fri, 14 Oct 2022 19:32:47 +0000 (21:32 +0200)]
Update list of partition type identifiers
Include verity sig partition identifiers.
List all supported CPU architectures.
Pyfisch [Fri, 14 Oct 2022 18:43:16 +0000 (20:43 +0200)]
Document two systemd-repart options in man page
Note --private-key and --certificate options for configuring
verity signature partitions in the listing of options.
Adjust one error message referring to the --certificate option.
Lennart Poettering [Fri, 14 Oct 2022 11:05:37 +0000 (13:05 +0200)]
update TODO
Thomas Blume [Thu, 29 Sep 2022 12:50:48 +0000 (14:50 +0200)]
basic/mountpoint-util: skip dependency on quota services for some filesystems
Luca Boccassi [Fri, 14 Oct 2022 18:56:44 +0000 (20:56 +0200)]
Merge pull request #25002 from poettering/install-type-fix
install: make InstallChangeType enum a proper enum
Anita Zhang [Wed, 5 Oct 2022 08:40:40 +0000 (01:40 -0700)]
core: only allow systemd-oomd to use SubscribeManagedOOMCGroups
Attempt to address
https://github.com/systemd/systemd/issues/20330#issuecomment-
1210028422.
Summary of the comment: Unprivileged users can potentially cause a denial of
service during systemd-oomd unit subscriptions by spamming requests to
SubscribeManagedOOMCGroups. As systemd-oomd.service is the only unit that
should be accessing this method, add a check on the caller's unit name to deter
them from successfully using this method.
Anita Zhang [Wed, 5 Oct 2022 07:13:32 +0000 (00:13 -0700)]
core: serialize/deserialize varlink sockets for pid1
Fixes #20330
Zbigniew Jędrzejewski-Szmek [Fri, 14 Oct 2022 16:29:14 +0000 (18:29 +0200)]
manager: rename dbus method
Fixes #24989.
Yu Watanabe [Fri, 14 Oct 2022 08:18:41 +0000 (17:18 +0900)]
elf-util: drop assertion for metadata in report_module_metadata()
Fixes a bug introduced by
1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a.
Fixes RHBZ#
2134741 (https://bugzilla.redhat.com/show_bug.cgi?id=
2134741).
msizanoen1 [Wed, 12 Oct 2022 06:40:05 +0000 (13:40 +0700)]
shared/logs-show: do not overwrite journal time in export format with source timestamps
Using _SOURCE_{MONOTONIC,REALTIME}_TIMESTAMP in place of the results of
sd_journal_get_{monotonic,realtime}_usecs in export formats might cause
internal inconsistency of realtime timestamp values within a journal export,
violating the export file format and causing systemd-journal-remote to
mass-generate journal files.
Fix this by using the real journal timestamps for
__{REALTIME,MONOTONIC}_TIMESTAMP.
Zbigniew Jędrzejewski-Szmek [Thu, 13 Oct 2022 20:30:48 +0000 (22:30 +0200)]
man: reword some awkward sentences
Zbigniew Jędrzejewski-Szmek [Wed, 12 Oct 2022 15:05:27 +0000 (17:05 +0200)]
NEWS: rework the description of systemd-measure a bit again
Try to separate the description so that changes are described first, and the
discussion follows separately. Remove some repeated verbose descriptions of the
subject: if one sentence describes that UKI contains an signature and describes
it in detail, the next sentence can just say "the signature" without
elaborating. Also, we don't do version-keying yet, so don't say "future"
kernels — older kernels will work too.
Zbigniew Jędrzejewski-Szmek [Fri, 14 Oct 2022 12:40:24 +0000 (14:40 +0200)]
manager: reformat boolean expression in unit_is_pristine()
Not not IN_SET(…) is just too much for my poor brain. Let's invert
the expression to make it easier to undertand.
Yu Watanabe [Fri, 14 Oct 2022 07:18:35 +0000 (16:18 +0900)]
udev-builtin-kmod: support to run without arguments
If no module name is provided, then try to load modules based on the
device modealias.
Previously, MODALIAS property is passed as an argument, but it may
contain quotation. Hence, unfortunately the modalias may be modified
and cannot load expected modules.
Fixes #24715.
Lennart Poettering [Fri, 14 Oct 2022 09:12:19 +0000 (11:12 +0200)]
install: include full type name in special UnitFilePresetMode values
Typically the _MAX and _INVALID special enum values use the full type as
prefix, even if the actual values of the enum might not. Let's follow
this rule here too.
Lennart Poettering [Fri, 14 Oct 2022 09:11:53 +0000 (11:11 +0200)]
install: make InstallChange enum type a proper type
We can just make this an enum, as long as we ensure it has enough range,
which we can do by adding -ERRNO_MAX as one possible value (at least on
GNU C). We already do that at multiple other places, so let's do this
here too.
Lennart Poettering [Fri, 14 Oct 2022 09:32:43 +0000 (11:32 +0200)]
update TODO
Anita Zhang [Wed, 5 Oct 2022 07:12:53 +0000 (00:12 -0700)]
core: refactor manager varlink init
Split out per-socket code into a separate function to use as part of
serialize/deserialize in the next commit.
Anita Zhang [Tue, 11 Oct 2022 09:36:32 +0000 (02:36 -0700)]
varlink: refactor adding socket event source to the event loop
Lubomir Rintel [Thu, 13 Oct 2022 11:49:22 +0000 (13:49 +0200)]
udev/rules: add by-path and by-ibdev links to infiniband verbs
The uverbs devices are sequentially numbered and are not guarranteed to
stay stable across reboot.
At least one good person was disappointed by this, because they couldn't
find their device: https://bugzilla.redhat.com/show_bug.cgi?id=
2036515
Let's add a few helpful links.
Zbigniew Jędrzejewski-Szmek [Thu, 13 Oct 2022 21:17:49 +0000 (23:17 +0200)]
Merge pull request #24461 from keszybz/better-unmask-message
Better unmask message when unit is masked via kernel commandline
Zbigniew Jędrzejewski-Szmek [Fri, 26 Aug 2022 10:02:43 +0000 (12:02 +0200)]
shared/install: print warning when unmasking unit with cmdline mask
'systemctl unmask foo' will try to remove the symlink to /dev/null under /etc/.
But the unit may also be masked by a symlink under /run/generator, in particular
the one created by systemd-debug-generator based on systemd.mask=foo on the
kernel commandline. The unmask call cannot anything about this: even if it removed
the symlink from /run/generator, it'll be recreated on the next daemon-reload.
Thus, we can only warn about it.
Initially, I wanted to check if 'systemctl.mask' is defined on the kernel
command-line, but that's not effective, because such mask symlinks can be
created by other generators based on other conditions. Checking for runtime
mask is "dumber", but is more robust because it doesn't assume who created the
mask and why.
The handling of InstallInfo is the copied from install_info_symlink_wants().
It's pretty ugly, this whole code should be rewritten from scratch.
The message is printed, but the whole operation is still "successful". This
keep backwards compatibility: people might call unmask to remove filesystem
masks even if there's still a cmdline param in place. We allow 'systemctl
mask' to create such a mask, so 'unmask' should be able to remove it.
Fixes #22689.
Zbigniew Jędrzejewski-Szmek [Mon, 29 Aug 2022 08:11:41 +0000 (10:11 +0200)]
shared/install: use cleanup func for InstallInfo*
In the next commit cleanup will be used in one more place. This change
avoids proliferation of the open-coded cleanup calls.
Zbigniew Jędrzejewski-Szmek [Fri, 26 Aug 2022 08:40:17 +0000 (10:40 +0200)]
shared/install: rename 'UnitFileInstallInfo' to 'InstallInfo'
- shorter is better
- name now matches the defining-file name
I was also considering UnitInstallInfo. Can change if people prefer that.
Zbigniew Jędrzejewski-Szmek [Sun, 18 Sep 2022 16:00:41 +0000 (18:00 +0200)]
shared/install: rename 'unit_file_change_type' to 'install_change' + followups
We had an anonymous enum with values called UNIT_FILE_…, which could easily be
confused with UNIT_FILE_… from UnitFileFlags enum. This commit renames the enum
values and also the variables which refer to them.
Zbigniew Jędrzejewski-Szmek [Fri, 26 Aug 2022 08:11:13 +0000 (10:11 +0200)]
shared/install: rename UnitFileInstallInfo.type to .install_mode
Zbigniew Jędrzejewski-Szmek [Fri, 26 Aug 2022 07:52:59 +0000 (09:52 +0200)]
shared/install: rename 'unit file type' to 'install mode'
git grep -l -nwi 'UnitFileType|UNIT_FILE_TYPE' | \
xargs sed -r -i 's/UnitFileType/InstallMode/g; s/UNIT_FILE_TYPE/INSTALL_MODE/g; s/unit_file_type/install_mode/g'
Zbigniew Jędrzejewski-Szmek [Fri, 26 Aug 2022 07:30:01 +0000 (09:30 +0200)]
shared/install: rename UnitFileChange to InstallChange
It's shorter and more generic. The struct can contain info about changes to
unit files, but also symlinks and errors.
Zbigniew Jędrzejewski-Szmek [Wed, 24 Aug 2022 15:23:40 +0000 (17:23 +0200)]
shared/install: rename 'files' param to 'names'
… or 'name_or_path' or 'names_or_paths' as appropriate. Those functions are
generally called with unit names as arguments.
Yu Watanabe [Wed, 12 Oct 2022 06:45:55 +0000 (15:45 +0900)]
sd-journal: use new() instead of newa() if too many items will be added
For safety, as the size may not be under our control.
Yu Watanabe [Thu, 13 Oct 2022 12:36:16 +0000 (21:36 +0900)]
Merge pull request #24985 from yuwata/codeql
test: several cleanups suggested by CodeQL
Yu Watanabe [Thu, 13 Oct 2022 08:41:45 +0000 (17:41 +0900)]
test: introduce __eq__() and __ne__()
Suggested by CodeQL#160 (https://github.com/systemd/systemd/security/code-scanning/160).
Yu Watanabe [Thu, 13 Oct 2022 08:34:08 +0000 (17:34 +0900)]
test: drop unused modules
Suggested by CodeQL#167 (https://github.com/systemd/systemd/security/code-scanning/167)
and CodeQL#168 (https://github.com/systemd/systemd/security/code-scanning/168).
Yu Watanabe [Thu, 13 Oct 2022 08:31:37 +0000 (17:31 +0900)]
test: improve assertion message on failure
Suggested by CodeQL#169 (https://github.com/systemd/systemd/security/code-scanning/169).
Yu Watanabe [Thu, 13 Oct 2022 08:15:50 +0000 (17:15 +0900)]
TODO: fix typo
Lennart Poettering [Thu, 13 Oct 2022 07:47:55 +0000 (09:47 +0200)]
update TODO