]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
14 months agotest: Install systemd-networkd-tests.py when install_tests is enabled
Daan De Meyer [Wed, 29 Mar 2023 10:15:24 +0000 (12:15 +0200)] 
test: Install systemd-networkd-tests.py when install_tests is enabled

14 months agomkosi: Update to latest
Daan De Meyer [Wed, 29 Mar 2023 08:42:23 +0000 (10:42 +0200)] 
mkosi: Update to latest

- ACLs are not set on generated directories anymore by default, so
we enable them explictly now so that when running unprivileged mkosi,
the user running mkosi can remove all generated files and directories.
- We don't explicitly set QemuHeadless= anymore as the option was removed
and made the default.
- We set the loglevel= kernel cmdline argument explicitly now as mkosi
doesn't set it by default anymore.

14 months agoudev_rules_parse_file: do not ignore ENOENT when invoked by udevadm verify
Dmitry V. Levin [Tue, 28 Mar 2023 20:00:00 +0000 (20:00 +0000)] 
udev_rules_parse_file: do not ignore ENOENT when invoked by udevadm verify

Make sure the ENOENT exception reintroduced by commit
9db7081d83d56cd2523b03f9eb9d67ef1c93c55f is not applied when the parser
is invoked by udevadm verify.

14 months agolog: Add LOG_SET_PREFIX() macro
Daan De Meyer [Mon, 27 Mar 2023 14:55:17 +0000 (16:55 +0200)] 
log: Add LOG_SET_PREFIX() macro

LOG_SET_PREFIX() sets a logging prefix for the current block. The
prefix is prepended to every logging message in the block, followed
by ": ". If a logging prefix is already configured, it is overridden
for the duration of the block, after which it is restored.

A use case for this macro is when we're operating on an image or
directory (using --root or --image). We can use LOG_SET_PREFIX() to
prefix all logging messages with the directory or image that we're
operating on.

14 months agoTEST-80: synchronize explicitly instead of by time
Lennart Poettering [Tue, 28 Mar 2023 14:35:35 +0000 (16:35 +0200)] 
TEST-80: synchronize explicitly instead of by time

This removes "sleep" invocations, and makes the notify access testcase a
lot more robust to runtime jitter. We use a pair of fifos in the fs to
sync instead.

Also various other improvoements, including comments.

(Also removes the unnecessary "no-qemu" restriction)

14 months agotest: do not remove state directory on failure
Luca Boccassi [Tue, 28 Mar 2023 23:07:45 +0000 (00:07 +0100)] 
test: do not remove state directory on failure

The test log is in the state directory, and we want to keep it around
when a test fails.

Follow-up for: 256a835f1c6c646a55039659aa2db186fbeb5c5d

14 months agoMerge pull request #27046 from bluca/shellcheck
Yu Watanabe [Wed, 29 Mar 2023 03:58:31 +0000 (12:58 +0900)] 
Merge pull request #27046 from bluca/shellcheck

Fix some shellcheck warnings

14 months agoMerge pull request #27040 from keszybz/empty-path-skip-cleanup
Yu Watanabe [Wed, 29 Mar 2023 01:18:06 +0000 (10:18 +0900)] 
Merge pull request #27040 from keszybz/empty-path-skip-cleanup

Restore silent skipping of missing rules files by udev

14 months agotest: fix shellcheck warnings in test-sysusers.sh 27046/head
Luca Boccassi [Wed, 29 Mar 2023 00:10:15 +0000 (01:10 +0100)] 
test: fix shellcheck warnings in test-sysusers.sh

14 months agoman: fix shellcheck warning for html.in
Luca Boccassi [Wed, 29 Mar 2023 00:17:50 +0000 (01:17 +0100)] 
man: fix shellcheck warning for html.in

SC2015: Note that A && B || C is not if-then-else. C may run when A is true.

14 months agoMerge pull request #27042 from fbuihuu/fixes-for-testsuite-74-mount
Luca Boccassi [Wed, 29 Mar 2023 00:54:30 +0000 (01:54 +0100)] 
Merge pull request #27042 from fbuihuu/fixes-for-testsuite-74-mount

Fixes for testsuite 74 mount

14 months agoman: correct/tweak text about unit name syntax
Lennart Poettering [Tue, 28 Mar 2023 21:25:52 +0000 (23:25 +0200)] 
man: correct/tweak text about unit name syntax

Unit names can be 255 characters long, not 256.

We first say "name prefix" and then continue with "unit prefix".
Confusing. Couldn't figure out which term is better hence settled on
"unit name prefix".

14 months agotest: fix regexp in testsuite-74.mount.sh 27042/head
Franck Bui [Tue, 28 Mar 2023 18:41:38 +0000 (20:41 +0200)] 
test: fix regexp in testsuite-74.mount.sh

Several whitespaces can separate "ext4" and "sd-mount-test" strings.

14 months agoMerge pull request #27035 from DaanDeMeyer/ukify-align
Daan De Meyer [Tue, 28 Mar 2023 17:45:04 +0000 (19:45 +0200)] 
Merge pull request #27035 from DaanDeMeyer/ukify-align

ukify: Add workarounds for older stubs

14 months agotest: don't go through all time zones if slow tests are disabled
Frantisek Sumsal [Tue, 28 Mar 2023 10:36:23 +0000 (12:36 +0200)] 
test: don't go through all time zones if slow tests are disabled

Let's skip going through all locally available time zones if we're built
with slow tests disabled, as that's quite slow, but do at least one test
with the UTC zone.

14 months agoMerge pull request #27030 from keszybz/bustctl-show-property-values-in-full
Luca Boccassi [Tue, 28 Mar 2023 17:14:49 +0000 (18:14 +0100)] 
Merge pull request #27030 from keszybz/bustctl-show-property-values-in-full

bustctl: show property values in full

14 months agotest: drop extraneous bracket in testsuite-74.mount.sh
Franck Bui [Tue, 28 Mar 2023 17:00:41 +0000 (19:00 +0200)] 
test: drop extraneous bracket in testsuite-74.mount.sh

14 months agoshared/exec-util: null_or_empty_path() does not return boolean 27040/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Mar 2023 16:50:31 +0000 (18:50 +0200)] 
shared/exec-util: null_or_empty_path() does not return boolean

We shouldn't report that the file is empty if the stating fails. Let's do the
same as in other places, and just ignore the error and let the subsequent
operation fail.

14 months agoMerge pull request #26941 from bluca/portable_version
Luca Boccassi [Tue, 28 Mar 2023 16:49:52 +0000 (17:49 +0100)] 
Merge pull request #26941 from bluca/portable_version

portable: introduce SYSEXT_ fields to identify sysexts, and include more metadata in log messages via LogExtraFields=

14 months agobasic/stat-util: remove unused null_or_empty_fd()
Zbigniew Jędrzejewski-Szmek [Tue, 28 Mar 2023 16:44:40 +0000 (18:44 +0200)] 
basic/stat-util: remove unused null_or_empty_fd()

14 months agoRevert "udev_rules_parse_file: do not skip ENOENT"
Zbigniew Jędrzejewski-Szmek [Tue, 28 Mar 2023 16:42:24 +0000 (18:42 +0200)] 
Revert "udev_rules_parse_file: do not skip ENOENT"

This reverts commit 42a467b55219384c7c3b137ab3cc8b6a309a8a14.

We need to skip -ENOENT when loading udev rules because new files with rules
may be added or removed at any time, and the loading of rules is triggered
asynchronously. Even though the window is fairly narrow, udev shouldn't throw
an error if a rules file is removed.

14 months agoukify: Add workarounds for older stubs 27035/head
Daan De Meyer [Tue, 28 Mar 2023 11:32:03 +0000 (13:32 +0200)] 
ukify: Add workarounds for older stubs

Older stubs are either not stripped, causing their total size to be
unaligned because of an unaligned symbol table at the end, or stripped,
causing the raw data pointers and sizes to be unaligned because strip
does not follow the PE spec correctly when stripping. Let's add
workarounds for both issues, so that we can use ukify with older stubs
as well.

14 months agoprocess-util: introduce get_process_cmdline_strv()
Yu Watanabe [Wed, 22 Mar 2023 16:05:38 +0000 (01:05 +0900)] 
process-util: introduce get_process_cmdline_strv()

The reason why get_process_cmdline() is so complicated is that we
need to escape and quote arguments for building a single result
string.

That's necessary when we want to log or print the command line.
However, when we want to parse the command line, it is not necessary
that the result is a single string, but can be strv.

This will be used when we parse the command line.

14 months agoRevert "ukify: Weaken file alignment assertions"
Daan De Meyer [Tue, 28 Mar 2023 11:31:38 +0000 (13:31 +0200)] 
Revert "ukify: Weaken file alignment assertions"

This reverts commit 23428bb19e49cf510c65e2896f1a7e4b12ca1dbc.

14 months agoos-release: add 'SYSEXT_' fields for version/id 26941/head
Luca Boccassi [Fri, 24 Mar 2023 15:10:11 +0000 (15:10 +0000)] 
os-release: add 'SYSEXT_' fields for version/id

sysext DDI cannot carry an os-release file, but have to carry
an extension-release file. But so far, this was only used to
match the sysext DDI with the base DDI/rootdir. It is also
useful to describe the sysext DDI itself, just like we do in
os-release.

So document that the same fields used in os-release can also
be added to an extension-release, with the 'SYSEXT_' prefix,
and in that case they are understood to define the sysext DDI
itself, rather than for matching purposes.

14 months agoportablectl: display sysext-specific fields
Luca Boccassi [Tue, 28 Mar 2023 09:36:49 +0000 (10:36 +0100)] 
portablectl: display sysext-specific fields

The wrong fields were being displayed, if at all.
ID and VERSION_ID in sysexts are used for matching, they
don't identify the sysext itself. Parse the newly defined
fields and display them separately from the compatibility
fields.

Before:

Image:
        /home/bluca/git/systemd/base.raw
Portable Service:
        n/a
Operating System:
        Debian GNU/Linux 10 (buster)
Extension:
        /home/bluca/git/systemd/app0.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Operating System:
                n/a (debian 10)
Extension:
        /home/bluca/git/systemd/app1.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Operating System:
                n/a (debian 10)
Unit files:
        app0.service
        app1.service

After:

Image:
        /home/bluca/git/systemd/base.raw
Portable Service:
        n/a
Operating System:
        Debian GNU/Linux 10 (buster)
Extension:
        /home/bluca/git/systemd/app0.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Extension Compatibility OS:
                debian
        Extension Compatibility OS Version:
                10
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Extension Image:
                ID: app Version: 0
Extension:
        /home/bluca/git/systemd/app1.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Extension Compatibility OS:
                debian
        Extension Compatibility OS Version:
                10
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Extension Image:
                ID: app Version: 1
Unit files:
        app0.service
        app1.service

14 months agoportable: add PORTABLE_NAME_AND_VERSION= and other metadata to LogsExtraFields=
Luca Boccassi [Thu, 23 Mar 2023 01:23:04 +0000 (01:23 +0000)] 
portable: add PORTABLE_NAME_AND_VERSION= and other metadata to LogsExtraFields=

This is useful to identify log messages with metadata from the images
they run on. Look for ID/VERSION_ID/IMAGE_ID/IMAGE_VERSION/BUILD_ID,
with a SYSEXT_ prefix if we are looking at an extension, and append via
LogExtraFields= as respectively PORTABLE_NAME_AND_VERSION= in case of a
single image. In case of extensions, append as PORTABLE_ROOT_NAME_AND_VERSION=
for the base and one PORTABLE_EXTENSION_AND_VERSION= for each extension.

Example with a base and two extensions, with the unit coming from the
first extension:

[Service]
RootImage=/home/bluca/git/systemd/base.raw
Environment=PORTABLE=app0.raw
BindReadOnlyPaths=/etc/os-release:/run/host/os-release
LogExtraFields=PORTABLE=app0.raw
Environment=PORTABLE_ROOT=base.raw
LogExtraFields=PORTABLE_ROOT=base.raw
LogExtraFields=PORTABLE_ROOT_NAME_AND_VERSION=debian_10

ExtensionImages=/home/bluca/git/systemd/app0.raw
LogExtraFields=PORTABLE_EXTENSION=app0.raw
LogExtraFields=PORTABLE_EXTENSION_NAME_AND_VERSION=app_0

ExtensionImages=/home/bluca/git/systemd/app1.raw
LogExtraFields=PORTABLE_EXTENSION=app1.raw
LogExtraFields=PORTABLE_EXTENSION_NAME_AND_VERSION=app_1

14 months agobusctl: also assume --full if not writing to terminal 27030/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Mar 2023 09:55:21 +0000 (11:55 +0200)] 
busctl: also assume --full if not writing to terminal

If people grep the output, it probably shouldn't be ellipsized.

14 months agoportable: include base and extension images in log fields
Luca Boccassi [Wed, 22 Mar 2023 22:44:31 +0000 (22:44 +0000)] 
portable: include base and extension images in log fields

When a portable service uses extensions, we use the 'main' image name
(the one where the unit was found in) as PORTABLE=. It is useful to
also list all the images actually used at runtime, as they might
contain libraries and so on.

Use PORTABLE_ROOT= for the image/directory that is used as RootImage=
or RootDirectory=, and PORTABLE_EXTENSION= for the image/directory that
is used as ExtensionImages= or ExtensionDirectories=.

Note that these new fields are only added if extensions are used,
there's no change for single-DDI portables.

Example with a base and two extensions, with the unit coming from the
first extension:

[Service]
RootImage=/home/bluca/git/systemd/base.raw
Environment=PORTABLE=app0.raw
BindReadOnlyPaths=/etc/os-release:/run/host/os-release
LogExtraFields=PORTABLE=app0.raw
LogExtraFields=PORTABLE_ROOT=base.raw

ExtensionImages=/home/bluca/git/systemd/app0.raw
LogExtraFields=PORTABLE_EXTENSION=app0.raw

ExtensionImages=/home/bluca/git/systemd/app1.raw
LogExtraFields=PORTABLE_EXTENSION=app1.raw

14 months agoportable: use parse_env_file_fd to keep FD valid
Luca Boccassi [Thu, 23 Mar 2023 01:02:47 +0000 (01:02 +0000)] 
portable: use parse_env_file_fd to keep FD valid

take_fdopen_unlocked invalidates the FD in the PortableMetadata object,
so it cannot be used later. Use parse_env_file_fd instead which is non
destructive.

14 months agostrv: add helper to find value in key/value pairs from list of keys
Luca Boccassi [Mon, 27 Mar 2023 11:05:28 +0000 (12:05 +0100)] 
strv: add helper to find value in key/value pairs from list of keys

14 months agoenv: add load_env_file_pairs_fd()
Luca Boccassi [Thu, 23 Mar 2023 10:47:06 +0000 (10:47 +0000)] 
env: add load_env_file_pairs_fd()

14 months agobusctl: use size_t for set size
Zbigniew Jędrzejewski-Szmek [Tue, 28 Mar 2023 09:30:07 +0000 (11:30 +0200)] 
busctl: use size_t for set size

Also reduce the scope of variables.

14 months agobusctl: do not truncate property values when --full
Zbigniew Jędrzejewski-Szmek [Tue, 28 Mar 2023 09:26:01 +0000 (11:26 +0200)] 
busctl: do not truncate property values when --full

14 months agoMerge pull request #27013 from fbuihuu/test-fixlets
Yu Watanabe [Tue, 28 Mar 2023 04:45:24 +0000 (13:45 +0900)] 
Merge pull request #27013 from fbuihuu/test-fixlets

Test fixlets

14 months agocryptenroll: fix a memory leak
Frantisek Sumsal [Mon, 27 Mar 2023 14:51:00 +0000 (16:51 +0200)] 
cryptenroll: fix a memory leak

$ dd if=/dev/zero of=luks.img bs=1M count=64
$ echo 1231dfsd234d | cryptsetup luksFormat luks.img
$ build-san/systemd-cryptenroll luks.img
SLOT TYPE
   0 password

=================================================================
==640364==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f43ffeb95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5)
    #1 0x7f43ff0a4f2f in greedy_realloc ../src/basic/alloc-util.c:70
    #2 0x404d9f in list_enrolled ../src/cryptenroll/cryptenroll-list.c:30
    #3 0x40f149 in run ../src/cryptenroll/cryptenroll.c:673
    #4 0x40f149 in main ../src/cryptenroll/cryptenroll.c:692
    #5 0x7f43fd64a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
Aborted (core dumped)

Reported in https://github.com/systemd/systemd/pull/27007.

14 months agoMerge pull request #27022 from yuwata/journal-remote-fix-relative-output-journal...
Yu Watanabe [Tue, 28 Mar 2023 04:41:13 +0000 (13:41 +0900)] 
Merge pull request #27022 from yuwata/journal-remote-fix-relative-output-journal-file

journal-remote: support relative output journal file again

14 months agosystemctl: show service status string in other color
Lennart Poettering [Fri, 24 Mar 2023 21:52:51 +0000 (22:52 +0100)] 
systemctl: show service status string in other color

Let's add a dash of colour to separate our own status info from the the
status info supplied by the service.

(I wanted to make this italics, but apparently popular terminal
emulators don't support that, such as xterm)

14 months agosystemctl: show fd store info in status output
Lennart Poettering [Fri, 24 Mar 2023 21:37:42 +0000 (22:37 +0100)] 
systemctl: show fd store info in status output

The fdstore might pin a non-trivial amount of resources. Let's hence
display for services that enable it how many entries there are and what
the size limit is.

14 months agosystemctl: dont's how memory limits that aren't available via D-Bus props
Lennart Poettering [Fri, 24 Mar 2023 21:41:57 +0000 (22:41 +0100)] 
systemctl: dont's how memory limits that aren't available via D-Bus props

When using an old systemctl on a new PID 1 the "startup" memory limit
props are not initialized and currently be shown in status output as
zero, even though there's code to suppress the output in that case. Alas
it doesn't work, because the relevant fields are not marked as
"unset"... Fix that.

Follow-up for: 53fda560dc2c66502da7ad68db7d79b515a3601a

14 months agoMerge pull request #26993 from mrc0mmand/TEST-46-tweaks
Yu Watanabe [Tue, 28 Mar 2023 04:39:08 +0000 (13:39 +0900)] 
Merge pull request #26993 from mrc0mmand/TEST-46-tweaks

test: explicitly pull in systemd-userdbd.service

14 months agoMerge pull request #26980 from ldv-alt/udevadm-verify
Yu Watanabe [Tue, 28 Mar 2023 04:38:12 +0000 (13:38 +0900)] 
Merge pull request #26980 from ldv-alt/udevadm-verify

udevadm verify: add more checks

14 months agohwdb: Move MSI touchpad-toggle mapping to generic MSI section
Hans de Goede [Mon, 27 Mar 2023 14:34:22 +0000 (16:34 +0200)] 
hwdb: Move MSI touchpad-toggle mapping to generic MSI section

Like other MSI laptops the MSI Summit E16 Flip A12UCT laptop also send
atkbd scancode 0x76 for the Fn + F4 touchpad-toggle hotkey combo.

Move the existing mapping for this from the MSI Prestige And MSI Modern
section to the generic MSI laptop section.

While at it also drop the KEYBOARD_KEY_f1=f20 mapping from
the MSI Prestige And MSI Modern section, as that is already listed
in the generic MSI laptop section.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216824
14 months agoenv-util: introduce strv_env_assign_many()
Yu Watanabe [Mon, 27 Mar 2023 09:21:06 +0000 (18:21 +0900)] 
env-util: introduce strv_env_assign_many()

14 months agoukify: Weaken file alignment assertions
Daan De Meyer [Mon, 27 Mar 2023 11:41:59 +0000 (13:41 +0200)] 
ukify: Weaken file alignment assertions

Older versions of the stub are not aligned to the PE file alignment
size. If we remove the assertions, the UKI still boots without issues,
so let's drop the assertions and print a message about it instead.

14 months agoMerge pull request #27005 from poettering/fd-reopen-symlink
Daan De Meyer [Mon, 27 Mar 2023 17:32:05 +0000 (19:32 +0200)] 
Merge pull request #27005 from poettering/fd-reopen-symlink

fd_reopen() symlink handling tweaks

14 months agoMerge pull request #26902 from YHNdnzj/restart-sec-step
Daan De Meyer [Mon, 27 Mar 2023 17:31:21 +0000 (19:31 +0200)] 
Merge pull request #26902 from YHNdnzj/restart-sec-step

core: add RestartSteps= and RestartSecMax= to dynamically increase interval between auto restarts

14 months agojournal-remote: make specified output file absolute 27022/head
Yu Watanabe [Mon, 27 Mar 2023 17:07:31 +0000 (02:07 +0900)] 
journal-remote: make specified output file absolute

After f12b399dd6362a03379cb769954ebfb9972236ed, the output path is
also used to determine the directory to be vacuumed. And if a filename
only path is specified, `writer_new()` fails since the commit.

This makes the specified path is always made absolute. This should not
change any behavior before the offending commit, as `journal_open()` opens
the specified journal file with `AT_FDCWD`.

Fixes #27012.

14 months agojournal-remote: add missing log message for failure in journal_remote_get_writer()
Yu Watanabe [Mon, 27 Mar 2023 17:28:04 +0000 (02:28 +0900)] 
journal-remote: add missing log message for failure in journal_remote_get_writer()

14 months agojournal-remote: make writer_new() return negative errno on failure
Yu Watanabe [Mon, 27 Mar 2023 17:26:33 +0000 (02:26 +0900)] 
journal-remote: make writer_new() return negative errno on failure

After f12b399dd6362a03379cb769954ebfb9972236ed, writer_new() may fail
with non-OOM error. Let's return the error cause, and logs the failure
in the caller side.

This also drops logs in journal_remote_get_writer(), adds its caller
typically logs the failure.

14 months agotest: don't export $TOOLS_DIR 27013/head
Franck Bui [Wed, 22 Mar 2023 09:33:58 +0000 (10:33 +0100)] 
test: don't export $TOOLS_DIR

It's not (and shouldn't be) used by any test scripts.

14 months agotest: clean up $STATEDIR too
Franck Bui [Tue, 21 Mar 2023 15:47:06 +0000 (16:47 +0100)] 
test: clean up $STATEDIR too

14 months agotest: $STATEDIR should not point to /usr/lib/systemd/tests when NO_BUILD=1
Franck Bui [Tue, 21 Mar 2023 15:44:41 +0000 (16:44 +0100)] 
test: $STATEDIR should not point to /usr/lib/systemd/tests when NO_BUILD=1

When testing the binaries from the host, make sure to not store the state data
below /usr but use a dedicated directory in /var/tmp/ instead.

The working directories of the tests, initially located in /var/tmp, are also
moved in a dedicated directory /var/tmp/systemd-tests.

14 months agolocale: Add missing libxkbcommon dependency to tests
Daan De Meyer [Mon, 27 Mar 2023 11:58:02 +0000 (13:58 +0200)] 
locale: Add missing libxkbcommon dependency to tests

Fixes opensuse mkosi CI build

14 months agoupdate TODO
Lennart Poettering [Fri, 24 Mar 2023 21:52:13 +0000 (22:52 +0100)] 
update TODO

14 months agoMerge pull request #26932 from dtardon/journal-vacuum
Lennart Poettering [Mon, 27 Mar 2023 13:49:58 +0000 (15:49 +0200)] 
Merge pull request #26932 from dtardon/journal-vacuum

Count size of all journal files when vacuuming

14 months agomkosi: Narrow glob used to install python packages
Daan De Meyer [Mon, 27 Mar 2023 11:23:40 +0000 (13:23 +0200)] 
mkosi: Narrow glob used to install python packages

Let's make sure we only install the python3 and python39 python
packages, instead of all the packages of all versions that are
packaged.

This also fixes the CentOS 8 CI because python3.11-pytest was failing
to install.

We have to ship our own powertools repo definition because we need to
enable module_hotfixes for powertools to coerce dnf into installing
some of the python packages.

14 months agocore/dbus-service: add RestartUSecCurrent property 26902/head
Mike Yuan [Fri, 24 Mar 2023 18:06:42 +0000 (02:06 +0800)] 
core/dbus-service: add RestartUSecCurrent property

This new property shows how much time we actually
waits before restarting.

14 months agocore: add RestartSteps= and RestartSecMax= for exponentially increasing
Mike Yuan [Mon, 20 Mar 2023 10:49:39 +0000 (18:49 +0800)] 
core: add RestartSteps= and RestartSecMax= for exponentially increasing
interval between restarts

RestartSteps= accepts a positive integer as the number of steps
to take to increase the interval between auto-restarts from
RestartSec= to RestartSecMax=, or 0 to disable it.

Closes #6129

14 months agouserdb: rename the destructor to follow our coding style 26993/head
Frantisek Sumsal [Mon, 27 Mar 2023 11:19:30 +0000 (13:19 +0200)] 
userdb: rename the destructor to follow our coding style

14 months agouserdb: fix a memory leak
Frantisek Sumsal [Sun, 26 Mar 2023 10:23:43 +0000 (12:23 +0200)] 
userdb: fix a memory leak

[   49.275617] testsuite-46.sh[1862]: =================================================================
[   49.275870] testsuite-46.sh[1862]: ==1862==ERROR: LeakSanitizer: detected memory leaks
[   49.276039] testsuite-46.sh[1862]: Direct leak of 103 byte(s) in 14 object(s) allocated from:
[   49.276515] testsuite-46.sh[1862]:     #0 0x7f4dbc07243b in strdup (/lib64/libasan.so.8+0x7243b)
[   49.276707] testsuite-46.sh[1862]:     #1 0x7f4dbb3900d5 in free_and_strdup ../src/basic/string-util.c:952
[   49.276931] testsuite-46.sh[1862]:     #2 0x7f4dbb15c67d in json_dispatch_user_group_name ../src/shared/json.c:4699
[   49.277134] testsuite-46.sh[1862]:     #3 0x7f4dbb16da9b in json_dispatch ../src/shared/json.c:4395
[   49.277352] testsuite-46.sh[1862]:     #4 0x7f4dbb25b28e in userdb_on_query_reply ../src/shared/userdb.c:305
[   49.277603] testsuite-46.sh[1862]:     #5 0x7f4dbb2748b9 in varlink_dispatch_reply ../src/shared/varlink.c:760
[   49.277766] testsuite-46.sh[1862]:     #6 0x7f4dbb2748b9 in varlink_process ../src/shared/varlink.c:951
[   49.277975] testsuite-46.sh[1862]:     #7 0x7f4dbb27a001 in defer_callback ../src/shared/varlink.c:1897
[   49.278197] testsuite-46.sh[1862]:     #8 0x7f4dbb5d57dd in source_dispatch ../src/libsystemd/sd-event/sd-event.c:4191
[   49.278421] testsuite-46.sh[1862]:     #9 0x7f4dbb5d685d in sd_event_dispatch ../src/libsystemd/sd-event/sd-event.c:4780
[   49.278675] testsuite-46.sh[1862]:     #10 0x7f4dbb5d70bf in sd_event_run ../src/libsystemd/sd-event/sd-event.c:4841
[   49.278873] testsuite-46.sh[1862]:     #11 0x7f4dbb257e7c in userdb_process ../src/shared/userdb.c:591
[   49.279048] testsuite-46.sh[1862]:     #12 0x7f4dbb25f78f in membershipdb_iterator_get ../src/shared/userdb.c:1411
[   49.279280] testsuite-46.sh[1862]:     #13 0x7f4dbb23a98c in user_record_show ../src/shared/user-record-show.c:187
[   49.279504] testsuite-46.sh[1862]:     #14 0x404ae3 in show_user ../src/userdb/userdbctl.c:93
[   49.279710] testsuite-46.sh[1862]:     #15 0x40b4f5 in display_user ../src/userdb/userdbctl.c:418
[   49.279961] testsuite-46.sh[1862]:     #16 0x7f4dbb2804d2 in dispatch_verb ../src/shared/verbs.c:110
[   49.280233] testsuite-46.sh[1862]:     #17 0x40dcf3 in run ../src/userdb/userdbctl.c:1327
[   49.280434] testsuite-46.sh[1862]:     #18 0x40dcf3 in main ../src/userdb/userdbctl.c:1330
[   49.280657] testsuite-46.sh[1862]:     #19 0x7f4db9e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
[   49.280907] testsuite-46.sh[1862]: SUMMARY: AddressSanitizer: 103 byte(s) leaked in 14 allocation(s).

14 months agotest: explicitly pull in systemd-userdbd.socket
Frantisek Sumsal [Sun, 26 Mar 2023 09:53:04 +0000 (11:53 +0200)] 
test: explicitly pull in systemd-userdbd.socket

Since we don't run preset-all on the test image, the
systemd-userdbd.socket remains disabled. Let's pull it in explicitly
to give systemd-userdbd some coverage as well.

14 months agoupdate TODO
Lennart Poettering [Mon, 27 Mar 2023 11:20:11 +0000 (13:20 +0200)] 
update TODO

14 months agotest-fd-util: use stat_inode_same() where appropriate 27005/head
Lennart Poettering [Mon, 27 Mar 2023 10:06:55 +0000 (12:06 +0200)] 
test-fd-util: use stat_inode_same() where appropriate

14 months agofd-util: cover some corner cases with fd_reopen() on symlinks
Lennart Poettering [Mon, 27 Mar 2023 10:04:57 +0000 (12:04 +0200)] 
fd-util: cover some corner cases with fd_reopen() on symlinks

The /proc/self/fd/ interface cannot be used to follow symlinks pinned
via O_PATH. Add a comment + test for that. Moreover, using fd_reopen()
with O_NOFOLLOW cannot work. Add an explicit check and test for that, to
make behaviour uniform.

14 months agoudev-rules: fix grammar in diagnostics about lines that have no effect 26980/head
Dmitry V. Levin [Mon, 27 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: fix grammar in diagnostics about lines that have no effect

Fixes: 25de7aa7b90c ("udev: modernize udev-rules.c")
14 months agotest: verify the journal with and without a sealing key
Frantisek Sumsal [Sun, 26 Mar 2023 15:04:57 +0000 (17:04 +0200)] 
test: verify the journal with and without a sealing key

The bit flips during journal verification cause various types of journal
corruptions, so it's useful to go through it even without a sealing key
to see how we handle corrupted stuff.

Also, provide a sealing key if running in "CI mode" (i.e. arguments),
to check the FSS-related codepaths in CIs as well.

14 months agoudev-rules: extend the check for conflicting expressions
Dmitry V. Levin [Fri, 24 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: extend the check for conflicting expressions

Log an error when a rule line contains the following kind of conflicting
match expressions:

  KEY=="foo*", KEY=="bar*"

14 months agoudev-rules: check token delimiters
Dmitry V. Levin [Thu, 23 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: check token delimiters

When udev_rules_parse_file() is called by udevadm verify, issue warnings
about the following conditions in udev rules:
* the first token in the rule is preceded with a comma
* the last token in the rule is followed by a comma
* there is no comma between tokens
* there is no whitespace between tokens
* there is more than a single comma between tokens
* there is whitespace between a token and a comma
* there is no whitespace after comma

14 months agoudev-rules: move udev_check_rule_line() invocation
Dmitry V. Levin [Wed, 22 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: move udev_check_rule_line() invocation

Move udev_check_rule_line() invocation from udev_rule_file_get_issues()
to udev_rules_parse_file(), invoke udev_check_rule_line() only when
udev_rules_parse_file() is called by udevadm verify.

Subsequent commits are going to perform more checks invoked from
udev_rules_parse_file().

14 months agoudev-rules: move udev_rules_parse_file() after udev_check_rule_line()
Dmitry V. Levin [Wed, 22 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: move udev_rules_parse_file() after udev_check_rule_line()

Move udev_rules_parse_file() after udev_check_rule_line() as
the former us going to use the latter.

14 months agotestsuite-17.11.sh: add commas between tokens
Dmitry V. Levin [Tue, 21 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
testsuite-17.11.sh: add commas between tokens

14 months agorules: add whitespace after comma before the line continuation
Dmitry V. Levin [Sat, 25 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
rules: add whitespace after comma before the line continuation

14 months agorules: remove stray whitespace before comma between tokens
Dmitry V. Levin [Tue, 21 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
rules: remove stray whitespace before comma between tokens

14 months agosd-id128: make id128_read() optionally take root directory
Yu Watanabe [Sun, 26 Mar 2023 05:03:10 +0000 (14:03 +0900)] 
sd-id128: make id128_read() optionally take root directory

14 months agoMerge pull request #26961 from DaanDeMeyer/chase-and-pin
Daan De Meyer [Mon, 27 Mar 2023 08:41:08 +0000 (10:41 +0200)] 
Merge pull request #26961 from DaanDeMeyer/chase-and-pin

chase-symlinks: Add chase_and_open_parent() + at() variant

14 months agoMerge pull request #26870 from fbuihuu/move-unit-tests-in-a-dedicated-subdir
Luca Boccassi [Mon, 27 Mar 2023 08:38:15 +0000 (09:38 +0100)] 
Merge pull request #26870 from fbuihuu/move-unit-tests-in-a-dedicated-subdir

Move unit tests in a dedicated subdir

14 months agojournalctl: fix when --grep is used with --follow
Mike Yuan [Thu, 23 Mar 2023 14:17:40 +0000 (22:17 +0800)] 
journalctl: fix when --grep is used with --follow

Follow-up for #25147 (db4691961ca52759fe6645d0fddb659ee4299ac2)

--follow sets arg_lines to 10, which breaks
--grep as the latter implies --reverse.
So let's not set --reverse if --follow is used.

14 months agoMerge pull request #26294 from yuwata/locale-verify-conf
Zbigniew Jędrzejewski-Szmek [Mon, 27 Mar 2023 08:26:24 +0000 (10:26 +0200)] 
Merge pull request #26294 from yuwata/locale-verify-conf

locale: verify loaded keymap or friends

14 months agooomd: add inline comments with param names
Zbigniew Jędrzejewski-Szmek [Tue, 21 Mar 2023 18:49:18 +0000 (19:49 +0100)] 
oomd: add inline comments with param names

14 months agobootctl: split-out entry token related definitions into boot-entry.[ch]
Yu Watanabe [Sun, 26 Mar 2023 07:33:43 +0000 (16:33 +0900)] 
bootctl: split-out entry token related definitions into boot-entry.[ch]

No functional change, just preparation for later commits.
These can be used in kernel-install later.

Note, unlike the our usual coding style, the arguments for
boot_entry_token_ensure() and parse_boot_entry_token_type() are
referenced, updated, and may freed, hence, always pass initialized
values. That's why they are not named as 'ret_xyz'.

14 months agochase-symlinks: Add chase_and_open_parent() + at() variant 26961/head
Daan De Meyer [Fri, 24 Mar 2023 11:10:16 +0000 (12:10 +0100)] 
chase-symlinks: Add chase_and_open_parent() + at() variant

Helper to chase a path, pin its parent directory and return the filename
of the resolved path in its parent directory.

14 months agoDefine $KERNEL_INSTALL_UKI_GENERATOR
Gertalitec [Wed, 22 Mar 2023 21:09:10 +0000 (01:09 +0400)] 
Define $KERNEL_INSTALL_UKI_GENERATOR

Define $KERNEL_INSTALL_UKI_GENERATOR in case one wants it to be different from $KERNEL_INSTALL_INITRD_GENERATOR. This can be useful if one wants to use mkinitcpio / Dracut to generate the initrd, but without creating the UKI so this can be left for e.g. ukify or something else. Right now these initrd generators will read /etc/kernel/install.conf and generate the UKI

14 months agohwdb: Fixed thumb buttons reversed on CHERRY MW 2310 (#26992)
taniishkaaa [Sun, 26 Mar 2023 14:52:31 +0000 (20:22 +0530)] 
hwdb: Fixed thumb buttons reversed on CHERRY MW 2310 (#26992)

Fixes #12914.

14 months agohwdb: drop redundant entry
Yu Watanabe [Sun, 26 Mar 2023 00:44:48 +0000 (09:44 +0900)] 
hwdb: drop redundant entry

Follow-up for ff155c81620bc4e1ccce27d4d5194707048d8143.

The entry already matches with the generic rule defined at the beginning
of the hwdb file.

14 months agotest: install symlinks with valid targets on SUSE and Debian 26870/head
Franck Bui [Fri, 24 Mar 2023 12:46:24 +0000 (13:46 +0100)] 
test: install symlinks with valid targets on SUSE and Debian

14 months agoMerge pull request #26973 from mrc0mmand/userdbctl-tests
Yu Watanabe [Sun, 26 Mar 2023 00:49:27 +0000 (09:49 +0900)] 
Merge pull request #26973 from mrc0mmand/userdbctl-tests

test: add a couple of tests for userdbctl

14 months agocore/main: restore the correct assert about array position
Zbigniew Jędrzejewski-Szmek [Sat, 25 Mar 2023 10:58:49 +0000 (11:58 +0100)] 
core/main: restore the correct assert about array position

'pos' is incremented after each assignment. If we use the maximum number
of arguments, we end up with pos==9 after all the assignments, and it
points to where the next value would be assigned. This position must remain
NULL.

The assert I "fixed" was intentionally introduced in
26abdc73a212b90f7c4b71808a1028d2e87ab09f as a bugfix. So my "fix" repeated
the same error that was fixed back then.

14 months agoMerge pull request #26983 from mrc0mmand/coredump-test-followup
Yu Watanabe [Sun, 26 Mar 2023 00:47:49 +0000 (09:47 +0900)] 
Merge pull request #26983 from mrc0mmand/coredump-test-followup

test: don't expand the subshell expression prematurely

14 months agotest: filter the merged coverage report instead
Frantisek Sumsal [Sat, 25 Mar 2023 13:39:13 +0000 (14:39 +0100)] 
test: filter the merged coverage report instead

So we don't have to do this twice - once for the base report and then
for each "real" one.

Follow-up to 7fdd6e157a.

14 months agotest: add a couple of tests for userdbctl 26973/head
Frantisek Sumsal [Fri, 24 Mar 2023 16:26:48 +0000 (17:26 +0100)] 
test: add a couple of tests for userdbctl

14 months agotest: do an initial coverage capture
Frantisek Sumsal [Fri, 24 Mar 2023 20:15:28 +0000 (21:15 +0100)] 
test: do an initial coverage capture

I noticed that our coverage reports miss some files completely - this
happens when the test doesn't touch the code in them at all, so the
generated coverage data (and resulting reports) have no information
about them. Let's fix this by doing an initial zero coverage capture
that contains a zeroed counter for every instrumented line in every
file, so when we later merge it with a capture from the test, it shows up
with a missing coverage instead of not showing at all.

14 months agotest: drop unnecessary return 26983/head
Frantisek Sumsal [Sat, 25 Mar 2023 11:17:11 +0000 (12:17 +0100)] 
test: drop unnecessary return

Return code of the EXIT trap handler is ignored in bash.

14 months agotest: don't touch the /failed marker in the subtest scripts
Frantisek Sumsal [Sat, 25 Mar 2023 11:15:33 +0000 (12:15 +0100)] 
test: don't touch the /failed marker in the subtest scripts

As it is already handled by the "main" script (testsuite-74.sh).

14 months agotest: don't expand the subshell expression prematurely
Frantisek Sumsal [Sat, 25 Mar 2023 11:02:15 +0000 (12:02 +0100)] 
test: don't expand the subshell expression prematurely

We need to expand the subshell expression during the `bash -c`
invocation, not before, to take the desired effect, as now it expands to:

timeout 30 bash -c 'while [[ 0 -eq 0 ]]; do sleep 1; done'

instead of the expected:

timeout 30 bash -c 'while [[ $(coredumpctl list -q --no-legend 770 | wc -l) -eq 0 ]]; do sleep 1; done'

Follow-up to aadbd81f7f.

14 months agohwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)
taniishkaaa [Sat, 25 Mar 2023 10:41:07 +0000 (16:11 +0530)] 
hwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)

Closes #22793.

14 months agotest: add test for invalid keymap setting 26294/head
Yu Watanabe [Wed, 1 Feb 2023 19:29:43 +0000 (04:29 +0900)] 
test: add test for invalid keymap setting

14 months agolocale: also verify keymaps loaded from config file and converted keymaps
Yu Watanabe [Wed, 1 Feb 2023 18:23:50 +0000 (03:23 +0900)] 
locale: also verify keymaps loaded from config file and converted keymaps

If vconsole.conf or friends contain an invalid keymap, then let's
ignore the settings.

14 months agolocale: introduce x11_context_verify()
Yu Watanabe [Wed, 1 Feb 2023 17:53:35 +0000 (02:53 +0900)] 
locale: introduce x11_context_verify()

No functional change, preparation for later commits.

14 months agolocale: split out xkbcommon related functions to xkbcommon-util.c
Yu Watanabe [Wed, 1 Feb 2023 17:47:47 +0000 (02:47 +0900)] 
locale: split out xkbcommon related functions to xkbcommon-util.c

Then, use dlopen_many_sym_or_warn() with DLSYM_ARG() macro.