Commit Graph
100 Commits
Author SHA1 Message Date
David Tardon 1d75afb798 hwdb: fix modalias
This line matches only if svn is the first field, but DMI modaliases
normally begin with BIOS fields such as bvn/bvr/bd. Use a wildcard like
other similar entries in the file.

Follow-up-for: 0aaea4b376
2026-08-12 13:30:36 +02:00
David Tardon ef3a8760cc hwdb: fix modalias
I'm not sure if these leading zeros matter or not, but the description
at the top of the file clearly says that the numbers are 4-digit. The
author of this entry also mentions evdev:input:b0003v1020p0501* in the
PR that added it.

Follow-up-for: 4ae4470ad9
2026-08-12 12:57:42 +02:00
David Tardon 5d0488ab0f integritysetup: regularize conversion of integrity alg.
The number of integrity algorithms we handle whose names differ between
integritysetup and dm-integrity continually increases, so let's drop the
ad hoc conversion and use string tables.
2026-03-20 17:12:29 +01:00
David Tardon 55bf0766a1 coccinelle: fix exclusion path
This file was moved 5 years ago...

Follow-up for commits 99b9f8fddd and
6dcabd5f5e .
2026-03-17 09:26:55 +00:00
David Tardon a11278ce63 test: fix test with -Dnetworkd=false
User and group systemd-network are created from
sysusers.d/systemd-network.conf, which is only copied into the test
image when building with -Dnetworkd=true. This means that if
-Dnetworkd=false is used, the user and the group don't exist, which
causes the test to fail.

Use a locally created user and group to avoid that.
2026-01-29 21:12:34 +09:00
David Tardon 085c2a2338 manager-serialize: add logging for ENOMEM 2025-12-10 18:59:44 +09:00
David Tardon 94446e4f5a tree-wide: flatten nested error checks 2025-12-10 18:59:44 +09:00
David Tardon 7cfd4f3f51 find-esp: consistently quote paths in log messages 2025-12-09 14:36:31 +09:00
David Tardon 50482aced5 find-esp: replace assert by a runtime check
The path--as a whole--is no longer being opened with O_DIRECTORY, hence
the assertion is not valid.

Reproducer:
 # SYSTEMD_RELAX_ESP_CHECKS=1 bootctl list --esp-path=`pwd`/README
 Assertion 'S_ISDIR(sxa.stx_mode)' failed at src/shared/find-esp.c:295, function verify_fsroot_dir(). Aborting.

Follow-up-for: 63105f33ed

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2417917
2025-12-09 14:36:31 +09:00
David Tardon d23a7eb4c0 udev-rules: use the right variable
We carefully prepare a copy of a local buffer to save in device cache
and then save the buffer there instead... This leads to abort in free()
on exit (also, copied is leaked).

Reproducer:
 # udevadm test /sys/block/sr0

Follow-up-for: a9559ebcbc

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2406118
2025-12-06 02:29:24 +09:00
David Tardon 8fc02a8cfd logind-dbus: avoid assertion on HandlePowerKey=factory-reset
The factory-reset action is handled together with the various
sleep/shutdown actions, but its not either one.

Fixes #39385
2025-11-16 17:00:53 +09:00
David Tardon 399c9f847e ask-password-api: return if read_credential() failed
The current code causes assertion in strv_parse_nulstr() if
read_credential() results in an error different from ENXIO or ENOENT
(strace shows I'm getting EACCES):

 # homectl create waldo --real-name=Waldo --disk-size=200M

Before:

 Assertion 's || l <= 0' failed at src/basic/nulstr-util.c:32, function strv_parse_nulstr_full(). Aborting.

After:

 Failed to acquire password: Permission denied

Follow-up-for: 8806bb4bc7
2025-11-06 14:23:35 +01:00
David Tardon 5efcbae259 homectl: fix memory leak
# valgrind --leak-check=full homectl create waldo --real-name=Waldo --disk-size=200M --setopt=FOO=bar

Before:

==25155== HEAP SUMMARY:
==25155==     in use at exit: 12,879 bytes in 39 blocks
==25155==   total heap usage: 90 allocs, 51 frees, 53,964 bytes allocated
==25155==
==25155== 8 bytes in 1 blocks are definitely lost in loss record 4 of 38
==25155==    at 0x4845866: malloc (vg_replace_malloc.c:446)
==25155==    by 0x547FC2E: strdup (strdup.c:42)
==25155==    by 0x4B2647C: strv_env_replace_strdup_passthrough (env-util.c:435)
==25155==    by 0x42D547: parse_argv (homectl.c:3909)
==25155==    by 0x43999C: run (homectl.c:5606)
==25155==    by 0x4399F5: main (homectl.c:5613)
==25155==
==25155== LEAK SUMMARY:
==25155==    definitely lost: 8 bytes in 1 blocks

After:

==25224== HEAP SUMMARY:
==25224==     in use at exit: 12,871 bytes in 38 blocks
==25224==   total heap usage: 90 allocs, 52 frees, 53,964 bytes allocated
==25224==
==25224== LEAK SUMMARY:
==25224==    definitely lost: 0 bytes in 0 blocks

Follow-up-for: aaf057c4bb
2025-11-06 14:21:43 +01:00
David Tardon 188049d38c tree-wide: combine DUMP_STRING_TABLE() and return 2025-10-02 16:19:03 +02:00
David Tardon 365399c4e4 nspawn: inline handle_arg_console() to its only call place 2025-10-02 16:19:03 +02:00
David Tardon 65c4347d6e nspawn: set arguments directly
There's no point in going through handle_arg_console() now that all the
checks have been moved out of it.
2025-10-02 16:19:03 +02:00
David Tardon 99df84ef23 nspawn: postpone selection of console mode
Moving it away from argument parsing code allows to simplify that.
2025-10-02 16:19:03 +02:00
David Tardon 25f1473c81 nspawn: use table to parse --console= 2025-10-02 16:18:41 +02:00
David Tardon 1da7dcf427 main: extract common code to a function 2025-10-02 16:13:40 +02:00
David Tardon f29f6b6b7d userdbctl: use table to parse --output= 2025-10-02 16:13:40 +02:00
David Tardon a5fada5d5d userdbctl: require value for --output=
Currently, when --output= is used with empty string, it resets the mode.
E.g.,

 # userdbctl user --output=json --output= ...

will use the default output mode, not JSON. But that functionality is
not documented and it seems to be of little practical use. Let's just
drop it.
2025-10-02 16:13:40 +02:00
David Tardon 292928e964 vpick-tool: use table to parse --print= 2025-10-02 16:13:40 +02:00
David Tardon 9033f923f9 homectl: use table to parse --export-format= 2025-10-02 16:13:40 +02:00
David Tardon 9b3041d9fe cgtop: rename enum value to match its string repr. 2025-10-02 16:13:20 +02:00
David Tardon 048d813fcd cgtop: use table to parse --cpu= 2025-10-01 16:16:58 +02:00
David Tardon 3a21f6aa6e cgtop: use table to parse --order= 2025-10-01 16:16:47 +02:00
David Tardon 854789543b export: use table to parse --format= 2025-09-29 16:04:12 +02:00
David Tardon 6cdc63d120 udevadm-info: use string table to parse query type 2025-05-09 12:14:21 +09:00
David Tardon 4ef3019ceb udevadm-info: drop args of stat_device()
They are all static vars now, so can be used directly.
2025-05-09 12:14:21 +09:00
David Tardon 8ea3c1fb9e udevadm-info: shorten the code a bit 2025-05-09 12:14:21 +09:00
David Tardon 31767b92a0 udevadm-info: reject devices passed via opts too
Follow-up-for a6b4b2fa01
2025-05-09 12:14:21 +09:00
David Tardon d89b3004da udevadm-info: split arg. parsing into a separate function 2025-05-09 12:14:16 +09:00
David Tardon 86ff972ac3 udevadm-info: drop superfluous pager_open() call
It's already called in advance in info_main().
2025-05-09 12:10:51 +09:00
David Tardon 5b4d73208e udevadm-info: make arg_pager_flags static 2025-05-09 12:10:51 +09:00
David Tardon cb3f6c9e0d udevadm-info: move static dtor closer to args 2025-05-09 12:10:51 +09:00
David Tardon a63822a7e3 udevadm-trigger: use string table to parse scan type 2025-05-09 09:54:27 +09:00
David Tardon bc995d6764 udevadm-trigger: add prefix to enumeration values 2025-05-09 09:54:27 +09:00
David Tardon a07f40e264 udevadm-trigger: replace home-made key/value splitting function 2025-05-09 09:54:25 +09:00
David Tardon f849e85221 test: extend udevadm coverage test a bit 2025-05-09 09:53:50 +09:00
David Tardon 9925193a76 udevadm: allow key without a value 2025-05-09 09:53:50 +09:00
David Tardon f10206a88e udevadm: move key/value parsing func. to udevadm-util.c 2025-05-09 09:53:50 +09:00
David Tardon 5f0ebd9754 udevadm-trigger: split arg. parsing into a separate function 2025-05-09 09:53:40 +09:00
David Tardon 9b65fb8f34 udevadm-trigger: add vertical space to separate cases 2025-05-09 09:44:56 +09:00
David Tardon 536c18e5c3 bus-polkit: shortcut auth. after first denial
A D-Bus/Varlink method can issue PolicyKit auth. requests for multiple
actions; in this case the method is expected to fail on the first one
that is not allowed. This is enforced by asserts in
async_polkit_read_reply(), but that's a wrong place for the check for
two reasons:

1. it doesn't allow to get a meaningful stack trace;
2. sending the query to polkit is already a pointless exercise.

Let's do the check in *_verify_polkit_async_full() and don't send
anything to PolicyKit in that case.

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2349594 .
2025-03-11 17:18:12 +01:00
David Tardon c3dc460b6c execute: free syscall_log hashmap when done
Fixes #35394
2024-11-28 16:45:02 +01:00
David Tardon cd9c3327cb logind-dbus: really cancel scheduled shutdown
Fixes #34554
2024-09-30 15:13:00 +02:00
David Tardon 7a64c5f23e sd-event: do not assert on invalid signal
The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.
2024-07-25 11:57:05 +01:00
David Tardon 639719e010 logind-dbus: check auth. for all inhibitor operations
Fixes #33834
2024-07-25 11:55:39 +01:00
David Tardon 8b6de9e638 test: add a reproducer for #33672 2024-07-12 15:59:20 +02:00
David Tardon 9c63d14771 varlink: fix license
The old license was a copy&paste mistake.
2024-06-27 17:00:00 +02:00
David Tardon bde35f4a91 shell-completion: only offer devices for completion
This skips directories and other stuff like /dev/core, /dev/initctl or
/dev/log.
2024-06-13 00:03:25 +09:00
David Tardon d181939e2e cryptsetup-generator: always process cmdline devices 2024-06-12 18:46:39 +09:00
David Tardon 47c703d949 cryptsetup-generator: parse all cmdline devices too 2024-06-12 18:46:39 +09:00
David Tardon 83813bae7a cryptsetup-generator: continue parsing after error
Let's make the crypttab parser more robust and continue even if parsing
of a line failed.
2024-06-12 18:46:39 +09:00
David Tardon a07cb7d404 cryptsetup-generator: refactor add_crypttab_devices()
Move the processing of a crypttab entry to a separate function.

No functional changes, just refactoring.
2024-06-12 18:46:39 +09:00
David Tardon 119f22526e journald-server: drop another invalid assert()
config_parse_forward_to_socket() is not used for parsing unit files
either.

Follow-up-for: f31cff849d
2024-05-16 10:10:25 +02:00
David Tardon 2ef7cdc425 journald-server: drop invalid assert()
config_parse_compress() is not used for parsing unit files, hence unit
is always NULL.

Fixes #32856

Follow-up-for: 6813be2eba
2024-05-16 10:10:19 +02:00
David Tardon cd35c15de3 clean-ipc: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 75c64e58d1 udev-rules: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 2c30973f0b homework-quota: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 6c936c156a homework-blob: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 11bbc1f8b8 homework-fscrypt: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon bc65a5e37d homed-manager: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 3a5046782e test-bpf-foreign-programs: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 2dd1676fa7 test-bpf-restrict-fs: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 1174ebb45f test-socket-bind: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 192a452d1c nspawn: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 3613a1d49f userns-restrict: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon 422aa53123 cgroup-show: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon af1690cfcc manager: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon be6aa742a6 resolved-dns-stream: pass the right error variable 2024-05-07 13:23:24 +02:00
David Tardon 6400084caa exec-invoke: pass the right error variable 2024-05-07 13:19:42 +02:00
David Tardon ac10f7e28c main: pass the right error variable 2024-05-07 13:18:10 +02:00
David Tardon bad6cb5ae8 bless-boot: pass the right error variable 2024-05-07 13:16:30 +02:00
David Tardon 47eab95ea8 journal-remote-main: pass the right error variable 2024-05-07 13:13:24 +02:00
David Tardon cc4482ee23 discover-image: pass the right error variable 2024-05-07 12:44:03 +02:00
David Tardon dfdcc7c987 test: add a test for #31384 2024-02-19 16:45:19 +00:00
David Tardon dddf640cab test: use dropin dir 2024-01-12 05:12:44 +09:00
David Tardon 810a5895e6 man: update udev.conf man page 2024-01-12 05:12:44 +09:00
David Tardon 09dd8e77fc udev: factor out config parser call into function
... which is then called from both places. This makes sure that the
configuration is parsed by udevd and other tools in exactly the same
way.
2024-01-12 05:12:42 +09:00
David Tardon a1c7dc7d16 udev-util: drop unused function 2024-01-12 05:11:18 +09:00
David Tardon 07f5e35fe7 udev-util: use config. parser to parse udev.conf 2024-01-12 05:11:14 +09:00
David Tardon 343c8514c1 udevd: use config. parser to parse udev.conf
This adds support for the usual config. file hierarchy (including
dropins).

Fixes #30460.
2024-01-12 05:08:18 +09:00
David Tardon 5656cdfeea conf-parser: generalize config_parse_config_file() 2024-01-11 13:24:32 +09:00
David Tardon af29d0b179 man: rewrite as <group> 2023-12-26 13:10:36 +01:00
David Tardon 0fd5f9fb50 man: fix markup
<arg> is not allowed inside <title>.
2023-12-26 13:10:36 +01:00
David Tardon 7f9d96d4c5 man: move </variablelist> to the right place 2023-12-26 13:10:35 +01:00
David Tardon b239fc7250 man: fix <cmdsynopsis> content
Inline text is not allowed.
2023-12-26 13:10:35 +01:00
David Tardon 20dcd73a28 man: fix markup
<option> is not allowed in <cmdsynopsis>.
2023-12-26 13:10:35 +01:00
David Tardon dfa6c32ad9 man: restrict <command> to the actual command 2023-12-26 13:10:35 +01:00
David Tardon 996de3397b man: move macro decls. out of <funcsynopsis>
<funcsynopsis> doesn't allow block content.
2023-12-26 13:10:35 +01:00
David Tardon 932abebf4d man: fix markup
<arg> is not allowed inside <term>.
2023-12-26 13:10:35 +01:00
David Tardon b3579feb59 man: fix indentation 2023-12-26 08:59:53 +01:00
David Tardon 0f095802ad man: add required <title> 2023-12-25 17:59:50 +01:00
David Tardon 70601fa571 man: match doctype and root element 2023-12-25 15:51:47 +01:00
David Tardon eea10b26f7 man: use same version in public and system ident. 2023-12-25 15:51:47 +01:00
David Tardon bc6fdcbf5d man: use <refsect1> instead of <refsection>
DocBook document model doesn't allow mixing of <refsection> with the
numbered variants (<refsect1> etc.). Therefore, any document that
included something from standard-conf.xml was invalid. Fortunately, all
the includes are at the 1st level, hence let's just change
standard-conf.xml to use <refsect1> to fix that.
2023-12-25 10:50:13 +01:00
David Tardon cfcdee7c16 man: drop an extra <member>
Follow-up for 13a69c120b .
2023-12-25 10:43:18 +01:00
David Tardon 9e25422299 man: move macro decls. out of <funcsynopsis>
<funcsynopsis> doesn't allow block content.
2023-12-25 10:40:40 +01:00
David Tardon e353998eb6 man: fix markup 2023-12-25 10:40:40 +01:00