Commit Graph
63392 Commits
Author SHA1 Message Date
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
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
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
Yu Watanabe a3cb11f841 test-proc-cmdline: test proc_cmdline_get_key() actually parses EFI options
Follow-up for 53aa0d02ad.
2023-03-24 15:20:05 +09:00
Yu Watanabe 2a6911bb1f proc-cmdline: make proc_cmdline_parse_given() static
It is used only in proc-cmdline.c and its test. And the test can be
covered by proc_cmdline_parse().
2023-03-24 15:20:05 +09:00
Yu Watanabe 1479799c4d proc-cmdline: use proc_cmdline_key_string() when we search for key 2023-03-24 15:20:05 +09:00
Yu Watanabe b3e9a267ce proc-cmdline: rename variable 2023-03-24 15:20:05 +09:00
Yu Watanabe a175b98171 proc-cmdline: insert an empty line between variable declaration and assertion 2023-03-24 15:20:05 +09:00
Yu Watanabe d2ebd50d7f core/main: make positional arguments followed by '=', then by value
To make ConditionKernelCommandLine= or friend not confused when we are
running in a container.

Addresses https://github.com/systemd/systemd/pull/26887#discussion_r1143358884.
2023-03-24 15:16:21 +09:00
Yu Watanabe 6920049fad core/main: fix maximum number of arguments for shutdown command
Follow-up for c5673ed0de.
2023-03-24 15:16:21 +09:00
Yu Watanabe dfc55e3454 vconsole: introduce context_get_config() helper function
And make keyboard_load_and_wait() and font_load_and_wait() take Context.
2023-03-24 15:07:58 +09:00
Yu Watanabe 8886ca6286 vconsole: introduce Context and its helper functions
Fixes memleaks introduced by 01771226c2
and ea575e176a

Fixes #26945.
2023-03-24 15:07:58 +09:00
Daan De Meyer ba54d73055 chase-symlinks: Use xopenat() instead of open_mkdir_at()
We don't rely on any of the extra functionality of open_mkdir_at()
so let's just use xopenat() directly.
2023-03-23 23:25:33 +00:00
Luca Boccassi 2a775d5faf Merge pull request #26935 from keszybz/test-parse_aux
Add test for auxv parsing
2023-03-23 23:13:42 +00:00
Luca Boccassi d024c4d0e1 Merge pull request #26949 from DaanDeMeyer/xopenat-reopen
loop-util: Add loop_device_make_by_path_at()
2023-03-23 23:08:21 +00:00
Lennart Poettering b839101aac fileio: add new helper fdopen_independent()
This is a combination of fdopen() and fd_reopen(). i.e. it first reopens
the fd, and then converts that into a FILE*.

We do this at various places already manually. let's move this into a
helper call of its own.
2023-03-23 22:48:00 +00:00
Lennart Poettering 05bda20f07 Merge pull request #26953 from poettering/encrypted-cred-mini-refactor
core: minor refactoring of allowlisting TPM devices when encrypted creds are loaded
2023-03-23 21:21:45 +01:00
Lennart Poettering df637af460 pid1: allowlist all tpm devices for a unit when encrypted creds are needed
We might be configured to use some ther device than /dev/tpmrm0, hence
allow them all by allowlisting the tpm char device class as a whole.
2023-03-23 18:22:43 +01:00
Lennart Poettering 50a4217bbe core: move encrypted credential check to execute.c
This is an operation on an ExecContext, hence it probably should be
placed there.
2023-03-23 18:22:27 +01:00
Zbigniew Jędrzejewski-Szmek f39546a881 test-coredump-util: also test parse_auxv() with unaligned data 2023-03-23 18:07:45 +01:00
Zbigniew Jędrzejewski-Szmek 2f809d29e8 test-coredump-util: add tests for parse_aux()
The test files are /proc//auxv files copies from various architecutres
signified by the file name suffix.

Those tests are fairly simple, but when we run them on n architectures, we do
~n² cross-arch tests.
2023-03-23 18:06:46 +01:00
Zbigniew Jędrzejewski-Szmek cb38fdbedb coredump: split out parse_auxv() to src/shared/
No functional change. (We already checked for ELFCLASS32 or ELFCLASS64 before,
so even though there's a new check for other architectures, the only caller
only passes ELFCLASS32 or ELFCLASS64.)
2023-03-23 18:04:22 +01:00
Daan De Meyer 972c8db589 loop-util: Add loop_device_make_by_path_at()
On top of taking a directory file descriptor, we use xopenat() so
that the function can also be used to work on existing file
descriptors to image files including all the logic to use O_DIRECT
and fallback to O_RDONLY if needed.
2023-03-23 17:36:17 +01:00
Daan De Meyer 06ca2db39d fs-util: Allow xopenat() to reopen existing file descriptors 2023-03-23 17:31:55 +01:00