David Tardon [Thu, 6 Apr 2023 10:22:36 +0000 (12:22 +0200)]
test: also test client-side operation if applicable
David Tardon [Wed, 12 Apr 2023 14:59:21 +0000 (16:59 +0200)]
systemctl: fix a memory leak
valgrind systemctl is-enabled --root=/ -l default.target >/dev/null
==746041== Memcheck, a memory error detector
==746041== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==746041== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==746041== Command: systemctl is-enabled --root=/ -l default.target
==746041==
==746041==
==746041== HEAP SUMMARY:
==746041== in use at exit: 8,251 bytes in 4 blocks
==746041== total heap usage: 3,440 allocs, 3,436 frees, 1,163,346 bytes allocated
==746041==
==746041== LEAK SUMMARY:
==746041== definitely lost: 24 bytes in 1 blocks
==746041== indirectly lost: 35 bytes in 1 blocks
==746041== possibly lost: 0 bytes in 0 blocks
==746041== still reachable: 8,192 bytes in 2 blocks
==746041== suppressed: 0 bytes in 0 blocks
==746041== Rerun with --leak-check=full to see details of leaked memory
==746041==
==746041== For lists of detected and suppressed errors, rerun with: -s
==746041== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
David Tardon [Wed, 12 Apr 2023 15:11:52 +0000 (17:11 +0200)]
install: rename function
David Tardon [Tue, 28 Mar 2023 07:41:56 +0000 (09:41 +0200)]
install: drop unused function
David Tardon [Tue, 28 Mar 2023 07:38:33 +0000 (09:38 +0200)]
test: use _cleanup_ for UnitFileList hash
David Tardon [Tue, 28 Mar 2023 13:20:12 +0000 (15:20 +0200)]
systemctl-list-unit-files: drop workaround for Coverity
This partially reverts commit
0da999fada225d2d74b62ec758cd437a3e2f6ebb .
David Tardon [Tue, 28 Mar 2023 07:36:35 +0000 (09:36 +0200)]
systemctl: drop stray assignment
David Tardon [Tue, 28 Mar 2023 07:36:14 +0000 (09:36 +0200)]
systemctl: use _cleanup_ for UnitFileList hash
This also fixes a memory leak in the old code.
valgrind systemctl -t socket --root=/ list-unit-files >/dev/null
==
2601899== Memcheck, a memory error detector
==
2601899== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==
2601899== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==
2601899== Command: systemctl -t socket --root=/ list-unit-files
==
2601899==
==
2601899==
==
2601899== HEAP SUMMARY:
==
2601899== in use at exit: 39,984 bytes in 994 blocks
==
2601899== total heap usage: 344,414 allocs, 343,420 frees, 2,001,612,404 bytes allocated
==
2601899==
==
2601899== LEAK SUMMARY:
==
2601899== definitely lost: 7,952 bytes in 497 blocks
==
2601899== indirectly lost: 32,032 bytes in 497 blocks
==
2601899== possibly lost: 0 bytes in 0 blocks
==
2601899== still reachable: 0 bytes in 0 blocks
==
2601899== suppressed: 0 bytes in 0 blocks
==
2601899== Rerun with --leak-check=full to see details of leaked memory
==
2601899==
==
2601899== For lists of detected and suppressed errors, rerun with: -s
==
2601899== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
David Tardon [Tue, 28 Mar 2023 07:32:40 +0000 (09:32 +0200)]
dbus-manager: use _cleanup_ for UnitFileList hash
David Tardon [Tue, 28 Mar 2023 07:31:51 +0000 (09:31 +0200)]
install: define hash_ops for UnitFileList
Yu Watanabe [Tue, 28 Mar 2023 04:45:24 +0000 (13:45 +0900)]
Merge pull request #27013 from fbuihuu/test-fixlets
Test fixlets
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.
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
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)
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.
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
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
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
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
Yu Watanabe [Mon, 27 Mar 2023 09:21:06 +0000 (18:21 +0900)]
env-util: introduce strv_env_assign_many()
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.
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
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
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.
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()
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.
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.
Franck Bui [Tue, 21 Mar 2023 15:47:06 +0000 (16:47 +0100)]
test: clean up $STATEDIR too
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.
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
Lennart Poettering [Fri, 24 Mar 2023 21:52:13 +0000 (22:52 +0100)]
update TODO
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
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.
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.
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
Frantisek Sumsal [Mon, 27 Mar 2023 11:19:30 +0000 (13:19 +0200)]
userdb: rename the destructor to follow our coding style
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).
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.
Lennart Poettering [Mon, 27 Mar 2023 11:20:11 +0000 (13:20 +0200)]
update TODO
Lennart Poettering [Mon, 27 Mar 2023 10:06:55 +0000 (12:06 +0200)]
test-fd-util: use stat_inode_same() where appropriate
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.
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")
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.
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*"
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
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().
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.
Dmitry V. Levin [Tue, 21 Mar 2023 08:00:00 +0000 (08:00 +0000)]
testsuite-17.11.sh: add commas between tokens
Dmitry V. Levin [Sat, 25 Mar 2023 08:00:00 +0000 (08:00 +0000)]
rules: add whitespace after comma before the line continuation
Dmitry V. Levin [Tue, 21 Mar 2023 08:00:00 +0000 (08:00 +0000)]
rules: remove stray whitespace before comma between tokens
Yu Watanabe [Sun, 26 Mar 2023 05:03:10 +0000 (14:03 +0900)]
sd-id128: make id128_read() optionally take root directory
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
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
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.
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
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'.
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.
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
taniishkaaa [Sun, 26 Mar 2023 14:52:31 +0000 (20:22 +0530)]
hwdb: Fixed thumb buttons reversed on CHERRY MW 2310 (#26992)
Fixes #12914.
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.
Franck Bui [Fri, 24 Mar 2023 12:46:24 +0000 (13:46 +0100)]
test: install symlinks with valid targets on SUSE and Debian
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
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.
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
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.
Frantisek Sumsal [Fri, 24 Mar 2023 16:26:48 +0000 (17:26 +0100)]
test: add a couple of tests for userdbctl
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.
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.
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).
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.
taniishkaaa [Sat, 25 Mar 2023 10:41:07 +0000 (16:11 +0530)]
hwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)
Closes #22793.
Yu Watanabe [Wed, 1 Feb 2023 19:29:43 +0000 (04:29 +0900)]
test: add test for invalid keymap setting
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.
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.
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.
Yu Watanabe [Wed, 1 Feb 2023 16:50:37 +0000 (01:50 +0900)]
locale: split out checking existence of keymap
No functional change, preparation for later commits.
Yu Watanabe [Wed, 1 Feb 2023 16:34:24 +0000 (01:34 +0900)]
locale: move x11_convert_to_vconsole() near the relevant functions
No functional changes, just refactoring.
Yu Watanabe [Sat, 25 Mar 2023 04:39:27 +0000 (13:39 +0900)]
Merge pull request #26960 from poettering/syscall-catchup
syscall filter group updates
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:51:52 +0000 (17:51 +0100)]
xdg-autostart-generator: do not warn about unknown fields
My user manager says:
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:256: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:258: Unknown section 'Desktop Action new-window'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:343: Unknown section 'Desktop Action preferences'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:12: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:13: Unknown key name 'SingleMainWindow' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:19: Unknown section 'Desktop Action Quit'. Ignoring.
This is not useful. Those are externally-provided files, and they are likely to
have entries which we know nothing about.
Yu Watanabe [Sat, 25 Mar 2023 04:38:24 +0000 (13:38 +0900)]
Merge pull request #26977 from poettering/find-line-startswith
add new find_line_startswith() helper
Yu Watanabe [Fri, 24 Mar 2023 21:58:35 +0000 (06:58 +0900)]
bootctl: enable colored logging
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 13:11:48 +0000 (14:11 +0100)]
core/main: fix setting of arguments for shutdown
Fixup for
d2ebd50d7f9740dcf30e84efc75610af173967d2
and
6920049fad4fa39db5fec712f82f7f75b98fd4b9:
- add a comment that the last arg must be NULL and adjust the assert.
- move initialization around so that fields are declared,
initialized, and consumed in the same order.
- move declaration of pos adjacent do declaration of command_line.
This makes it easy to see that it was not initialized correctly.
- initialize buffers before writing the pointer into the args array.
This makes no difference for the compiler, but it just feels "wrong"
to do it in opposite order.
Because pos was off, we would ignore args after the timeout, and also
overwrite the buffer if enough args were used.
I think this is case shows clearly that declaring all variables at the
top of the function, with some initialized and other not, is very
error-prone. The compiler has no issue with declaring variables whereever,
and we should take advantage of this to make it keep declaration,
initialization, and use close. (Within reason of course.)
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 13:54:34 +0000 (14:54 +0100)]
tools: add dump-auxv.py
This is a little helper I used when preparing the tests for auxv
parsing. Just looking at hexdump output is pretty hard. We could
enhance it to display some specific data types better.
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:25:59 +0000 (17:25 +0100)]
hwdb: drop boilerplate about match patterns in two more cases
Follow-up for
adbe000e3df5f91572bf4a77a2acd84ff5b87320.
Somehow I missed those two files.
Lennart Poettering [Fri, 24 Mar 2023 17:27:03 +0000 (18:27 +0100)]
import: use truncate_nl() where appropriate
Lennart Poettering [Fri, 24 Mar 2023 17:25:13 +0000 (18:25 +0100)]
tree-wide: port various places to find_line_startswith()
Lennart Poettering [Fri, 24 Mar 2023 17:02:32 +0000 (18:02 +0100)]
string-util: add new helper for finding line starting with specific string in a text buffer
We have implemented this manually a couple of times, and always wrong.
Hence let's implement this correctly for once and use everywhere.
Frantisek Sumsal [Fri, 24 Mar 2023 16:17:31 +0000 (17:17 +0100)]
userdbctl: flush stdout before running the chain command
Otherwise it's quite difficult to capture the entire output:
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello
ssh-
ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA//dxI2xLg4MgxIKKZv1nqwTEIlE/fdakii2Fb75pG+ foo@bar.tld
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMlaqG2rTMje5CQnfjXJKmoSpEVJ2gWtx4jBvsQbmee2XbU/Qdq5+SRisssR9zVuxgg5NA5fv08MgjwJQMm+csc= hello@world.tld
hello
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello | tee
hello
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:00:31 +0000 (17:00 +0100)]
Merge pull request #26920 from medhefgo/ukify
ukify: Use pefile to add sections to EFI stub
Frantisek Sumsal [Fri, 24 Mar 2023 15:16:50 +0000 (16:16 +0100)]
docs: s/authorized_key/authorized_keys/
Frantisek Sumsal [Fri, 24 Mar 2023 14:43:04 +0000 (15:43 +0100)]
man: s/io.systemd.Dropin/io.systemd.DropIn/
Frantisek Sumsal [Fri, 24 Mar 2023 14:19:21 +0000 (15:19 +0100)]
userdbctl: don't show legend when dumping JSON with services
Lennart Poettering [Fri, 24 Mar 2023 13:52:34 +0000 (14:52 +0100)]
man: update syscal filter group list
Franck Bui [Mon, 20 Mar 2023 17:23:33 +0000 (18:23 +0100)]
test: on openSUSE install the collection of unit test binaries in the target only for TEST-02-UNITTESTS
Franck Bui [Fri, 17 Mar 2023 13:18:50 +0000 (14:18 +0100)]
meson: make sure the unit test scripts find testdata/ even if they are not installed in the same directory
testdata/ is shared by both the unit tests and the integration tests. Hence it
makes sense to place them right under /usr/lib/systemd/tests/ while the tests
themself are located under dedicated sub-directories:
/usr/lib/systemd/tests/
├── integration-tests
├── testdata
└── unit-tests
├── testdata -> ../testdata
However the unit tests implemented as shell scripts (such as
test-fstab-generator.sh) expect to find testdata/ where the scripts are
installed, ie they do something like:
src="$(dirname "$0")/testdata/test-fstab-generator"
This patch installs a symlink in 'unitestsdir' named "testdata" and that points
to whatever value 'testdata_dir' is set.
Franck Bui [Fri, 17 Mar 2023 13:14:16 +0000 (14:14 +0100)]
meson: define testdata_dir globally
Franck Bui [Thu, 26 Jan 2023 15:07:17 +0000 (16:07 +0100)]
test: install unit tests in a dedicated subdirectory below '$testsdir'
/usr/lib/systemd/tests may contain more than the unit tests. For example on
SUSE we also install the integration tests there.
Putting the unit tests in a dedicated directory named 'unit-tests' makes the
layout cleaner.
Note that `run-unit-tests.py` has not been moved so we don't need to adjust
(Fedora) packaging and users also don't need to descend into the subdirectory.
Daan De Meyer [Fri, 24 Mar 2023 11:21:45 +0000 (12:21 +0100)]
chase-symlinks: Allow optional path with CHASE_EXTRACT_FILENAME
This allows helpers to set it unconditionally even if the caller
is not interested in the path.
Daan De Meyer [Tue, 21 Mar 2023 20:17:22 +0000 (21:17 +0100)]
chase-symlinks: Rename chase_symlinks() to chase()
Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().
We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 12:38:54 +0000 (13:38 +0100)]
Merge pull request #26785 from keszybz/udev-distcheck
Implement --help/--version in all udev builtins