Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2023 17:10:42 +0000 (11:10 -0600)]
basic/utf8: make utf8_encoded_to_unichar() return length of the codepoint
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2023 16:28:08 +0000 (10:28 -0600)]
journal-remote: fix syntax in error message
Prompted by
2411e990a480affe30bd99a2a33ab6b94a3fe5dd.
Antonio Alvarez Feijoo [Fri, 23 Jun 2023 14:34:55 +0000 (16:34 +0200)]
man: fix references to gethostname/sethostname
Lennart Poettering [Fri, 23 Jun 2023 13:23:09 +0000 (15:23 +0200)]
update TODO
Frantisek Sumsal [Fri, 23 Jun 2023 11:08:57 +0000 (13:08 +0200)]
tree-wide: use https for the 0pointer.de doc links
Lennart Poettering [Thu, 22 Jun 2023 20:26:23 +0000 (22:26 +0200)]
resolved: if ipv6 is off patch hostname→address query with unspec family to ipv4
If the client never specified the address family, and IPv6 is off in the
kernel, then look only for A, never for AAAA RRs.
Fixes: #23951
Luca Boccassi [Fri, 23 Jun 2023 12:24:41 +0000 (13:24 +0100)]
Merge pull request #28123 from poettering/threads-no-more
get rid of any threads in PID 1
Romain Geissler [Thu, 22 Jun 2023 16:05:18 +0000 (16:05 +0000)]
elf-util: check for overflow when computing end of core's PT_LOAD segments
Luca Boccassi [Fri, 23 Jun 2023 11:28:40 +0000 (12:28 +0100)]
Merge pull request #28127 from poettering/coredump-loop-read
coredump: fixes with overly large coredumps
Lennart Poettering [Thu, 22 Jun 2023 20:24:30 +0000 (22:24 +0200)]
basic: drop unused include
Lennart Poettering [Thu, 22 Jun 2023 20:24:04 +0000 (22:24 +0200)]
process-util: add simple wrapper around PR_SET_CHILD_SUBREAPER
Let's a simple helper that knows how to deal with PID == 1.
Lennart Poettering [Thu, 22 Jun 2023 09:53:16 +0000 (11:53 +0200)]
docs: document threading situation in coding style
Lennart Poettering [Thu, 22 Jun 2023 13:11:52 +0000 (15:11 +0200)]
async: use FORK_DETACH for asynchronous syncs
To get proper "fire-and-forget" feeling we really want to make sure
noone has to reap the forked off process.
Lennart Poettering [Thu, 22 Jun 2023 13:09:50 +0000 (15:09 +0200)]
async: add explanatory comment
Lennart Poettering [Thu, 22 Jun 2023 10:04:46 +0000 (12:04 +0200)]
async: drop the now unused asynchronous_job()
Lennart Poettering [Thu, 22 Jun 2023 09:55:59 +0000 (11:55 +0200)]
async: add generic implementation of asynchronous_rm_rf()
This one doesn't use threads anymore. This is the last use of threads in
PID 1. Yay!
Fixes: #27287
Lennart Poettering [Thu, 22 Jun 2023 09:54:51 +0000 (11:54 +0200)]
shared: move async.[ch] from src/basic/ → src/shared/
That way we can later add an async wrapper for rm_rf() which is in
src/shared/, too.
Lennart Poettering [Thu, 22 Jun 2023 09:51:25 +0000 (11:51 +0200)]
process-util: add FORK_DETACH flag for forking of detached child
A test for this is later added indirectly, via aynchronous_rm_rf() that
uses this and comes with a suitable test.
Lennart Poettering [Thu, 22 Jun 2023 08:57:31 +0000 (10:57 +0200)]
automont: rework expiry to use subprocess rather than thread
One more step towards a thread-free PID1: let's do automount expiry in a
subprocess rather than a thread.
Lennart Poettering [Thu, 22 Jun 2023 08:21:32 +0000 (10:21 +0200)]
basic: add comments about raw_clone() calls not supporting threads/malloc in child
Lennart Poettering [Thu, 22 Jun 2023 08:28:13 +0000 (10:28 +0200)]
async: stop using threads for asynchronous_close()
Let's work towards PID1 being purely single threaded again. Let's rework
asynchronous_close() on top of clone() with CLONE_FILES (so that we
can manipulate PID1's fd table correctly).
One less use of pthread_create() in PID 1.
Lennart Poettering [Thu, 22 Jun 2023 08:27:17 +0000 (10:27 +0200)]
process-util: add clone_with_nested_stack() helper
This wraps glibc's clone() but deals with the 'stack' parameter in a
sensible way. Only supports invocations without CLONE_VM, i.e. when
child is a CoW copy of parent.
Lennart Poettering [Thu, 22 Jun 2023 09:52:06 +0000 (11:52 +0200)]
process-util: add helper that detects if we are a reaper process
Lennart Poettering [Fri, 23 Jun 2023 07:53:21 +0000 (09:53 +0200)]
Merge pull request #28129 from poettering/userdb-ratelimit
userdbd: make sure we don't exit under pressure
Lennart Poettering [Thu, 22 Jun 2023 15:10:14 +0000 (17:10 +0200)]
man: correct and extend JournalSizeMax=
The man page claimed the default was 10M, but that's not true, it's
767M.
Also mention there's no point in increasing it further.
See: #26748
Lennart Poettering [Thu, 22 Jun 2023 15:11:00 +0000 (17:11 +0200)]
coredump: clamp JournalSizeMax= to maximum journald would accept
See: #26748
Lennart Poettering [Thu, 22 Jun 2023 14:48:48 +0000 (16:48 +0200)]
coredump: use loop_read() for reading coredump into memory
Fixes: #26748
Lennart Poettering [Thu, 22 Jun 2023 14:26:15 +0000 (16:26 +0200)]
tpm2-util: look for tpm2-pcr-signature.json directly in /.extra/
So far we relied on tmpfiles.d to copy tpm2-pcr-signature.json from
/.extra/ into /run/systemd/. This is racy however if cryptsetup runs too
early, and we cannot unconditionally run it after tmpfiles completed.
hence, let's teach cryptsetup to directly look for the file in /.extra/,
in order to simplify this, and remove the race. But do so only in the
initrd (as only there /.extra/ is a concept).
We generally prefer looking in /run/systemd/, since things are under
user control then. In the regular system we exclusively want that
userspace looks there.
Fixes: #26490
Lennart Poettering [Mon, 10 Aug 2020 14:33:02 +0000 (16:33 +0200)]
tree-wide: getpid() → getpid_cached()
This doesn't really matter, but let's be systematic and prefer
getpid_cached() in our codebase.
Lennart Poettering [Thu, 22 Jun 2023 16:51:34 +0000 (18:51 +0200)]
userdbd: when we hit a flood of requests to start more workers, don't exit
Let's tweak what we do if we detect a flood of requests to start more
workers: if none of the workers ever sticks (i.e. the worker count is
zero) then let's just give up, as before.
Otherwise, let's just not start more workers for a while, and do so
again after a while. Thus spawning ofr workers will "cool off" for a
while.
Fixes: #27028
Lennart Poettering [Thu, 22 Jun 2023 16:50:43 +0000 (18:50 +0200)]
userdbd: prefix parameters with their names more
Lennart Poettering [Thu, 22 Jun 2023 16:48:41 +0000 (18:48 +0200)]
userdbd: drastically raise ratelimit we apply on requests for more worker processes
These requests might come in during lookup floods very quickly, since
multiple worker processes might detect that things should be scaled up
at the same time. Hence, let's substantially raise the limit so that it
doesn't get hit in real-life scenarios and acts more like a safety net.
Yu Watanabe [Fri, 16 Jun 2023 01:38:25 +0000 (10:38 +0900)]
meson: merge two similar loops for unit files
This also merges two arrays units and in_units, and uses dictionary
for declaring units.
This also fixes the condition handling, that previously only two
conditions were handled and rests were ignored.
Lennart Poettering [Thu, 22 Jun 2023 14:10:06 +0000 (16:10 +0200)]
docs: describe $TESTFUNCS briefly
Follow-up for
f1a83e41ae985bd17056b3a9fe285cc196358183
Lennart Poettering [Wed, 21 Jun 2023 13:02:59 +0000 (15:02 +0200)]
tests: teach tests boilerplate to run selected tests only
sometimes its useful to only run a specific test (or multiple) instead
of all implemented in a test. Allow the test name(s) to be specified on the
in a $TESTFUNCS env var, separated by colons.
Lennart Poettering [Thu, 22 Jun 2023 14:07:35 +0000 (16:07 +0200)]
Merge pull request #28104 from DaanDeMeyer/emergency-kexec-halt
core: Add halt and kexec emergency actions
Daan De Meyer [Wed, 21 Jun 2023 11:17:01 +0000 (13:17 +0200)]
hwdb: Don't generate hwdb if no hwdb files are found
Lennart Poettering [Wed, 21 Jun 2023 08:53:24 +0000 (10:53 +0200)]
core: restrict ImportCredential= globbing
Let's restrict how we apply credential globbing in ImportCredential=, so
that we have some flexibility in automatically extending the glob
expression with per-instance data eventually without getting into
conflict with the globbing parts.
In our current uses we only allow globbing at the end of the expression,
and this is a new, unreleased feature hence let's be restrictive on this
initially. We can still relax this later if we feel the need to after
all.
Fixes: #28022
Lennart Poettering [Thu, 22 Jun 2023 10:38:57 +0000 (12:38 +0200)]
pid1: use FORK_DEATHSIG where appropriate
Jan Luebbe [Thu, 22 Jun 2023 10:59:33 +0000 (12:59 +0200)]
man: correct reference to sd_id128_get_boot_app_specific
The function sd_id128_get_boot_app_specific is the app specific variant of
sd_id128_get_boot.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Daan De Meyer [Thu, 22 Jun 2023 09:49:36 +0000 (11:49 +0200)]
Merge pull request #28115 from yuwata/meson-tiny-fixes
meson: several tiny fixes
Daan De Meyer [Thu, 22 Jun 2023 09:33:18 +0000 (10:33 +0100)]
units: Use built-in halt and kexec features instead of systemctl
Daan De Meyer [Wed, 21 Jun 2023 09:59:27 +0000 (11:59 +0200)]
core: Add halt and kexec emergency actions
Let's complete the picture by adding the missing halt and kexec
emergency actions.
Lennart Poettering [Thu, 22 Jun 2023 08:29:50 +0000 (10:29 +0200)]
sleep-util: mention that offset is in memory pages
Franck Bui [Wed, 21 Jun 2023 08:32:57 +0000 (10:32 +0200)]
rpm: fix lua trigger priority for sysusers
Commit
cd621954ed643c6ee0d869132293e26056a48826 probably forgot to fix the lua
implementation.
Yu Watanabe [Mon, 19 Jun 2023 23:20:12 +0000 (08:20 +0900)]
meson: fix test dependency
Follow-up for
daf4e78e4841a527ba62da48fd00e2e6b8805193.
Yu Watanabe [Mon, 19 Jun 2023 23:06:43 +0000 (08:06 +0900)]
meson: shorten code a bit
Yu Watanabe [Mon, 19 Jun 2023 21:28:56 +0000 (06:28 +0900)]
meson: drop wrong and redundant assignment
Follow-up for
b62ee354dd68349812f0526622c4e164b4a89f5f.
Yu Watanabe [Mon, 19 Jun 2023 21:08:17 +0000 (06:08 +0900)]
meson: also build symbol tests for static-libsystemd=no-pic
Yu Watanabe [Mon, 19 Jun 2023 21:05:53 +0000 (06:05 +0900)]
meson: add dependency for udev runner to test
Yu Watanabe [Tue, 16 May 2023 18:29:23 +0000 (03:29 +0900)]
sd-journal: verify journal file header in more detail
Fixes #27635.
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jun 2023 07:47:00 +0000 (09:47 +0200)]
pam: add macro wrapper to make code shorter
The same pattern is repeated so many times that it seems worth making a
shorthand for it.
Follow-up for
f71b55b51075e7ce42fa0ad4ae5569ba1aea6ee2 and
2675747f3cdd6f1e6236bbb2f79abfa53fb307f1.
Luca Boccassi [Wed, 21 Jun 2023 23:46:06 +0000 (00:46 +0100)]
Merge pull request #28109 from mrc0mmand/more-journal-shenanigans
test: cover a couple of missed code paths in journalctl/journald
Ronan Pigott [Wed, 21 Jun 2023 02:47:47 +0000 (19:47 -0700)]
systemd-analyze: allow --quiet for condition checks
I figure these messages are rather unnecessary, so let the user quiet
them with the existing --quiet flag if desired. Makes systemd-analyze
condition a little more ergonomic in scripts.
Romain Geissler [Tue, 20 Jun 2023 16:06:31 +0000 (16:06 +0000)]
elf-util: discard PT_LOAD segment early based on the start address.
Indeed when iterating over all the PT_LOAD segment of the core dump
while trying to look for the elf headers of a given module, we iterate
over them all and try to use the first one for which we can parse a
package metadata, but the start address is never taken into account,
so absolutely nothing guarantees we actually parse the right ELF header
of the right module we are currently iterating on.
This was tested like this:
- Create a core dump using sleep on a fedora 37 container, with an
explicit LD_PRELOAD of a library having a valid package metadata:
podman run -t -i --rm -v $(pwd):$(pwd) -w $(pwd) fedora:37 bash -x -c \
'LD_PRELOAD=libreadline.so.8 sleep 1000 & SLEEP_PID="$!" && sleep 1 && kill -11 "${SLEEP_PID}" && mv "core.${SLEEP_PID}" the-core'
- Then from a fedora 38 container with systemd installed, the resulting
core dump has been passed to systemd-coredump with and without this
patch. Without this patch, we get:
Module /usr/bin/sleep from rpm bash-5.2.15-3.fc38.x86_64
Module /usr/lib64/libtinfo.so.6.3 from rpm coreutils-9.1-8.fc37.x86_64
Module /usr/lib64/libc.so.6 from rpm coreutils-9.1-8.fc37.x86_64
Module /usr/lib64/libreadline.so.8.2 from rpm coreutils-9.1-8.fc37.x86_64
Module /usr/lib64/ld-linux-x86-64.so.2 from rpm coreutils-9.1-8.fc37.x86_64
While with this patch we get:
Module /usr/bin/sleep from rpm bash-5.2.15-3.fc38.x86_64
Module /usr/lib64/libtinfo.so.6.3 from rpm ncurses-6.3-5.
20220501.fc37.x86_64
Module /usr/lib64/libreadline.so.8.2 from rpm readline-8.2-2.fc37.x86_64
So the parsed package metadata reported by systemd-coredump when the module
files are not found on the host (ie the case of crash inside a container) are
now correct. The inconsistency of the first module in the above example
(sleep is indeed not provided by the bash package) can be ignored as it
is a consequence of how this was tested.
In addition to this, this also fixes the performance issue of
systemd-coredump in case of the crashing process uses a large number of
shared libraries and having no package metadata, as reported in
https://sourceware.org/pipermail/elfutils-devel/2023q2/006225.html.
Daan De Meyer [Wed, 21 Jun 2023 15:24:39 +0000 (17:24 +0200)]
Merge pull request #27942 from DaanDeMeyer/root-ephemeral
core: Add RootEphemeral= setting
Frantisek Sumsal [Wed, 21 Jun 2023 11:14:54 +0000 (13:14 +0200)]
test: cover a couple of missed code paths in journalctl/journald
Daan De Meyer [Tue, 20 Jun 2023 11:54:07 +0000 (13:54 +0200)]
test: Add RootEphemeral= integration test
Daan De Meyer [Tue, 20 Jun 2023 11:53:45 +0000 (13:53 +0200)]
test: Add touch into minimal verity test image
Daan De Meyer [Tue, 6 Jun 2023 15:44:09 +0000 (17:44 +0200)]
core: Add RootEphemeral= setting
This setting allows services to run in an ephemeral copy of the root
directory or root image. To make sure the ephemeral copies are always
cleaned up, we add a tmpfiles snippet to unconditionally clean up
/var/lib/systemd/ephemeral. To prevent in use ephemeral copies from
being cleaned up by tmpfiles, we use the newly added COPY_LOCK_BSD
and BTRFS_SNAPSHOT_LOCK_BSD flags to take a BSD lock on the ephemeral
copies which instruct tmpfiles to not touch those ephemeral copies as
long as the BSD lock is held.
Frantisek Sumsal [Wed, 21 Jun 2023 09:09:12 +0000 (11:09 +0200)]
journal-remote: fix typo in an error message
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jun 2023 23:46:45 +0000 (17:46 -0600)]
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jun 2023 23:40:36 +0000 (01:40 +0200)]
Merge pull request #28079 from Geass-LL/comment
basic/env-file: also change to state PRE_KEY if we see NEWLINE in sta…
Luca Boccassi [Tue, 20 Jun 2023 22:38:24 +0000 (23:38 +0100)]
Merge pull request #28082 from mrc0mmand/more-journal-remote-tests
test: add a couple of tests for systemd-journal-{remote,upload}
Lennart Poettering [Tue, 20 Jun 2023 19:37:46 +0000 (21:37 +0200)]
Merge pull request #28095 from poettering/generic-valid-version
make version_is_valid() generic
Lennart Poettering [Tue, 20 Jun 2023 15:03:47 +0000 (17:03 +0200)]
stat-util: add missing S_IFLNK entry in inode_type_to_string()
No idea what happened here, but it's a glaring omission.
Lennart Poettering [Tue, 20 Jun 2023 16:30:40 +0000 (18:30 +0200)]
analyze: also check for version string validity
It's highly interesting to see if tools such as systemd-sysupdate
consider a version valid, hence let's output that too (though
gracefully, not fatally)
Lennart Poettering [Thu, 2 Mar 2023 10:09:42 +0000 (11:09 +0100)]
string-util: move version_is_valid() into generic code
While we are at it, replace the sloppy use of filename_is_valid() by the
less sloppy filename_part_is_valid() (as added by the preceeding
commit), since we don#t want to be too restrictive here. (After all,
version strings invalid as standalone filenames might be valid as part
of filenames, and hence we should allow them).
Lennart Poettering [Fri, 3 Mar 2023 17:15:39 +0000 (18:15 +0100)]
path-util: split filename_is_valid() in two
Add a helper filename_part_is_valid() which does half of what
filename_is_valid() does: it checks for valid chars and length, but does
not filter out ".", ".." and "", as these are OK as parts of filenames,
just not alone.
Juno Computers [Tue, 20 Jun 2023 16:41:47 +0000 (12:41 -0400)]
hwdb: add support for Jun Tab2/Dere T11 to 60-sensor.hwdb (#28092)
Lennart Poettering [Tue, 20 Jun 2023 13:26:19 +0000 (15:26 +0200)]
hostnamectl: show age of firmware as time span, too
This converts the date into a relative timespan from the current time
on, and outputs it. It marks it yellow if older than two years, since
old firmware is probably a security risk. We don't make it red, since we
don't know though.
Lennart Poettering [Tue, 20 Jun 2023 16:40:08 +0000 (18:40 +0200)]
Merge pull request #28080 from poettering/dmi-fixes
fix udev DMI rules – make sure hostnamectl shows correct hw info even after device trigger
Lennart Poettering [Tue, 20 Jun 2023 16:39:49 +0000 (18:39 +0200)]
Merge pull request #28089 from poettering/sleep-cleanups
sleep-config: various clean-ups
Lennart Poettering [Tue, 20 Jun 2023 14:21:05 +0000 (16:21 +0200)]
Merge pull request #28087 from poettering/transaction-flags
transaction: change four boolean funciton parameters into a single flags parameter
Frantisek Sumsal [Mon, 19 Jun 2023 15:12:39 +0000 (17:12 +0200)]
test: add a couple of tests for systemd-journal-{remote,upload}
Daan De Meyer [Tue, 20 Jun 2023 10:59:24 +0000 (12:59 +0200)]
tmpfiles: Add note to man page about guaranteed cleanup for files/directories
Daan De Meyer [Tue, 6 Jun 2023 15:23:10 +0000 (17:23 +0200)]
tmpfiles: Don't log about harmless errors when trying to lock file
Let's make sure we don't log if the file is a symlink or does not
exist.
Daan De Meyer [Tue, 6 Jun 2023 14:55:14 +0000 (16:55 +0200)]
tmpfiles: Fix BSD lock logging messages
Daan De Meyer [Tue, 6 Jun 2023 14:54:24 +0000 (16:54 +0200)]
dissect-image: Log if verity signature partition is too large
Daan De Meyer [Thu, 23 Mar 2023 12:48:42 +0000 (13:48 +0100)]
namespace: Load sidecar verity settings in apply_mount_namespace()
Let's reduce the argument count of setup_namespace() a bit by loading
the sidecar verity settings in apply_mount_namespace(). This will also
make it possible to pass file descriptors to the root image/directory
into setup_namespace() as before this wasn't possible because the
verity settings logic looks for sidecar files next to the
root image which requires the path to be available.
Daan De Meyer [Tue, 20 Jun 2023 13:22:24 +0000 (15:22 +0200)]
Merge pull request #27863 from DaanDeMeyer/copy-lock
Add helpers to lock a directory before copying into it
Lennart Poettering [Tue, 20 Jun 2023 13:00:07 +0000 (15:00 +0200)]
hostnamed: when parsing day/month of firmware date, force decimal parsing
safe_atou() by default determines the base from the prefix 0x, 0b, 0o
and for compat with just 0 for octal. This is not what we want here,
since the date components are padded with zeroes yet still decimal.
Hence force decimal parsing (and while we are at it, prohibit a couple
of unexpected decorations).
WIthout this we'd fail to parse any the 8th and 9th day of each months, as
well aus aug and september of every year, because these look like octal
numbers but cannot actually parsed as such.
Let's change the testcase to check for a date that exposes this
bheaviour.
Lennart Poettering [Mon, 19 Jun 2023 16:49:05 +0000 (18:49 +0200)]
rules: drop weird spaces
Lennart Poettering [Mon, 19 Jun 2023 16:46:36 +0000 (18:46 +0200)]
hostnamed: don't read DMI data within a container
If we run in a container we should show info about the container, not
the host.
Lennart Poettering [Mon, 19 Jun 2023 16:44:54 +0000 (18:44 +0200)]
rules: split out DMI related rules from udev-default.rules
The DMI rules where so far guarded by an ACTION=="add" rule, but that
doesn't really make sense for setting properties (only for setting
access modes/ownership of nodes).
Hence let's move this into its own file, that guards properly on
ACTION!="remove".
Before this change the hardware vendor/model info would be dropped
whenever the device was retriggered.
Lennart Poettering [Tue, 20 Jun 2023 12:41:08 +0000 (14:41 +0200)]
update TODO
Lennart Poettering [Tue, 20 Jun 2023 12:18:52 +0000 (14:18 +0200)]
sleep: rename sleep-config.[ch] → sleep-util.[ch]
The file long ceased to be exclusively about configuration of the sleep
operation. It contains many many calls for other purposes, hence give it
a more generic name.
Lennart Poettering [Tue, 20 Jun 2023 12:15:42 +0000 (14:15 +0200)]
sleep-config: reduce scope of DMI object path a bit
We need this in a single function only, hence move it there, and make it
a static field so that it has local scope.
While we are at it, rename s/readsize to buf/bufsize, to make
relationship clear. In particular as the data read is actually binary
and "s" hence a misnomer, since it suggests it was a string.
Daan De Meyer [Tue, 28 Mar 2023 10:32:51 +0000 (12:32 +0200)]
btrfs-util: Add BTRFS_SNAPSHOT_LOCK_BSD
When making ephemeral snapshots of subvolumes whose cleanup depends on
whether they're locked or not, it's necessary to have the lock from the
very beginning, so let's support that with a new BTRFS_SNAPSHOT_LOCK_BSD
flag.
Lennart Poettering [Tue, 20 Jun 2023 11:21:28 +0000 (13:21 +0200)]
sleep-config: rename .device field to .path
This has been badly named given the path doesn't refer to a device quite
likely, but to a path to a regular file. Hence let's be more precise
with naming.
(.device kinda suggests this was an sd_device object of sorts, but it
really isn't.)
Lennart Poettering [Tue, 20 Jun 2023 10:34:09 +0000 (12:34 +0200)]
sleep-config: don't use 'device_id' moniker for a dev_t entity
We usually call dev_t entities "devnum" or "devno". That's redundant
enough, let's not call this "device_id". In particular as that's
something else (in udev context).
Lennart Poettering [Tue, 20 Jun 2023 10:32:21 +0000 (12:32 +0200)]
sleep-config: pin swap device while operating via O_PATH
Lennart Poettering [Tue, 20 Jun 2023 10:31:10 +0000 (12:31 +0200)]
sleep-config: replace SwapEntry's .type field with a proper enum
Following our usual rule: let's parse this early into internal
representation, and stick to that. don't pass unparsed strings around
needlessly.
Lennart Poettering [Tue, 20 Jun 2023 10:26:46 +0000 (12:26 +0200)]
sleep-config: check if we operate on regular file in swap_device_to_device_id() in swap file code path
Similar to the previous commit: before we continue doing swap file
operations let's ensure this actually is a swap file.
Lennart Poettering [Tue, 20 Jun 2023 10:23:58 +0000 (12:23 +0200)]
sleep-config: replace useless fstat() by useful fd_verify_regular()
For some reason there was an fstat() call here whose results was
entirely ignored. Let's remove it. Let's add a call to
fd_verify_regular() instead, because this is a code path for swap files,
hence let's make sure we actually operate on a file, and nothing else.
Lennart Poettering [Tue, 20 Jun 2023 10:22:28 +0000 (12:22 +0200)]
sleep-config: rename can_sleep_state() parameter
Just some trivial renaming, to indicate that these are not the supported
but the requested sleep states.
Lennart Poettering [Tue, 20 Jun 2023 11:07:53 +0000 (13:07 +0200)]
transaction: drop bus error arg from transaction_add_propagate_reload_jobs()
We erase the error anyway always, hence no point in even passing
anything in from callers.
Lennart Poettering [Tue, 20 Jun 2023 10:19:29 +0000 (12:19 +0200)]
transaction: rebreak comments to match current coding style
Lennart Poettering [Tue, 20 Jun 2023 10:20:38 +0000 (12:20 +0200)]
transaction: use more verbose dbus error data in log message where available
Lennart Poettering [Tue, 20 Jun 2023 10:19:03 +0000 (12:19 +0200)]
transaction: turn four bool parameters into a proper flags parameters