]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agoMerge pull request #30594 from yuwata/udev-timeout-cleanups
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

5 months agoMerge pull request #30596 from yuwata/sd-device-db-cleanups
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

5 months agomeson: check for pefile dependency before enabling ukify
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

5 months agoMerge pull request #30609 from YHNdnzj/analyze-fdstore
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

5 months agocore/executor: use log level specified in LogLevelMax=
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.

5 months agoanalyze-fdstore: don't log duplicate error 30609/head
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.

5 months agoanalyze-fdstore: ignore table header when checking stored fd count
Mike Yuan [Sat, 23 Dec 2023 20:26:16 +0000 (04:26 +0800)] 
analyze-fdstore: ignore table header when checking stored fd count

5 months agosystemctl: swap cached_id_map and cached_name_map at one more place
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.

5 months agoMerge pull request #30604 from mrc0mmand/test-journal-shenanigans
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

5 months agoMerge pull request #30587 from mrc0mmand/test-stuff
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

5 months agonetworkd: support `proxy_arp_pvlan` sysctl
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.

5 months agoMerge pull request #30049 from yuwata/assert-return-critical
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

5 months agonetwork: use json_variant_append_arrayb()
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.

5 months agolog: make assert_return() critical when -Dmode=developer 30049/head
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.

5 months agotest: make assert_return() critical by default on fuzzer and unit tests
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.

5 months agolog: introduce a knob to make assert_return() 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>
5 months agotest: make the variable names slightly more descriptive 30587/head
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.

5 months agotest: slightly extend uid0's coverage
Frantisek Sumsal [Fri, 22 Dec 2023 13:09:58 +0000 (14:09 +0100)] 
test: slightly extend uid0's coverage

5 months agotest: make the test actually test
Frantisek Sumsal [Fri, 22 Dec 2023 12:16:06 +0000 (13:16 +0100)] 
test: make the test actually test

Follow-up for dd25a95763e6ee52d40f4012ffeb2ce719f26b8d.

5 months agoMerge pull request #30603 from mrc0mmand/openssl-shenanigans
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+

5 months agotest: redirect stdout/stderr of TEST-04-JOURNAL to console as well 30604/head
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

5 months agotest: don't truncate the final journal
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.

5 months agotest: make sure the dummy CA certificate is marked as such 30603/head
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)

5 months agoukify: make the test happy with the latest OpenSSL
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...'

5 months agoMerge pull request #30600 from dtardon/see-also-simplelist
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

5 months agoman: conditionalize sd-pcrlock and sd-measure on the same variable as their binaries
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

5 months agoman: capitalize "also" for consistency 30600/head
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.

5 months agoman: use <simplelist> for 'See also' sections
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.

5 months agoudev: use SD_EVENT_SIGNAL_PROCMASK
Yu Watanabe [Tue, 19 Dec 2023 05:15:07 +0000 (14:15 +0900)] 
udev: use SD_EVENT_SIGNAL_PROCMASK

5 months agoMerge pull request #30590 from yuwata/backlight-cleanups
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()

5 months agoTODO: fix typo
Yu Watanabe [Fri, 22 Dec 2023 19:49:26 +0000 (04:49 +0900)] 
TODO: fix typo

5 months agosd-device: introduce device_has_db() helper function 30596/head
Yu Watanabe [Wed, 22 Nov 2023 04:05:26 +0000 (13:05 +0900)] 
sd-device: introduce device_has_db() helper function

5 months agosd-device: modernize device_update_db() and friends
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.

5 months agoudev-spawn: slightly adjust logs about timed out commands 30594/head
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.

5 months agoudev: refuse too short timeout value
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.

5 months agoudev: handle event_timeout=infinity correctly
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.

5 months agoudev-manager: use ASSERT_PTR()
Yu Watanabe [Tue, 19 Dec 2023 03:27:53 +0000 (12:27 +0900)] 
udev-manager: use ASSERT_PTR()

5 months agonetwork: use varlink for networkctl check_netns_match()
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>
5 months agobacklight: split out verb_load() and verb_save(), then use dispatch_verb() 30590/head
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.

5 months agobacklight: use WRITE_STRING_FILE_MKDIR_0755 flag on save
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.

5 months agobacklight: split out read_saved_brightness()
Yu Watanabe [Thu, 21 Dec 2023 19:29:54 +0000 (04:29 +0900)] 
backlight: split out read_saved_brightness()

No functional change, just refactoring.

5 months agobacklight: split out device_new_from_arg()
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.

5 months agobacklight: split out build_save_file_path()
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.

5 months agobacklight: move validity check of max_brightness to get_max_brightness()
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().

5 months agoMerge pull request #30585 from YHNdnzj/isatty-handling
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

5 months agovarious: clean up isatty() handling 30585/head
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

5 months agoterminal-util: introduce isatty_safe that rejects EBADF
Mike Yuan [Fri, 22 Dec 2023 09:59:39 +0000 (17:59 +0800)] 
terminal-util: introduce isatty_safe that rejects EBADF

5 months agoterminal-util: use RET_GATHER more
Mike Yuan [Fri, 22 Dec 2023 10:32:24 +0000 (18:32 +0800)] 
terminal-util: use RET_GATHER more

5 months agotest: fix check for device in test-execute
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

5 months agoMerge pull request #30550 from yuwata/network-nexthop-cleanups-3
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)

5 months agosystemctl: swap cached_id_map and cached_name_map
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.

5 months agonetworkd: add basic Varlink interface
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.

5 months agoservice: don't try to determine selinux label for socket activation if RootImage...
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.

5 months agoMerge pull request #30553 from yuwata/network-post-event-source
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

5 months agoMerge pull request #30541 from yuwata/network-address-empty
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

5 months agoMerge pull request #30575 from arthurzam/bash
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

5 months agoMerge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
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

5 months agoMerge pull request #28658 from H5117/enroll_with_ec
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

5 months agoMerge pull request #30547 from poettering/uid0
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

5 months agoDrop /dev test in test-mountpoint-util
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.

5 months agobash-completion: add missing option to systemd-confext 30575/head
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>
5 months agobash-completion: add missing option to systemd-cgls
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>
5 months agobash-completion: add missing option to systemd-cat
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>
5 months agoMerge pull request #30568 from poettering/creds-varlink
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

5 months agoMerge pull request #30566 from poettering/varlink-inval-param
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()

5 months agopolkit: simplify bus_verify_polkit_async() + drop auth-by-cap dbus feature
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
5 months agovarlink: make use of varlink_error_invalid_parameter() helper where appropriate 30566/head
Lennart Poettering [Thu, 21 Dec 2023 14:47:26 +0000 (15:47 +0100)] 
varlink: make use of varlink_error_invalid_parameter() helper where appropriate

5 months agovarlink: add helper varlink_error_invalid_parameter_name()
Lennart Poettering [Thu, 23 Nov 2023 21:24:20 +0000 (22:24 +0100)] 
varlink: add helper varlink_error_invalid_parameter_name()

5 months agotest: add simple creds/varlink integration test 30568/head
Lennart Poettering [Fri, 24 Nov 2023 15:30:15 +0000 (16:30 +0100)] 
test: add simple creds/varlink integration test

5 months agocreds: add varlink API for encrypting/decrypting credentials
Lennart Poettering [Thu, 23 Nov 2023 21:22:27 +0000 (22:22 +0100)] 
creds: add varlink API for encrypting/decrypting credentials

5 months agovarlink: add helper varlink_error_invalid_parameter_name()
Lennart Poettering [Thu, 23 Nov 2023 21:24:20 +0000 (22:24 +0100)] 
varlink: add helper varlink_error_invalid_parameter_name()

5 months agoupdate TODO 30547/head
Lennart Poettering [Wed, 20 Dec 2023 10:58:02 +0000 (11:58 +0100)] 
update TODO

5 months agotest: add minimal integration test coverage for uid0 tool
Lennart Poettering [Wed, 20 Dec 2023 18:10:13 +0000 (19:10 +0100)] 
test: add minimal integration test coverage for uid0 tool

5 months agoman: try to improve wording on --slice-inherit docs
Lennart Poettering [Wed, 20 Dec 2023 14:01:52 +0000 (15:01 +0100)] 
man: try to improve wording on --slice-inherit docs

5 months agorun/uid0: tint the terminal background color (and add new --background= switch)
Lennart Poettering [Wed, 20 Dec 2023 11:09:27 +0000 (12:09 +0100)] 
run/uid0: tint the terminal background color (and add new --background= switch)

This adds a new --background= switch that allows specifiying a
background color for the terminal while the tool runs.

It also teaches the tool when invoked as uid0 to tint the terminal in a
reddish hue when operating as root, and in a yellowish hue when
operating as any other user.

This should highlight nicely when the user is operating with elevated
privileges, or changed privileges.

5 months agocolor-util: add helper to convert RGB → HSV
Lennart Poettering [Wed, 20 Dec 2023 11:08:32 +0000 (12:08 +0100)] 
color-util: add helper to convert RGB → HSV

We already have HSV → RGB, add the opposite operation.

5 months agocolor-util: split out HSV color conversion into color-util.[ch]
Lennart Poettering [Wed, 20 Dec 2023 11:07:37 +0000 (12:07 +0100)] 
color-util: split out HSV color conversion into color-util.[ch]

5 months agoptyfwd: optionally, change ANSI background color of forwarded terminals
Lennart Poettering [Wed, 20 Dec 2023 11:04:06 +0000 (12:04 +0100)] 
ptyfwd: optionally, change ANSI background color of forwarded terminals

As the bytes flow through our terminal forwarder we can color the
background of the terminal with a color of our choices, if that's
desired.

This will later allow us to color the background of the uid0 tool when
running as root with a slightly alarming red color.

This does two things:

1. When an ANSI sequence is seen that resets the background color, it is
   extended to immediately set the color to our choice.
2. When a newline is seen it is immeidately extended to set the
   background color again and clear the current line till the end.

Net effect: all lines written while we forward the ttys will be shown
with the background color of choice.

5 months agoterminal-util: add helper that determines terminal default bg color
Lennart Poettering [Wed, 20 Dec 2023 11:02:01 +0000 (12:02 +0100)] 
terminal-util: add helper that determines terminal default bg color

5 months agoterminal-util: add helper for disabling terminal echo in termios struct
Lennart Poettering [Wed, 20 Dec 2023 11:01:32 +0000 (12:01 +0100)] 
terminal-util: add helper for disabling terminal echo in termios struct

5 months agomkosi: don't turn off installation of our PAM snippets
Lennart Poettering [Tue, 19 Dec 2023 20:40:32 +0000 (21:40 +0100)] 
mkosi: don't turn off installation of our PAM snippets

Otherwise we don't get the new PAM snippet for the uid0 PAM stack
installed.

5 months agorun: optionally set the "ignore-failure" flag for ExecStart= lines
Lennart Poettering [Tue, 19 Dec 2023 20:39:50 +0000 (21:39 +0100)] 
run: optionally set the "ignore-failure" flag for ExecStart= lines

5 months agorun: when invoked as "uid0", expose some sudo-like behaviour
Lennart Poettering [Tue, 19 Dec 2023 18:10:52 +0000 (19:10 +0100)] 
run: when invoked as "uid0", expose some sudo-like behaviour

This turns "systemd-run" into a multi-call binary. When invoked under
the name "uid0", then it behaves a bit more like traditional "sudo".
This mostly means defaults appropriuate for that, for example a PAM
stack, interactivity and more.

Fixes: #29199
5 months agoenv-util: add strv_env_assignf() helper
Lennart Poettering [Tue, 19 Dec 2023 18:09:17 +0000 (19:09 +0100)] 
env-util: add strv_env_assignf() helper

5 months agoMerge pull request #30567 from yuwata/hashmap_isempty
Yu Watanabe [Thu, 21 Dec 2023 17:36:19 +0000 (02:36 +0900)] 
Merge pull request #30567 from yuwata/hashmap_isempty

tree-wide: use hashmap_isempty() and friends

5 months agoMerge pull request #30564 from poettering/varlink-log-tweaks
Yu Watanabe [Thu, 21 Dec 2023 17:31:09 +0000 (02:31 +0900)] 
Merge pull request #30564 from poettering/varlink-log-tweaks

varlink: minor fixes & tweaks

5 months agoMerge pull request #30563 from poettering/socket-tweaks
Yu Watanabe [Thu, 21 Dec 2023 17:30:46 +0000 (02:30 +0900)] 
Merge pull request #30563 from poettering/socket-tweaks

two minor tweak to socket-util.c

5 months agosd-journal: use FOREACH_ARRAY() at one more place 30567/head
Yu Watanabe [Thu, 21 Dec 2023 16:28:44 +0000 (01:28 +0900)] 
sd-journal: use FOREACH_ARRAY() at one more place

5 months agotree-wide: use hashmap_isempty() and friends
Yu Watanabe [Thu, 21 Dec 2023 16:27:09 +0000 (01:27 +0900)] 
tree-wide: use hashmap_isempty() and friends

5 months agovarlink: check state rather than flags to determine whether it makes sense to reply 30564/head
Lennart Poettering [Fri, 24 Nov 2023 15:11:46 +0000 (16:11 +0100)] 
varlink: check state rather than flags to determine whether it makes sense to reply

We already checked the flags before, and updated the state accordingly,
hence let's only look at the state afterwards. This allows us to use the
same expressions for all cases where we want to reply automatically to
clients.

5 months agovarlink: add an extra assert encoding our assumption that ucred is valid here
Lennart Poettering [Thu, 23 Nov 2023 17:23:40 +0000 (18:23 +0100)] 
varlink: add an extra assert encoding our assumption that ucred is valid here

5 months agovarlink: never turn method call handler errors into connection errors
Lennart Poettering [Thu, 23 Nov 2023 17:15:14 +0000 (18:15 +0100)] 
varlink: never turn method call handler errors into connection errors

Let's make sure method call handlers failing will result in that very
method call failing but not the whole connection. We mostly got that
right, except for "oneway" calls where the method reply is supposed to
be eaten up, but wasn't. Fix that.

5 months agovarlink: switch various log calls to the local log helpers
Lennart Poettering [Thu, 23 Nov 2023 17:13:51 +0000 (18:13 +0100)] 
varlink: switch various log calls to the local log helpers

Most code in varlink.c got that right, but some didn't. Fix that.

5 months agosocket-util: remove unnecessary variable 30563/head
Lennart Poettering [Thu, 23 Nov 2023 16:58:15 +0000 (17:58 +0100)] 
socket-util: remove unnecessary variable

5 months agosocket-util: make sure SO_PEERSEC returned string is always NUL terminated
Lennart Poettering [Thu, 23 Nov 2023 17:05:04 +0000 (18:05 +0100)] 
socket-util: make sure SO_PEERSEC returned string is always NUL terminated

it's not entirely clear to me if the manual NUL termination is
necessary, but let's better be safe than sorry, since this is apparently
up to the LSMs, and I am not sure we can trust them all.

A lot of other code (such as dbus-broker) patches in the NUL byte, hence
let's be rather safe-then-sorry, it's trivial after all.

5 months agodbus-execute: use new exec_context_get_set_login_environment() helper also as backing...
Lennart Poettering [Thu, 21 Dec 2023 09:19:15 +0000 (10:19 +0100)] 
dbus-execute: use new exec_context_get_set_login_environment() helper also as backing for dbus property

Note sure why it didn't occur earlier to me, but now that we have this
nice helper to get the effective value of the set_login_environment
field instead of just falling back to "false".

Follow-up for: #30552

5 months agoresolved: actually check authenticated flag of SOA transaction
Michal Sekletar [Wed, 20 Dec 2023 15:44:14 +0000 (16:44 +0100)] 
resolved: actually check authenticated flag of SOA transaction

Fixes #25676

5 months agocore: imply SetLoginEnvironment= if PAMName= is set
Lennart Poettering [Wed, 20 Dec 2023 18:08:05 +0000 (19:08 +0100)] 
core: imply SetLoginEnvironment= if PAMName= is set

This geneally makes sense as setting up a PAM session pretty much
defines what a login session is.

In context of #30547 this has the benefit that we can take benefit of
the SetLoginEnvironment= effect without having to set it explicitly,
thus retaining some compat of the uid0 client towards older systemd
service managers.

5 months agonetwork: merge two post event sources 30553/head
Yu Watanabe [Wed, 20 Dec 2023 18:46:10 +0000 (03:46 +0900)] 
network: merge two post event sources

No functional change, just refactoring.

5 months agonetwork: split out manager_clean_all() from manager_dirty_handler()
Yu Watanabe [Wed, 20 Dec 2023 18:46:03 +0000 (03:46 +0900)] 
network: split out manager_clean_all() from manager_dirty_handler()

And rename manager_dirty_handler() to manager_post_handler().

No functional change, just refactoring.