Frantisek Sumsal [Mon, 25 Dec 2023 11:40:06 +0000 (12:40 +0100)]
test: use ERRNO_IS_NEG_NOT_SUPPORTED() in one more place
Frantisek Sumsal [Mon, 25 Dec 2023 11:18:02 +0000 (12:18 +0100)]
killall: fix errno check
Frantisek Sumsal [Mon, 25 Dec 2023 11:14:20 +0000 (12:14 +0100)]
network: ENOTSUP -> EOPNOTSUPP
Frantisek Sumsal [Mon, 25 Dec 2023 10:52:39 +0000 (11:52 +0100)]
tree-wide: shorten a couple of ternary expressions
Frantisek Sumsal [Mon, 25 Dec 2023 10:46:28 +0000 (11:46 +0100)]
tree-wide: drop !! casts to booleans
Frantisek Sumsal [Mon, 25 Dec 2023 10:43:27 +0000 (11:43 +0100)]
coccinelle: properly drop braces around single-statement if()s
Frantisek Sumsal [Mon, 25 Dec 2023 10:43:02 +0000 (11:43 +0100)]
coccinelle: fix the log-json rule
As it generated very questionable results.
Frantisek Sumsal [Mon, 25 Dec 2023 10:28:26 +0000 (11:28 +0100)]
coccinelle: rework how we run the Coccinelle transformations
Turns out that the original way we did things was quite broken, as it
skipped a _lot_ of code. This was because we just threw everything into
one pile and tried to spatch it, but this made Coccinelle sad, like when
man page examples redefined some of our macros, causing typedef
conflicts.
For example, with a minimal reproducer that defines a cleanup macro in
two source files, Coccinelle has no issues when spatch-ing each one
separately:
$ spatch --verbose-parsing --sp-file zz-drop-braces.cocci main.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c
SPECIAL NAMES: adding _cleanup_ as a attribute with arguments
SPECIAL NAMES: adding _cleanup_free_ as a attribute
$ spatch --verbose-parsing --sp-file zz-drop-braces.cocci
logcontrol-example.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: logcontrol-example.c
SPECIAL NAMES: adding _cleanup_ as a attribute with arguments
But when you try to spatch both of them at once, Coccinelle starts
complaining and skipping the "bad" code:
$ spatch --verbose-parsing --sp-file zz-drop-braces.cocci main.c logcontrol-example.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c logcontrol-example.c
SPECIAL NAMES: adding _cleanup_ as a attribute with arguments
SPECIAL NAMES: adding _cleanup_free_ as a attribute
remapping: _cleanup_ to an ident in macro name
ERROR-RECOV: found sync end of #define, line 44
parsing pass2: try again
ERROR-RECOV: found sync end of #define, line 44
parse error
= File "logcontrol-example.c", line 44, column 21, charpos = 1719
around = '__attribute__',
whole content = #define _cleanup_(f) __attribute__((cleanup(f)))
badcount: 2
bad: #include <systemd/sd-journal.h>
bad:
BAD:!!!!! #define _cleanup_(f) __attribute__((cleanup(f)))
This was, unfortunately, hidden as it is visible only with
--verbose-parsing (or --parse-error-msg).
Another issue was how we handled includes. The original way of throwing
them into the pile of source files doesn't really work, leading up to
similar issues as above. The better way is to let Coccinelle properly
resolve all includes by telling it where to find our own include files
(basically the same thing we already do during compilation).
After fixing all this, Coccinelle now has a chance to process much more
of our code (there are still some issues in more complex macros, but
that requires further investigation). However, there's a huge downside
from all of this - doing a _proper_ code analysis is surprisingly time
and resource heavy; meaning that processing just one Coccinelle rule now
takes 15 - 30 minutes.
To make this slightly less painful, Coccinelle supports caching the
generated ASTs, which actually helps a lot - it gets the runtime of one
rule from 15 - 30 minutes down to ~1 minute. It, of course, has its own
downside - the cache is _really_ big (ATTOW the cache takes ~15 GiB).
However, even with the aggressive AST caching you're still looking at
~1 hour for one full Coccinelle run, which is a bit annoying, but I
guess that's the price of doing things _properly_ (but I'll definitely
look into ways of further optimizing this).
Yu Watanabe [Sun, 24 Dec 2023 15:19:14 +0000 (00:19 +0900)]
Merge pull request #30620 from mrc0mmand/more-test-tweaks
test: a couple of fixes for failing tests
Frantisek Sumsal [Sun, 24 Dec 2023 13:49:23 +0000 (14:49 +0100)]
busctl: avoid asserting on NULL message
Avoid passing a NULL message to sd_bus_message_is_signal(), to not trip
over an assertion:
[ 132.869436] H testsuite-82.sh[614]: + systemctl --no-block --check-inhibitors=yes soft-reboot
[ 132.967386] H systemd[1]: Created slice system-systemd\x2dcoredump.slice.
[ 133.018292] H systemd[1]: Starting inhibit.service...
[ 133.122610] H systemd[1]: Started systemd-coredump@0-665-0.service.
[ 133.163643] H systemd[1]: Started inhibit.service.
[ 133.206836] H testsuite-82.sh[614]: + exec sleep infinity
[ 133.236762] H systemd-logind[611]: The system will reboot now!
[ 135.891607] H systemd-coredump[667]: [🡕] Process 663 (busctl) of user 0 dumped core.
Stack trace of thread 663:
#0 0x00007f2ec45e6acf raise (libc.so.6 + 0x4eacf)
#1 0x00007f2ec45b9ea5 abort (libc.so.6 + 0x21ea5)
#2 0x00007f2ec4b5c9a6 log_assert_failed (libsystemd-shared-255.so + 0x1ff9a6)
#3 0x00007f2ec4b5dca5 log_assert_failed_return (libsystemd-shared-255.so + 0x200ca5)
#4 0x00007f2ec4bb3df6 sd_bus_message_is_signal (libsystemd-shared-255.so + 0x256df6)
#5 0x000000000040e478 monitor (busctl + 0xe478)
#6 0x000000000040e82f verb_monitor (busctl + 0xe82f)
#7 0x00007f2ec4b202cb dispatch_verb (libsystemd-shared-255.so + 0x1c32cb)
#8 0x00000000004074fa busctl_main (busctl + 0x74fa)
#9 0x0000000000407525 run (busctl + 0x7525)
#10 0x000000000040ff67 main (busctl + 0xff67)
#11 0x00007f2ec45d2d85 __libc_start_main (libc.so.6 + 0x3ad85)
#12 0x00000000004044be _start (busctl + 0x44be)
ELF object binary architecture: AMD x86-64
[ 136.141152] H dbus-daemon[634]: [system] Monitoring connection :1.2 closed.
[ 136.152233] H systemd[1]: busctl.service: Main process exited, code=dumped, status=6/ABRT
[ 136.153996] H systemd[1]: busctl.service: Failed with result 'core-dump'.
The asertion in question:
Assertion 'm' failed at src/libsystemd/sd-bus/bus-message.c:1015, function sd_bus_message_is_signal(). Aborting.
We can get a NULL message here through sd_bus_process() ->
bus_process_internal() -> process_running(), so let's handle this case
appropriately.
Frantisek Sumsal [Sun, 24 Dec 2023 11:53:53 +0000 (12:53 +0100)]
test: flush the socket once the triggered unit exits
Since the triggered unit intentionally fails without consuming any data
from the socket, we'd try to trigger it again and again, and we might
try to check the unit state in one of the "in-between" states, failing
the test:
[ 165.271698] H testsuite-07.sh[1032]: + systemctl start badbin_assert.socket
[ 165.977637] H testsuite-07.sh[1032]: + socat - ABSTRACT-CONNECT:badbin_assert.socket
[ 165.983787] H systemd[1]: Cannot find unit for notify message of PID 1039, ignoring.
[ 166.817187] H testsuite-07.sh[1032]: + timeout 10 sh -c 'while systemctl is-active badbin_assert.service; do sleep .5; done'
[ 167.049218] H testsuite-07.sh[1065]: active
[ 167.146854] H systemd[1]: Listening on badbin_assert.socket.
[ 167.163473] H systemd[1]: badbin_assert.socket: Incoming traffic
[ 167.542626] H systemd[1]: Cannot find unit for notify message of PID 1065, ignoring.
[ 167.543437] H (badbin)[1062]: badbin_assert.service: Failed to execute /tmp/badbin: Exec format error
[ 167.548346] H systemd[1]: badbin_assert.service: Main process exited, code=exited, status=203/EXEC
[ 167.549482] H systemd[1]: badbin_assert.service: Failed with result 'exit-code'.
[ 167.561537] H systemd[1]: badbin_assert.socket: Incoming traffic
[ 167.933390] H systemd[1]: Started badbin_assert.service.
[ 167.950489] H (badbin)[1070]: badbin_assert.service: Failed to execute /tmp/badbin: Exec format error
[ 167.956318] H systemd[1]: badbin_assert.service: Main process exited, code=exited, status=203/EXEC
[ 167.957173] H systemd[1]: badbin_assert.service: Failed with result 'exit-code'.
[ 167.974609] H systemd[1]: badbin_assert.socket: Incoming traffic
[ 168.042838] H testsuite-07.sh[1072]: failed
[ 168.094431] H testsuite-07.sh[1075]: ++ systemctl show -P ExecMainStatus badbin_assert.service
[ 168.704022] H systemd[1]: Started badbin_assert.service.
[ 168.778680] H (badbin)[1074]: badbin_assert.service: Failed to execute /tmp/badbin: Exec format error
[ 168.826881] H systemd[1]: badbin_assert.service: Main process exited, code=exited, status=203/EXEC
[ 168.833825] H systemd[1]: badbin_assert.service: Failed with result 'exit-code'.
[ 168.923931] H testsuite-07.sh[1032]: + [[ 0 == 203 ]]
[ 168.951492] H systemd[1]: Cannot find unit for notify message of PID 1075, ignoring.
[ 168.999862] H testsuite-07.sh[615]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-07.issue-30412.sh failed'
[ 168.999862] H testsuite-07.sh[615]: Subtest /usr/lib/systemd/tests/testdata/units/testsuite-07.issue-30412.sh failed
Follow-up for
1eeaa93de36 and
28a2d27650c.
Yu Watanabe [Sun, 24 Dec 2023 10:27:26 +0000 (19:27 +0900)]
Merge pull request #30615 from dtardon/docbook-valid-1
DocBook validation fixes (part 1)
David Tardon [Sun, 24 Dec 2023 09:46:55 +0000 (10:46 +0100)]
man: adjust indentation
David Tardon [Sat, 23 Dec 2023 15:39:37 +0000 (16:39 +0100)]
man: use the right element for untitled example
David Tardon [Sat, 23 Dec 2023 15:04:11 +0000 (16:04 +0100)]
man: fix markup
David Tardon [Sat, 23 Dec 2023 14:40:42 +0000 (15:40 +0100)]
man: fix option value
David Tardon [Sat, 23 Dec 2023 14:21:58 +0000 (15:21 +0100)]
man: fix markup
David Tardon [Sat, 23 Dec 2023 17:08:34 +0000 (18:08 +0100)]
man: drop stray empty paragraph
David Tardon [Sat, 23 Dec 2023 13:58:45 +0000 (14:58 +0100)]
man: wrap sentinel in <parameter>
David Tardon [Sat, 23 Dec 2023 13:01:02 +0000 (14:01 +0100)]
man: use just one <listitem> for the description
<varlistentry> allows one or more <term>s, but exactly one <listitem>.
David Tardon [Sat, 23 Dec 2023 12:46:39 +0000 (13:46 +0100)]
man: wrap the whole description in <listitem>
Unfortunately, version-info includes and standard-options includes are
not composable...
David Tardon [Sat, 23 Dec 2023 12:38:40 +0000 (13:38 +0100)]
man: move misplaced </varlistentry>
David Tardon [Sat, 23 Dec 2023 12:25:57 +0000 (13:25 +0100)]
man: move </listitem> to the right position
David Tardon [Sat, 23 Dec 2023 11:25:06 +0000 (12:25 +0100)]
man: add missing <listitem>
David Tardon [Sat, 23 Dec 2023 10:19:52 +0000 (11:19 +0100)]
man: add missing <cmdsynopsis> wrapper
David Tardon [Sat, 23 Dec 2023 09:05:38 +0000 (10:05 +0100)]
man: add required <title>
David Tardon [Sat, 23 Dec 2023 08:57:43 +0000 (09:57 +0100)]
man: match doctype and root element
Luca Boccassi [Sat, 23 Dec 2023 23:26:13 +0000 (00:26 +0100)]
Merge pull request #30594 from yuwata/udev-timeout-cleanups
udev: several cleanups for timeout settings
Luca Boccassi [Sat, 23 Dec 2023 23:23:35 +0000 (00:23 +0100)]
Merge pull request #30596 from yuwata/sd-device-db-cleanups
sd-device: several cleanups for udev database related functions
Luca Boccassi [Sat, 23 Dec 2023 08:56:31 +0000 (09:56 +0100)]
meson: check for pefile dependency before enabling ukify
ukify (and all the tests, including the autogenerated check-version-ukify)
does not work unless pefile is available, so track it as a dependency
in meson to avoid unit test failures later
Yu Watanabe [Sat, 23 Dec 2023 21:44:31 +0000 (06:44 +0900)]
Merge pull request #30609 from YHNdnzj/analyze-fdstore
analyze-fdstore: minor fixups
Yu Watanabe [Sat, 23 Dec 2023 18:29:07 +0000 (03:29 +0900)]
core/executor: use log level specified in LogLevelMax=
Follow-up for
cc9f4cad8cd759ab55048dc7a3eaa2c2fb0344da.
Otherwise, still unexpected lines may be logged by executor.
Mike Yuan [Sat, 23 Dec 2023 20:25:03 +0000 (04:25 +0800)]
analyze-fdstore: don't log duplicate error
table_print_with_pager() logs print error internally.
Mike Yuan [Sat, 23 Dec 2023 20:26:16 +0000 (04:26 +0800)]
analyze-fdstore: ignore table header when checking stored fd count
Yu Watanabe [Sat, 23 Dec 2023 16:32:29 +0000 (01:32 +0900)]
systemctl: swap cached_id_map and cached_name_map at one more place
Follow-up for
2962a508508564ec35f231bd4246846d6d057115.
Fortunately, this does not change any behavior.
Replaces #30601.
Fixes CID#
1532831.
Yu Watanabe [Sat, 23 Dec 2023 18:40:50 +0000 (03:40 +0900)]
Merge pull request #30604 from mrc0mmand/test-journal-shenanigans
test: redirect stdout/stderr of TEST-04-JOURNAL to console as well
Yu Watanabe [Sat, 23 Dec 2023 18:40:22 +0000 (03:40 +0900)]
Merge pull request #30587 from mrc0mmand/test-stuff
test: slightly extend uid0's coverage
Raito Bezarius [Thu, 21 Dec 2023 18:48:04 +0000 (19:48 +0100)]
networkd: support `proxy_arp_pvlan` sysctl
The proxy ARP private VLAN sysctl is useful for VLAN aggregation, see
https://sysctl-explorer.net/net/ipv4/proxy_arp_pvlan/ for details.
Yu Watanabe [Sat, 23 Dec 2023 18:39:18 +0000 (03:39 +0900)]
Merge pull request #30049 from yuwata/assert-return-critical
test: make assert_return() critical by default
Yu Watanabe [Mon, 20 Nov 2023 03:22:08 +0000 (12:22 +0900)]
network: use json_variant_append_arrayb()
No functional change, just refactoring and shortening code.
Yu Watanabe [Fri, 17 Nov 2023 19:18:44 +0000 (04:18 +0900)]
log: make assert_return() critical when -Dmode=developer
Triggering assert_return() should be a bug in general, and we should
really fix that. But, previously, it is hard to notice such bug, as
it was not critical.
This is for making CI or our testing environment fail if we unexpectedly
trigger assert_return(). So, hopefully we can easily find such bugs.
Yu Watanabe [Sat, 23 Dec 2023 16:49:57 +0000 (01:49 +0900)]
test: make assert_return() critical by default on fuzzer and unit tests
Several test cases intentionally trigger assert_return(). So, to avoid
the entire test fails, this introduces several macros that tentatively
make assert_return() not critical.
Yu Watanabe [Thu, 16 Nov 2023 01:48:37 +0000 (10:48 +0900)]
log: introduce a knob to make assert_return() critical
These can be used to check if we trigger assert_return()
unexpectedly.
Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
Frantisek Sumsal [Fri, 22 Dec 2023 13:16:56 +0000 (14:16 +0100)]
test: make the variable names slightly more descriptive
Follow-up for
5ca8d2474ca8b8b3f42999fb2f6e5e1498b22aa9.
Frantisek Sumsal [Fri, 22 Dec 2023 13:09:58 +0000 (14:09 +0100)]
test: slightly extend uid0's coverage
Frantisek Sumsal [Fri, 22 Dec 2023 12:16:06 +0000 (13:16 +0100)]
test: make the test actually test
Follow-up for
dd25a95763e6ee52d40f4012ffeb2ce719f26b8d.
Yu Watanabe [Sat, 23 Dec 2023 15:27:20 +0000 (00:27 +0900)]
Merge pull request #30603 from mrc0mmand/openssl-shenanigans
test/ukify: make the tests happy with OpenSSL 3.2.0+
Frantisek Sumsal [Sat, 23 Dec 2023 14:35:26 +0000 (15:35 +0100)]
test: redirect stdout/stderr of TEST-04-JOURNAL to console as well
This effectively reverts
fa6f37c043 just for TEST-04, as we nuke the
journal repeatedly in this test which makes it particularly hard to
debug. Let's hope the issue behind
fa6f37c043 won't bite us back in this
case.
Follow-up for:
fa6f37c043
Reverts:
8f7c876bdc
Frantisek Sumsal [Sat, 23 Dec 2023 14:11:11 +0000 (15:11 +0100)]
test: don't truncate the final journal
This is no longer necessary, as the test for which this was introduced
in the first place has this handled explicitly (testsuite-04.journal.sh).
Follow-up to
9457dd8bae.
Frantisek Sumsal [Sat, 23 Dec 2023 12:33:11 +0000 (13:33 +0100)]
test: make sure the dummy CA certificate is marked as such
With OpenSSL 3.2.0+ this is necessary, otherwise the verification
of such CA certificate fails badly:
$ openssl s_client -CAfile /run/systemd/remote-pki/ca.crt -connect localhost:19532
...
Connecting to ::1
CONNECTED(
00000003)
Can't use SSL_get_servername
depth=1 C=CZ, L=Brno, O=Foo, OU=Bar, CN=Test CA
verify error:num=79:invalid CA certificate
verify return:1
depth=1 C=CZ, L=Brno, O=Foo, OU=Bar, CN=Test CA
verify error:num=26:unsuitable certificate purpose
verify return:1
...
---
SSL handshake has read 1566 bytes and written 409 bytes
Verification error: unsuitable certificate purpose
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
This TLS version forbids renegotiation.
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 26 (unsuitable certificate purpose)
Frantisek Sumsal [Sat, 23 Dec 2023 11:20:03 +0000 (12:20 +0100)]
ukify: make the test happy with the latest OpenSSL
Which dropped some whitespaces in the output:
$ openssl version
OpenSSL 3.2.0 23 Nov 2023 (Library: OpenSSL 3.2.0 23 Nov 2023)
$ openssl x509 -in cert.pem -text -noout | grep Issuer
Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd
$ openssl version
OpenSSL 3.0.9 30 May 2023 (Library: OpenSSL 3.0.9 30 May 2023)
$ openssl x509 -in cert.pem -text -noout | grep Issuer
Issuer: C = XX, L = Default City, O = Default Company Ltd
Making test-ukify unhappy:
> assert 'Issuer: CN = SecureBoot signing key on host' in out
E AssertionError: assert 'Issuer: CN = SecureBoot signing key on host' in '<...snip...>Issuer: CN=SecureBoot signing key on host archlinux2\n...'
Yu Watanabe [Sat, 23 Dec 2023 10:08:31 +0000 (19:08 +0900)]
Merge pull request #30600 from dtardon/see-also-simplelist
man: use `<simplelist>` for 'See also' sections
Luca Boccassi [Fri, 22 Dec 2023 20:58:04 +0000 (21:58 +0100)]
man: conditionalize sd-pcrlock and sd-measure on the same variable as their binaries
The binaries are built and installed if HAVE_TPM2 is set, and ignore ENABLE_BOOTLOADER,
so do the same for the manpages.
For the sd-pcrlock case this also installs the manpage aliases for the units, which
are not installed with -Dbootloader=disabled, but there's no way to conditionalize
the aliases, so on balance it's better to have too much documentation rather than
too little.
Fixes https://github.com/systemd/systemd/issues/30588
David Tardon [Fri, 22 Dec 2023 20:04:12 +0000 (21:04 +0100)]
man: capitalize "also" for consistency
Almost all our man pages write it that way.
David Tardon [Fri, 22 Dec 2023 18:09:32 +0000 (19:09 +0100)]
man: use <simplelist> for 'See also' sections
This is just a slight markup improvement; there should be no difference
in rendering.
Yu Watanabe [Tue, 19 Dec 2023 05:15:07 +0000 (14:15 +0900)]
udev: use SD_EVENT_SIGNAL_PROCMASK
Luca Boccassi [Fri, 22 Dec 2023 22:35:27 +0000 (23:35 +0100)]
Merge pull request #30590 from yuwata/backlight-cleanups
backlight: several cleanups and use dispatch_verb()
Yu Watanabe [Fri, 22 Dec 2023 19:49:26 +0000 (04:49 +0900)]
TODO: fix typo
Yu Watanabe [Wed, 22 Nov 2023 04:05:26 +0000 (13:05 +0900)]
sd-device: introduce device_has_db() helper function
Yu Watanabe [Wed, 22 Nov 2023 03:57:45 +0000 (12:57 +0900)]
sd-device: modernize device_update_db() and friends
- introduce device_should_have_db(),
- split out device_get_db_path(),
- update log messages, especially clarify which stage is failed,
- use _cleanup_(unlink_and_freep) attribute,
- clear existing database file also when failed to create database directory
and when failed to create temporary file.
Yu Watanabe [Tue, 19 Dec 2023 04:58:35 +0000 (13:58 +0900)]
udev-spawn: slightly adjust logs about timed out commands
- Add full stop to the messages.
- Do not kill commands before logging "killing", but do after.
Yu Watanabe [Tue, 19 Dec 2023 03:15:25 +0000 (12:15 +0900)]
udev: refuse too short timeout value
Setting zero or too short timeout for each uevent is meaningless, and
causes the system fails to boot. Let's refuse such values.
Also, delaying execution of RUN= commands too long also makes many
uevents enter the failed state. So, let's refuse such misconfiguration.
Yu Watanabe [Tue, 19 Dec 2023 03:28:53 +0000 (12:28 +0900)]
udev: handle event_timeout=infinity correctly
This is a paranoia, as even USEC_INFINITY / 3 is finite, it is still so large
in general.
Yu Watanabe [Tue, 19 Dec 2023 03:27:53 +0000 (12:27 +0900)]
udev-manager: use ASSERT_PTR()
Matt Layher [Thu, 30 Nov 2023 15:01:28 +0000 (10:01 -0500)]
network: use varlink for networkctl check_netns_match()
Use varlink to detect networkd's network namespace when executing
networkctl rather than the D-Bus interface.
Signed-off-by: Matt Layher <mdlayher@gmail.com>
Yu Watanabe [Thu, 21 Dec 2023 19:36:34 +0000 (04:36 +0900)]
backlight: split out verb_load() and verb_save(), then use dispatch_verb()
No functional change, just refactoring.
Yu Watanabe [Fri, 22 Dec 2023 00:42:45 +0000 (09:42 +0900)]
backlight: use WRITE_STRING_FILE_MKDIR_0755 flag on save
No functional change, just refactoring.
Yu Watanabe [Thu, 21 Dec 2023 19:29:54 +0000 (04:29 +0900)]
backlight: split out read_saved_brightness()
No functional change, just refactoring.
Yu Watanabe [Thu, 21 Dec 2023 19:24:31 +0000 (04:24 +0900)]
backlight: split out device_new_from_arg()
While at it, this replaces strndupa_safe() with strndup(), as the input
is a user-controlled string.
No functional change, just refactoring.
Yu Watanabe [Thu, 21 Dec 2023 19:21:25 +0000 (04:21 +0900)]
backlight: split out build_save_file_path()
No functional change, just refactoring.
Yu Watanabe [Thu, 21 Dec 2023 19:17:06 +0000 (04:17 +0900)]
backlight: move validity check of max_brightness to get_max_brightness()
Also rename get_max_brightness() -> read_max_brightness() for
consistency with read_brightness().
Yu Watanabe [Fri, 22 Dec 2023 18:19:19 +0000 (03:19 +0900)]
Merge pull request #30585 from YHNdnzj/isatty-handling
various: clean up isatty() handling
Mike Yuan [Fri, 22 Dec 2023 10:28:55 +0000 (18:28 +0800)]
various: clean up isatty() handling
As per https://github.com/systemd/systemd/pull/30547#discussion_r1434371627
Mike Yuan [Fri, 22 Dec 2023 09:59:39 +0000 (17:59 +0800)]
terminal-util: introduce isatty_safe that rejects EBADF
Mike Yuan [Fri, 22 Dec 2023 10:32:24 +0000 (18:32 +0800)]
terminal-util: use RET_GATHER more
Luca Boccassi [Fri, 22 Dec 2023 12:28:51 +0000 (13:28 +0100)]
test: fix check for device in test-execute
The unit actually uses /dev/kmsg, not /dev/kvm
Follow-up for
ae7482b994e6a9bc8e
Luca Boccassi [Fri, 22 Dec 2023 09:44:39 +0000 (10:44 +0100)]
Merge pull request #30550 from yuwata/network-nexthop-cleanups-3
network: several cleanups for nexthop (part3)
Yu Watanabe [Thu, 21 Dec 2023 21:52:46 +0000 (06:52 +0900)]
systemctl: swap cached_id_map and cached_name_map
These are unused or used in the same order. So, this patch does not
change any behavior, just for naming consistency with the function
prototype.
Closes #30570.
Lennart Poettering [Mon, 20 Nov 2023 11:07:13 +0000 (12:07 +0100)]
networkd: add basic Varlink interface
Let's get networkd onto Varlink. This only adds the most basic of
operations.
I'd love to see networkd do Varlink for all its basic operations so that
networkctl can use that, and work correctly before D-Bus is up. Right
now, many of networkctls calls simply don't work before D-Bus, and I'd
like to see that improved.
Lennart Poettering [Thu, 21 Dec 2023 13:12:09 +0000 (14:12 +0100)]
service: don't try to determine selinux label for socket activation if RootImage= is used
We cannot determine the SELinux label ahead of time if RootImage= is
used, since we'd have to mount the image then, hence don't, and handle
this cleanly, and gracefully.
While we are at it, stop "reaching over" so much from the socket code to
the service code, and instead provide function that most of the hard
work in service.c that socket.c just calls.
While we are at it, add debug logging and stuff.
I noticed the issue when also noticing #30560, but that one is harder to
fix, hence I avoided it for now.
Yu Watanabe [Fri, 22 Dec 2023 02:50:56 +0000 (11:50 +0900)]
Merge pull request #30553 from yuwata/network-post-event-source
network: merge two post event sources
Yu Watanabe [Fri, 22 Dec 2023 02:50:44 +0000 (11:50 +0900)]
Merge pull request #30541 from yuwata/network-address-empty
network/address: make Address= in [Network] support an empty string
Luca Boccassi [Thu, 21 Dec 2023 22:44:17 +0000 (23:44 +0100)]
Merge pull request #30575 from arthurzam/bash
bash-completion: add some missing options
Lennart Poettering [Thu, 21 Dec 2023 21:47:54 +0000 (22:47 +0100)]
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
fstab-generator: disable default deps if x-systemd.{wanted,required}-by= is used
Lennart Poettering [Thu, 21 Dec 2023 21:45:40 +0000 (22:45 +0100)]
Merge pull request #28658 from H5117/enroll_with_ec
cryptsetup: Add support for EC keys in PKCS#11 tokens
Lennart Poettering [Thu, 21 Dec 2023 21:45:15 +0000 (22:45 +0100)]
Merge pull request #30547 from poettering/uid0
add new "uid0" command as alternative multi-call interface for systemd-run, as sudo replacement
Daan De Meyer [Thu, 21 Dec 2023 18:46:54 +0000 (19:46 +0100)]
Drop /dev test in test-mountpoint-util
Even /dev isn't always guaranteed to be a mount point, so let's drop
this part of the test.
Arthur Zamarin [Thu, 21 Dec 2023 21:23:13 +0000 (23:23 +0200)]
bash-completion: add missing option to systemd-confext
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Arthur Zamarin [Thu, 21 Dec 2023 21:13:35 +0000 (23:13 +0200)]
bash-completion: add missing option to systemd-cgls
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Arthur Zamarin [Thu, 21 Dec 2023 21:07:05 +0000 (23:07 +0200)]
bash-completion: add missing option to systemd-cat
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Yu Watanabe [Thu, 21 Dec 2023 20:30:23 +0000 (05:30 +0900)]
Merge pull request #30568 from poettering/creds-varlink
creds: add varlink interface to encrypt/decrypt credentials
Yu Watanabe [Thu, 21 Dec 2023 20:28:36 +0000 (05:28 +0900)]
Merge pull request #30566 from poettering/varlink-inval-param
add a new helper varlink_error_invalid_parameter_name(), and make more use of the existing varlink_error_invalid_parameter()
Lennart Poettering [Wed, 22 Nov 2023 17:56:19 +0000 (18:56 +0100)]
polkit: simplify bus_verify_polkit_async() + drop auth-by-cap dbus feature
This simplifies bus_verify_polkit_async() and related calls quite a bit:
1. This removes any support for authentication-by-Linux-capability. This
is ultimately a kdbus leftover: with classic AF_UNIX transports we
cannot authenticate by capabilities securely (because we cannot
acquire it from the peer without races), hence we never actually did.
Since the necessary kernel work didn't materialize in the last 10y,
and is unlikely to be added, let's just kill this context. We cannot
quite remove the caps stuff from sd-bus for API compat, but for our
polkit logic let's kill it.
2. The "good_uid" and "interactive" params are only necessary in very
few cases, hence let's move them to a new call
bus_verify_polkit_async_full() and make bus_verify_polkit_async() a
wrapper around it without those two parameters.
This also fixes a bunch of wrong uses of the "interactive" bool. The
bool makes no sense today as the ALLOW_INTERACTIVE_AUTHORIZATION field
in the D-Bus message header replaces it fully. We only need it to
implement method calls we introduced prior to that header field becoming
available in D-Bus. And it should only be used on such old method calls,
and otherwise always be set to false.
This does not change behaviour in any way. Just simplifies stuff.
Fixes: #21586
Lennart Poettering [Thu, 21 Dec 2023 14:47:26 +0000 (15:47 +0100)]
varlink: make use of varlink_error_invalid_parameter() helper where appropriate
Lennart Poettering [Thu, 23 Nov 2023 21:24:20 +0000 (22:24 +0100)]
varlink: add helper varlink_error_invalid_parameter_name()
Lennart Poettering [Fri, 24 Nov 2023 15:30:15 +0000 (16:30 +0100)]
test: add simple creds/varlink integration test
Lennart Poettering [Thu, 23 Nov 2023 21:22:27 +0000 (22:22 +0100)]
creds: add varlink API for encrypting/decrypting credentials
Lennart Poettering [Thu, 23 Nov 2023 21:24:20 +0000 (22:24 +0100)]
varlink: add helper varlink_error_invalid_parameter_name()
Lennart Poettering [Wed, 20 Dec 2023 10:58:02 +0000 (11:58 +0100)]
update TODO
Lennart Poettering [Wed, 20 Dec 2023 18:10:13 +0000 (19:10 +0100)]
test: add minimal integration test coverage for uid0 tool