Commit Graph
63413 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek f735076c54 busctl: also assume --full if not writing to terminal
If people grep the output, it probably shouldn't be ellipsized.
2023-03-28 11:55:21 +02:00
Zbigniew Jędrzejewski-Szmek bc1f1eba77 busctl: use size_t for set size
Also reduce the scope of variables.
2023-03-28 11:31:29 +02:00
Zbigniew Jędrzejewski-Szmek d82267e567 busctl: do not truncate property values when --full 2023-03-28 11:26:01 +02:00
Zbigniew Jędrzejewski-Szmek ebfb601945 oomd: add inline comments with param names 2023-03-27 10:18:55 +02:00
Yu Watanabe 9e43296fd2 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'.
2023-03-27 09:51:18 +02:00
Gertalitec 600362aa11 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
2023-03-26 16:54:16 +02:00
taniishkaaa f33c1c49a5 hwdb: Fixed thumb buttons reversed on CHERRY MW 2310 (#26992)
Fixes #12914.
2023-03-26 23:52:31 +09:00
Yu Watanabe 596ac132fb hwdb: drop redundant entry
Follow-up for ff155c8162.

The entry already matches with the generic rule defined at the beginning
of the hwdb file.
2023-03-26 19:01:49 +08:00
Yu Watanabe cccc14c5a8 Merge pull request #26973 from mrc0mmand/userdbctl-tests
test: add a couple of tests for userdbctl
2023-03-26 09:49:27 +09:00
Zbigniew Jędrzejewski-Szmek 14ecfc1cd2 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
26abdc73a2 as a bugfix. So my "fix" repeated
the same error that was fixed back then.
2023-03-26 09:48:14 +09:00
Yu Watanabe 6fc0d6b5ac Merge pull request #26983 from mrc0mmand/coredump-test-followup
test: don't expand the subshell expression prematurely
2023-03-26 09:47:49 +09:00
Frantisek Sumsal 237d81fdb3 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.
2023-03-25 17:55:41 +01:00
Frantisek Sumsal 93fe228bb1 test: add a couple of tests for userdbctl 2023-03-25 14:13:00 +01:00
Frantisek Sumsal 7fdd6e157a 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.
2023-03-25 12:29:40 +00:00
Frantisek Sumsal 91c031f169 test: drop unnecessary return
Return code of the EXIT trap handler is ignored in bash.
2023-03-25 12:17:11 +01:00
Frantisek Sumsal 370fa624f5 test: don't touch the /failed marker in the subtest scripts
As it is already handled by the "main" script (testsuite-74.sh).
2023-03-25 12:15:33 +01:00
Frantisek Sumsal 0b189ac84c 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.
2023-03-25 12:10:58 +01:00
taniishkaaa ff155c8162 hwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)
Closes #22793.
2023-03-25 11:41:07 +01:00
Yu Watanabe 363ed18730 Merge pull request #26960 from poettering/syscall-catchup
syscall filter group updates
2023-03-25 13:39:27 +09:00
Zbigniew Jędrzejewski-Szmek b5a70eeecd 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.
2023-03-25 13:38:39 +09:00
Yu Watanabe 01c357b0ac Merge pull request #26977 from poettering/find-line-startswith
add new find_line_startswith() helper
2023-03-25 13:38:24 +09:00
Yu Watanabe 87dc8b0851 bootctl: enable colored logging 2023-03-25 12:38:11 +09:00
Zbigniew Jędrzejewski-Szmek 4688b08984 core/main: fix setting of arguments for shutdown
Fixup for d2ebd50d7f
and 6920049fad:
- 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.)
2023-03-24 19:08:20 +00:00
Zbigniew Jędrzejewski-Szmek 85a336f81d 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.
2023-03-24 18:49:34 +00:00
Zbigniew Jędrzejewski-Szmek 61b69bec8e hwdb: drop boilerplate about match patterns in two more cases
Follow-up for adbe000e3d.
Somehow I missed those two files.
2023-03-25 03:11:23 +09:00
Lennart Poettering 90f5f3552c import: use truncate_nl() where appropriate 2023-03-24 18:33:59 +01:00
Lennart Poettering 50ed5cbf5f tree-wide: port various places to find_line_startswith() 2023-03-24 18:30:20 +01:00
Lennart Poettering 7b82d95f8d 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.
2023-03-24 18:30:20 +01:00
Frantisek Sumsal 5b09499cac 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
2023-03-24 17:17:31 +01:00
Zbigniew Jędrzejewski-Szmek 32e07cff96 Merge pull request #26920 from medhefgo/ukify
ukify: Use pefile to add sections to EFI stub
2023-03-24 17:00:31 +01:00
Frantisek Sumsal 13bf321610 docs: s/authorized_key/authorized_keys/ 2023-03-24 16:16:50 +01:00
Frantisek Sumsal 8f572d0d82 man: s/io.systemd.Dropin/io.systemd.DropIn/ 2023-03-24 15:43:04 +01:00
Frantisek Sumsal eedd1da9f9 userdbctl: don't show legend when dumping JSON with services 2023-03-24 15:19:21 +01:00
Lennart Poettering f452e0461f man: update syscal filter group list 2023-03-24 14:52:34 +01:00
Daan De Meyer f461a28da7 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.
2023-03-24 13:43:51 +01:00
Zbigniew Jędrzejewski-Szmek 0da2780c8a Merge pull request #26785 from keszybz/udev-distcheck
Implement --help/--version in all udev builtins
2023-03-24 13:38:54 +01:00
Jan Janssen 52abd56915 ukify: Add riscv32 and loongarch support 2023-03-24 13:01:53 +01:00
Jan Janssen 3fc5eed470 ukify: Use pefile to add sections to EFI stub 2023-03-24 13:01:45 +01:00
Lennart Poettering 950c0ed389 analyze: don't claim "@known" was an unlisted syscall
It's a sycall group of our own definition, and the output is erroneous
to claim otherwise. Let's hide it.

This adds syscall_set_add() which is nicely symmetric to the existing
syscall_set_remove().

Follow-up for: 6d6a08547c
2023-03-24 12:29:30 +01:00
Lennart Poettering 50524bd887 seccomp-util: enforce group ordering
So far we asked via a comment that @default should stay the first group
and @known the last group in the list. Let's enforce that statically, in
code, too.
2023-03-24 12:28:46 +01:00
Lennart Poettering 76e86b8dd8 seccomp-util: add some newer syscalls to existing groups
These three new syscalls are mostly just new flavours or extensions of
existing syscalls, hence add them to the same groups.
2023-03-24 12:28:03 +01:00
Lennart Poettering d12632a861 seccomp-util: add new @sandbox syscall group with landlock/seccomp
Let's group these 4 syscalls, as they offer similar things and I guess
might be used in conjunction quite often, as they offer unprivileged
sandboxing.

Fixes: #26913
2023-03-24 12:27:23 +01:00
Frantisek Sumsal aadbd81f7f test: add a couple of tests for systemd-coredump 2023-03-24 11:56:33 +01:00
Daan De Meyer 12962485e4 Merge pull request #26958 from yuwata/nulstr-optionally-drop-trailing-nulstr
nulstr: make strv_parse_nulstr() optionally drop trailing NULs
2023-03-24 11:33:58 +01:00
Daan De Meyer d258aacdfb Merge pull request #26957 from yuwata/proc-cmdline-cleanups
proc-cmdline: several cleanups
2023-03-24 11:29:54 +01:00
Daan De Meyer 53c3342253 Merge pull request #26948 from yuwata/vconsole-fix-memleak
vconsole: introduce Context and its helper functions
2023-03-24 11:28:00 +01:00
Daan De Meyer 0405e7c5e1 Merge pull request #26956 from yuwata/core-main-arguments-followed-by-equal
core/main: make arguments followed by '='
2023-03-24 11:27:45 +01:00
Yu Watanabe 4669be626d process-util: drop trailing NUls before parsing the nulstr
No functional changes, just refactoring.
2023-03-24 15:21:59 +09:00
Yu Watanabe 55479c208d test: add tests from strv_parse_nulstr_full() 2023-03-24 15:21:59 +09:00
Yu Watanabe a4f66f90ad nulstr-util: introduce strv_parse_nulstr_full() that optionally drop trailing empty strings 2023-03-24 15:21:59 +09:00