1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-27 03:21:32 +03:00
Commit Graph

37988 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
4a84db4c0c shared/install: move scope into InstallContext
This makes it easier to pass it around in preparation for future changes.

While at it, let's rename InstallContext c → ctx, and InstallInfo i → info.
'c' and 'i' are bad names for variables that are passed through multiple layers
of functions calls. It's easier to follow what is happening with a meaningful
variable names.
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
19b9d5d0d1 shared/install: provide proper error messages when invalid specifiers are used
$ build/systemctl --root=/tmp/systemctl-test.KXY8fu enable some-some-link6@.socket
Failed to enable unit, invalid specifier in "target@C:%C.socket".
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
6ec4c852c9 shared/specifier: provide proper error messages when specifiers fail to read files
ENOENT is easily confused with the file that we're working on not being
present, e.g. when the file contains %o or something else that requires
os-release to be present. Let's use -EUNATCH instead to reduce that chances of
confusion if the context of the error is lost.

And once we have pinpointed the reason, let's provide a proper error message:

+ build/systemctl --root=/tmp/systemctl-test.TO7Mcb enable some-some-link6@.socket
/tmp/systemctl-test.TO7Mcb/etc/systemd/system/some-some-link6@.socket: Failed to resolve alias "target@A:%A.socket": Protocol driver not attached
Failed to enable unit, cannot resolve specifiers in "target@A:%A.socket".
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
7962116fc8 shared/specifier: clarify and add test for missing data
In systemd.unit we document that unset fields resolve to "". But we didn't
directly test this, so let's do that. Also, we return -ENOENT if the file
is missing, which we didn't document or test.
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
25407ad2a7 basic/env-file: make load-env-file deduplicate entries with the same key
We generally assume parsing like the shell would do it, so the last value
should win when there are repeats.
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
80e72f80bc test-os-util: add basic tests for os-release parsing 2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
df78419d10 basic: add new variable $SYSTEMD_OS_RELEASE to override location of os-release
The test for the variable is added in test-systemctl-enable because there we
can do it almost for free, and the variable is most likely to be used with
'systemctl enable --root' anyway.
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
367c47c886 tests: add helper for creating tempfiles with content
I put it in tests because I think we're most likely to use it in tests.
If necessary, it can be moved somewhere else later.
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
e75a26d045 shared/install: add a bit more quoting
When we are printing a valid unit name, quoting isn't necessary, because
unit names cannot contain whitespace or other confusing characters. In particular
if the unit name is prefixed by " unit " or something else that clearly
identifies the string as a unit name, quoting would just add unnecessary
noise. But when we're printing paths or invalid names, it's better to add
quotes for clarity.
2022-03-29 16:17:56 +02:00
Zbigniew Jędrzejewski-Szmek
047d37dc3d shared/install: reuse the standard symlink verification subroutine
We save a few lines, but the important thing is that we don't have two
different implementations with slightly different rules used for enablement
and loading. Fixes #22000.

Tested with:
- the report in #22000, it now says:
$ SYSTEMD_LOG_LEVEL=debug systemctl --root=/ enable test.service
Suspicious symlink /etc/systemd/system/test.service→/etc/systemd/system/myown.d/test.service, treating as alias.
unit_file_resolve_symlink: self-alias: /etc/systemd/system/test.service → test.service, ignoring.
running_in_chroot(): Permission denied
Suspicious symlink /etc/systemd/system/test.service→/etc/systemd/system/myown.d/test.service, treating as alias.
unit_file_resolve_symlink: self-alias: /etc/systemd/system/test.service → test.service, ignoring.
Failed to enable unit, refusing to operate on linked unit file test.service

- a symlink to /dev/null:
...
unit_file_resolve_symlink: linked unit file: /etc/systemd/system/test3.service → /dev/null
Failed to enable unit, unit /etc/systemd/system/test3.service is masked.

- the same from the host:
...
unit_file_resolve_symlink: linked unit file: /var/lib/machines/rawhide/etc/systemd/system/test3.service → /var/lib/machines/rawhide/dev/null
Failed to enable unit, unit /var/lib/machines/rawhide/etc/systemd/system/test3.service is masked.

- through the manager:
$ sudo systemctl enable test.service
Failed to enable unit: Refusing to operate on alias name or linked unit file: test.service
$ sudo systemctl enable test3.service
Failed to enable unit: Unit file /etc/systemd/system/test3.service is masked.

As seen in the first example, the warning is repeated. This is because we call
the lookup logic twice: first for sysv-compat, and then again for real. I think
that since this is only for broken setups, and when sysv-compat is enabled, and
in an infrequent manual operation, at debug level, this is OK.
2022-03-29 16:16:02 +02:00
Zbigniew Jędrzejewski-Szmek
48542eac39 basic/stat-util: add null_or_empty_path_with_root() 2022-03-29 15:07:05 +02:00
Luca Boccassi
2350712e32 portable: allow reattaching when one image has a version and the other does not
A reattach might go from img.raw to img_0.1.raw or viceversa, but this is
not allowed right now as we try to match the full name.

Also take into account that running strcspn(a, '/') on an image name, without
leading path, will return the length of the full string, but the versions
might be different so they won't match, eg:

img_0.1.raw -> 12
img_0.1.1.raw -> 14

So adjust the check to take that into account, and skip it if we are not
dealing with directories
2022-03-29 14:02:48 +01:00
Zbigniew Jędrzejewski-Szmek
9825181143 basic/unit-file: split out the subroutine for symlink verification
The old logs used __func__, but this doesn't make sense now, because the
low-level function will be used in other places. So those are adjusted to be
more generic.
2022-03-29 14:19:28 +02:00
Yu Watanabe
f777e745a7 udev: do not call sd_event_source_disable_unref() in workers for event sources created by the main process
Fixes a bug introduced by 9612da361a.
2022-03-29 10:29:44 +02:00
Yu Watanabe
8166950763 inotify-util: fix wrong warnings in FOREACH_INOTIFY_EVENT()
Follow-up for 00adc340bb.

This fixes the wrong "Received invalid inotify event, ignoring." warnings
caused by the missing curly brackets and the priorities of `&&` and `?:`.

This also replaces the ternary operators with `||`.
2022-03-29 13:20:16 +09:00
Franck Bui
6d39da79c8 build: include status of TPM2 in the feature string show by --version 2022-03-29 05:20:20 +09:00
Yu Watanabe
2afb2f4a9d
Merge pull request #22885 from poettering/kill-clock-boottime-or-monotonic
time-util: assume CLOCK_BOOTTIME always exists
2022-03-29 03:06:54 +09:00
Gaël PORTAY
f3b3cab2f2
veritysetup: fix typo (#22886) 2022-03-29 02:09:36 +09:00
Yu Watanabe
288bd40620 fix typo 2022-03-29 01:21:51 +09:00
Lennart Poettering
ba4e0427e9 time-util: assume CLOCK_BOOTTIME always exists
Let's raise our supported baseline a bit: CLOCK_BOOTTIME started to work
with timerfd in kernel 3.15 (i.e. back in 2014), let's require support
for it now.

This will raise our baseline only modestly from 3.13 → 3.15.
2022-03-28 16:55:41 +02:00
Yu Watanabe
ec4954d934 network: rename netdev kind virtual-wlan -> wlan
The Kind= setting in [Match] section of .network files takes "wlan".
This makes the same setting in .netdev files matches the one in .network
files.
2022-03-28 23:53:12 +09:00
Lennart Poettering
af9ae75026 bootspec: normalize function names/parameter lists
This normalizes naming of functions operating on BootConfig objects.
Let's always call them boot_config_xyz(), like our usual way to name
stuff.

moreover, move the BootConfig parameter to the beginning, as it's not a
return value (which we typically move to the end of the parameter list),
but simply an object, that even happens to be initialized already.

With these changes the functions are more like our usual way to call
things, and less surprises are good.
2022-03-28 16:02:15 +02:00
Lennart Poettering
3f8e42c038 bootspec: don't needlessly inline boot_config_find_entry()
the function contains a loop and if expressions and whatnot. Let's
define it as regular function, to make the header easier to read and let
the compiler more freedom on whether to inline this or not.
2022-03-28 16:01:58 +02:00
Lennart Poettering
d412691a91 bootctl: use boot_config_default_entry() where appropriate 2022-03-28 16:01:54 +02:00
Lennart Poettering
f7a7a5e267 bootspec: assess default/selected entries *after* we augmented entry list with entries from loader
Fixes: #22580
2022-03-28 16:01:36 +02:00
Lennart Poettering
92067ab672 bootspec: normalize oom handling in boot_load_efi_entry_pointers()
OOM should usually be fatal, hence make it so here, too.
2022-03-28 16:01:32 +02:00
Lennart Poettering
85e17916d3 bootspec: rename type1 parsers to say "type1" explicitly in the name
This just got too confusing for me. With this change we'll now have
_unified as common suffix for stuff loading unified kernels (i.e. type
1), and _type1 as common suffix for type1 entries.

Just some renaming.
2022-03-28 16:01:28 +02:00
Lennart Poettering
d486a0eaaa bootspec: try harder to suppress duplicate enumerated entries
For testing purposes I run one of my system symlinking /boot/loader/ to
/efi/loader/. This triggers annoying behaviour in boot entry
enumeration: the code ends up iterating through the 'entries' subdir of
both, thinking one was actually in the ESP and the other in XBOOTLDR,
and thus distinct. This would result in duplicate entries.

Let's address that, and filter out duplicates via their inode numbers:
never process the same inode twice. This should protect us from any
confusion effectively, regardless which inodes are symlinked (or even
bind mounted).
2022-03-28 16:01:10 +02:00
Lennart Poettering
85f4ae2f50 bootspec: pass around BootConfig struct instead of entries/n_entries fields only
This simplifies the parameter lists quite a bit, at zero change in
behaviour.
2022-03-28 16:01:06 +02:00
Lennart Poettering
d04f033111 bootspec: don't use conf_files_list() for finding type #1 entries
We can't really use conf_files_list() for finding type #1 entries, since
it is case-sensitive, but type #1 entries are typically placed on VFAT,
i.e. are case-insensitive.

hence, use readdir_all() instead, which is quite similar, but gives us
all files, and allows us to do a case-insensitive check.

While we are at it, use openat() on the open dir to open the file, and
pass that around, to make things a tiny bit more race-free.
2022-03-28 16:01:02 +02:00
Lennart Poettering
0d1506d4a8 bootctl: optionally, output entries in JSON format
Replaces: #18387
Fixes: #18094
2022-03-28 16:00:25 +02:00
наб
53350c7bba Use new default-user-shell option instead of hard-coding bash in nspawn and user-record
Defaults to /bin/bash, no changes in the default configuration

The fallback shell for non-root users is as-specified,
and the interactive shell for nspawn sessions is started as
  exec(default-user-shell, "-" + basename(default-user-shell), ...)
before falling through to bash and sh
2022-03-28 14:24:46 +02:00
Romain Naour
608c3b0293 missing-syscall: define MOVE_MOUNT_T_EMPTY_PATH if missing
MOVE_MOUNT_T_EMPTY_PATH has been added to systemd 250 by [1]
but it's defined in kernel headers since version 5.2.

[1] c7bf079bbc
2022-03-28 16:37:59 +09:00
Luca Boccassi
d13ce742e1
Merge pull request #22834 from yuwata/network-sriov-request-queue
network: sriov: use request queue
2022-03-26 19:12:42 +00:00
Luca Boccassi
6b72105a78 portable: clarify error when detach fails to match to existing unit
Clarify that it's looking at attached units, not at units inside the referenced
image. Also take into account extensions.
2022-03-26 11:20:39 +00:00
Xiaotian Wu
0172289348 basic: update the Arch tuples for LoongArch 2022-03-26 00:29:38 +09:00
Yu Watanabe
dd2396f20d
Merge pull request #22861 from poettering/journald-sigterm
journald: don't let SIGTERM starve indefinitely
2022-03-26 00:27:47 +09:00
Daan De Meyer
e5531be27b
Merge pull request #22857 from poettering/journal-file-flags
journal: add flags param to journal_file_open(), replacing bools
2022-03-25 10:16:12 +01:00
Lennart Poettering
47f04c2a69 journal-file: if we are going down, don't use event loop to schedule post
The event loop is already shutting down, hence no point in using it
anymore, it's not going to run any further iteration.
2022-03-25 10:03:00 +01:00
Lennart Poettering
19252b2548 journald: make sure SIGTERM handling doesn't get starved out
Fixes: #22642
2022-03-25 10:03:00 +01:00
Lennart Poettering
e540c5a621 journal: don't talk about -1 in context of unsigned values 2022-03-25 09:59:09 +01:00
Lennart Poettering
49615dbd81 journal-file: merge compress/seal bool args into a single flags param
Just some modernization/refactoring.

No change in behaviour, just let's do how we do things these days: use
flags param instead of list of bools.
2022-03-25 09:59:09 +01:00
Lennart Poettering
6fb57abcfa
Merge pull request #22717 from yuwata/udev-lock-block-device-by-main-process
udev: do not skip events when device is already locked
2022-03-25 09:43:12 +01:00
Lennart Poettering
a35420d85d journal-remote: constify a few parameters 2022-03-25 09:21:38 +01:00
Lennart Poettering
88a19c7e04
Merge pull request #22859 from poettering/hardware-rename
machine-info: rename VENDOR=/MODEL= → HARDWARE_VENDOR=/HARDWARE_MODEL=
2022-03-25 09:12:14 +01:00
Benjamin Berg
c2b42ec413 xdg-autostart-service: Fix binary escaping and simplify code a bit
Instead of escaping each component separately, we can instead use
quote_command_line. Doing so simplifies the code and fixes an issue
where spaces inside the executable name were not escaped.

Co-Authored-By: David Edmundson <kde@davidedmundson.co.uk>
2022-03-25 14:50:41 +09:00
Yu Watanabe
8603a229e9 efi-loader: drop harmful assertion
This fixes a bug introduced by 7be4b23649.

The function `efi_loader_get_device_part_uuid()` handles NULL
gracefully, and it is called with NULL in gpt-auto-generator.

Fixes #22862.
2022-03-25 14:29:44 +09:00
Yu Watanabe
82a5de9fd2 udev: assume block device is not locked when a new event is queued
Then, hopefully, previously requeued events are processed earlier.
2022-03-25 10:28:07 +09:00
Yu Watanabe
7b7959fba5 udev: split worker_lock_block_device() into two
This also makes return value initialized when these function return 0 to
follow our coding style.

Just a preparation for later commits.
2022-03-25 10:28:07 +09:00
Yu Watanabe
5d354e525a udev: requeue event when the corresponding block device is locked by another process
Previously, if a block device is locked by another process, then the
corresponding worker skip to process the corresponding event, and does
not broadcast the uevent to libudev listners. This causes several issues:

- During a period of a device being locked by a process, if a user trigger
  an event with `udevadm trigger --settle`, then it never returned.

- When there is a delay between close and unlock in a process, then the
  synthesized events triggered by inotify may not be processed. This can
  happens easily by wrapping mkfs with flock. This causes severe issues
  e.g. new devlinks are not created, or old devlinks are not removed.

This commit makes events are requeued with a tiny delay when the corresponding
block devices are locked by other processes. With this way, the triggered
uevent may be delayed but is always processed by udevd. Hence, the above
issues can be solved. Also, it is not necessary to watch a block device
unconditionally when it is already locked. Hence, the logic is dropped.
2022-03-25 10:28:03 +09:00
Yu Watanabe
0c3d8182c9 udev: store action in struct Event 2022-03-25 10:25:27 +09:00
Yu Watanabe
c17ab900cb udev: introduce device_broadcast() helper function 2022-03-25 10:25:26 +09:00
Yu Watanabe
c9473aaa5b udev: drop unnecessary clone of received sd-device object
As the sd-device object received through sd-device-monitor is sealed,
so the corresponding udev database or uevent file will not be read.
2022-03-25 10:25:26 +09:00
Yu Watanabe
00adc340bb inotify-util: declare iterator in FOREACH_INOTIFY_EVENT()
This also makes the macro check if the event is actually in the buffer,
and if it is not, then log about that and finish the loop.
2022-03-24 23:12:34 +00:00
Lennart Poettering
38639aa28f hostnamed: properly reset hw model/vendor props before re-reading them
Follow-up for 4fc7e4f374
2022-03-24 21:29:13 +01:00
Lennart Poettering
0924ea2b26 machine-info: rename VENDOR=/MODEL= → HARDWARE_VENDOR=/HARDWARE_MODEL=
Let's be more precise here. Otherwise people might think this describes
the software system or so. We already expose this via hostnamed as
HardwareVendor/HardwareModel hence use the exact same wording.

(Note that the relevant props on the dmi device are just VENDOR/MODEL,
but that's OK given that DMI really is about hardware anyway,
unconditionally, hence no chance of confusion there.)

Follow-up for 4fc7e4f374
2022-03-24 21:29:13 +01:00
Lennart Poettering
3824ce0522
Merge pull request #22840 from poettering/efivars-tweaks
util-lib: efi variable access refactorings
2022-03-24 18:39:46 +01:00
Yu Watanabe
c02fb80479 udev: try to reload selinux label database less frequently
Previously, `event_run()` was called repeatedly in one `event_queue_start()`
invocation. Hence, the SELinux label database is reloaded many times needlessly.
Other settings, e.g. udev rules or hwdata, are tried to be reloaded in the
beginning of `event_queue_start()`. Let's also do so for the SELinux database.
2022-03-24 16:20:42 +01:00
Yu Watanabe
2d40f02ee4 udev: assume there is no blocker when failed to check event dependencies
Previously, if udevd failed to resolve event dependency, the event is
ignored and libudev listeners did not receive the event. This is
inconsistent with the case when a worker failed to process a event,
in that case, the original uevent sent by the kernel is broadcasted to
listeners.
2022-03-24 16:20:32 +01:00
Yu Watanabe
ef400c3878 udev: only ignore ENOENT or friends which suggest the block device is not exist
The ENOENT, ENXIO, and ENODEV error can happen easily when a block
device appears and soon removed. So, it is reasonable to ignore the
error. But other errors should not occur here, and hence let's handle
them as critical.
2022-03-24 16:20:08 +01:00
Lennart Poettering
3f2ada89f3 errno-util: add ERRNO_IS_DEVICE_ABSENT() macro
Inspired by: https://github.com/systemd/systemd/pull/22717#discussion_r834254495
2022-03-24 16:19:48 +01:00
Yu Watanabe
4029328014 udev: remove /run/udev/queue in on_post()
When the last queued event is processed, information about subsequent
events may be already queued in the netlink socket of sd-device-monitor.
In that case, previously we once removed /run/udev/queue and touch the
file soon later, and `udevadm settle` mistakenly considered all events
are processed.

To mitigate such situation, this makes /run/udev/queue removed in on_post().
2022-03-24 16:19:36 +01:00
Yu Watanabe
9612da361a udev: use sd_event_source_disable_unref()
This should not change any behavior, as the event sources are not
shared. Just for safety.
2022-03-24 16:19:20 +01:00
Yu Watanabe
87afc766d1 udev: update comment and log message 2022-03-24 16:19:05 +01:00
Lennart Poettering
7be4b23649 efi-loader: split efi-api.[ch] from efi-loader.[ch]
Some refactoring: split efi-loader.[ch] in two: isolate the calls that
implement out boot loader interface spec, and those which implement
access to upstream UEFI firmware features.

They are quite different in nature and behaviour, and even semantically
it makes to keep these two separate. At the very least because the
previous name "efi-loader.[ch]" suggests all was about loader-specific
APIs, but much of it is generic uefi stuff...

While we are at it, I renamed a bunch of return parameters to follow our
usual ret_xyz naming. But besides renaming no real code changes.
2022-03-24 15:21:09 +01:00
Lennart Poettering
8fc5c44426 efivars: define efi variable flags less weirdly
The flags are actually 32bit values, but aligned with zeroes befitting a
64bit value. Let's fix that.
2022-03-24 15:21:03 +01:00
Lennart Poettering
187513fd3a efivarfs: rename a couple of return params to ret_xyz/ret 2022-03-24 15:20:57 +01:00
Lennart Poettering
afd1a45a16 efivars: downgrade log level in systemd_efi_options_efivarfs_if_newer()
The only caller logs anyway, let's avoid duplicate logging above
LOG_DEBUG.
2022-03-24 15:20:53 +01:00
Lennart Poettering
83fe0be170 efivars: no need to convert ENOENT → ENODATA twice
read_efi_options_variable() already does this, don#t do it again.
2022-03-24 15:20:49 +01:00
Lennart Poettering
bc5eb90015 efivars: tweak debug log message in efi_get_secure_boot_mode()
mention what we'll do as effect of the error we are seeing and eat up.
2022-03-24 15:20:45 +01:00
Lennart Poettering
3e09ad57c6 efivars: cache ENOENT as no efi secure boot
On systems lacking EFI or the SecureBoot efi var the caching of this
info didn#t work, since we'd see ENOENT when reading the var, and cache
that, which we then use as reason to retry next time.

Let's fix that and convert ENOENT to "secure boot", because that's what
it really means. All other errors are left as is (and reason to retry).
But let's add some debug logging for that case.
2022-03-24 15:18:52 +01:00
Lennart Poettering
d01133125c bpf-firewall: invert test
Following our coding style of exiting early (instead of deep nesting),
let's invert the if check here.

Inspired by: https://github.com/systemd/systemd/pull/21602#pullrequestreview-919960060
2022-03-24 13:54:50 +01:00
David Tardon
bbd2620022 logind-user: log about the right unit 2022-03-24 13:53:31 +01:00
Yu Watanabe
f7adeaeb89 journal-remote: refuse to specify --trust option when gnutls is disabled
and check_permission() should not be called in that case.

Replaces #22847.
2022-03-24 13:53:04 +01:00
Antonio Alvarez Feijoo
7500c6cbef cryptsetup: fix typo 2022-03-24 12:08:54 +00:00
Yu Watanabe
bc7a6ee4af
Merge pull request #22800 from poettering/safe-ptr-sub1
Add helper macro PTR_SUB1() to deal with backwards iteration through arrays without UB
2022-03-24 06:34:09 +09:00
Yu Watanabe
2859932bd6 network: do not enable IPv4 ACD for IPv4 link-local address if ACD is disabled explicitly
The commit 1cf4ed142d makes the IPv4 ACD
enabled unconditionally for IPv4 link-local addresses even if users
explicitly disable ACD.

This makes the IPv4 ACD is enabled by default, but honor user setting.

Fixes #22763.
2022-03-23 17:59:38 +01:00
Yu Watanabe
007950dcd1 dns-domain: use PTR_SUB1() macro 2022-03-23 21:57:59 +09:00
Yu Watanabe
93e04eb43b test: add tests for device id 2022-03-23 21:57:39 +09:00
Yu Watanabe
13659527ef sd-device: use path_find_last_component() to set driver subsystem 2022-03-23 21:57:39 +09:00
Yu Watanabe
3066293dd3 path-util: use PTR_SUB1() macro in path_find_last_component() 2022-03-23 21:57:39 +09:00
Yu Watanabe
e7bf2fcab0 core/namespace: inline one more iterator variable 2022-03-23 21:57:39 +09:00
Lennart Poettering
3e3ee42072 tree-wide: use PTR_SUB1() at two places where appropriate 2022-03-23 21:57:25 +09:00
Lennart Poettering
50996f04ad macro: add macro that simplifies going backwards through an array via pointers
Inspired by #22797, let's avoid some UB when iterating through arrays.
2022-03-23 21:46:08 +09:00
Zbigniew Jędrzejewski-Szmek
4053d11006 various: inline some iterator variables 2022-03-23 21:46:05 +09:00
Yu Watanabe
904447ce5a
Merge pull request #22835 from keszybz/foreach_string-inline-iterator
Inline the iterator declaration in FOREACH_STRING
2022-03-23 21:43:02 +09:00
Zbigniew Jędrzejewski-Szmek
b9fbff7403 systemctl: use the right name in error message 2022-03-23 11:50:18 +01:00
Zbigniew Jędrzejewski-Szmek
5980d46304 strv: declare iterator of FOREACH_STRING() in the loop
Same idea as 03677889f0.

No functional change intended. The type of the iterator is generally changed to
be 'const char*' instead of 'char*'. Despite the type commonly used, modifying
the string was not allowed.

I adjusted the naming of some short variables for clarity and reduced the scope
of some variable declarations in code that was being touched anyway.
2022-03-23 11:50:18 +01:00
Lennart Poettering
24f0c62df5
Merge pull request #22791 from keszybz/bootctl-invert-order
Invert order of entries w/o sort-key in sd-boot menu
2022-03-23 11:39:31 +01:00
Lennart Poettering
5b39139582
Merge pull request #22629 from nishalkulkarni/oomd_service_result
core/oomd: Use oom-kill ServiceResult for oomd
2022-03-23 10:11:45 +01:00
Yu Watanabe
7a692931ab sysupdate: fix error handling 2022-03-23 16:52:55 +09:00
Yu Watanabe
cb8453cc51 network: sriov: use request queue to configure SR-IOV virtual functions 2022-03-23 16:48:36 +09:00
Yu Watanabe
bee8fc36f4 sriov: introduce sr_iov_hash_func() and sr_iov_compare_func() 2022-03-23 16:32:51 +09:00
Yu Watanabe
ff8619791a boot: fix typo 2022-03-23 12:21:54 +09:00
Lennart Poettering
4d5dacbef3 fs-util: make sure openat_report_new() initializes return param also on shortcut
Our coding style dictates that return parameters should be initialized
always on success, hence do so here also in the shortcut codepath.

Issue discovered by @fbuihuu:

ca8503f168 (r831911069)
2022-03-23 11:38:08 +09:00
Lennart Poettering
b312236919 fs-util: fix typos in comments 2022-03-23 11:38:08 +09:00
Yu Watanabe
14acae357b
Merge pull request #22825 from keszybz/assorted-cleanups
Assorted cleanups
2022-03-23 11:34:46 +09:00
Luca Boccassi
961758c750
Merge pull request #22821 from poettering/udev-tweaklets
Udev tweaklets
2022-03-22 20:17:38 +00:00
Zbigniew Jędrzejewski-Szmek
5cad4c70e3 homework: s/EWOULDBLOCK/EAGAIN/
C.f. 012d7b4217, ff55c3c732,
ca2031fcc8.
2022-03-22 14:07:53 +01:00
Zbigniew Jędrzejewski-Szmek
16568fd336 errno-to-awk: simplify expression
No functional change.
2022-03-22 14:07:53 +01:00