]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agonetwork: refuse to configure address or route with 0 valid lifetime 24001/head
Yu Watanabe [Wed, 13 Jul 2022 17:39:56 +0000 (02:39 +0900)] 
network: refuse to configure address or route with 0 valid lifetime

Fixes #23625.

3 years agonetwork: fix infinite lifetime handling
Yu Watanabe [Wed, 13 Jul 2022 17:52:48 +0000 (02:52 +0900)] 
network: fix infinite lifetime handling

3 years agonetwork: use sd_event_now()
Yu Watanabe [Wed, 13 Jul 2022 17:53:03 +0000 (02:53 +0900)] 
network: use sd_event_now()

3 years agoDo not fail EFI build with newer binutils
Michael Biebl [Wed, 22 Jun 2022 11:11:13 +0000 (13:11 +0200)] 
Do not fail EFI build with newer binutils

Newer binutils versions currently trigger the following warnings due to
a bug in gnu-efi

on arm64:
/usr/bin/ld.bfd: warning: src/boot/efi/systemd-bootaa64.elf has a LOAD segment with RWX permissions

on amd64:
/usr/bin/ld.bfd: warning: /usr/lib/crt0-efi-x86_64.o: missing .note.GNU-stack section implies executable stack

This results in a build failure due to --fatal-warnings.
Work around this issue by suppressing those warnings until gnu-efi has
been fixed.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013341

3 years agoman: lift pam_systemd_homed description to Summary
Zbigniew Jędrzejewski-Szmek [Wed, 13 Jul 2022 08:19:19 +0000 (10:19 +0200)] 
man: lift pam_systemd_homed description to Summary

Also change the title to describe the module more comprehensively.
Follow-up for 90bc309aa2c1430941f4c50f73e681ab3e488bd3. Suggested
in https://bugzilla.redhat.com/show_bug.cgi?id=2085485#c5.

3 years agoAdd coredump daemons to bug/RFE template component options
Daan De Meyer [Wed, 13 Jul 2022 10:48:04 +0000 (12:48 +0200)] 
Add coredump daemons to bug/RFE template component options

3 years agoMerge pull request #23817 from yuwata/sd-device-send-udev-database-version
Zbigniew Jędrzejewski-Szmek [Wed, 13 Jul 2022 11:10:40 +0000 (13:10 +0200)] 
Merge pull request #23817 from yuwata/sd-device-send-udev-database-version

sd-device: send udev database version

3 years agoci: limit which env variables we pass through `sudo`
Frantisek Sumsal [Wed, 13 Jul 2022 09:12:36 +0000 (11:12 +0200)] 
ci: limit which env variables we pass through `sudo`

to work around #23987.

3 years agotest-network: save and restore timezone
Yu Watanabe [Wed, 13 Jul 2022 01:24:53 +0000 (10:24 +0900)] 
test-network: save and restore timezone

Several DHCP client tests change the system timezone.
Let's save the current timezone at the beginning, and restore it with
the saved value at the end.

3 years agoMerge pull request #23881 from keszybz/kernel-install-strikes-yet-again
Yu Watanabe [Wed, 13 Jul 2022 00:44:50 +0000 (02:44 +0200)] 
Merge pull request #23881 from keszybz/kernel-install-strikes-yet-again

kernel-install: fix invocation as installkernel, add tests, tweak documentation

3 years agotest-network: wait for L2TP tunnels being removed
Yu Watanabe [Tue, 12 Jul 2022 21:06:36 +0000 (23:06 +0200)] 
test-network: wait for L2TP tunnels being removed

Fixes #23985.

3 years agologind: don't delay login for root even if systemd-user-sessions.service is not activ...
Franck Bui [Thu, 7 Jul 2022 10:02:04 +0000 (12:02 +0200)] 
logind: don't delay login for root even if systemd-user-sessions.service is not activated yet

If for any reason something goes wrong during the boot process (most likely due
to a network issue), system admins should be allowed to log in to the system to
debug the problem. However due to the login session barrier enforced by
systemd-user-sessions.service for all users, logins for root will be delayed
until a (dbus) timeout expires. Beside being confusing, it's not a nice user
experience to wait for an indefinite period of time (no message is shown) this
and also suggests that something went wrong in the background.

The reason of this delay is due to the fact that all units involved in the
creation of a user session are ordered after systemd-user-sessions.service,
which is subject to network issues. If root needs to log in at that time,
logind is requested to create a new session (via pam_systemd), which ultimately
ends up waiting for systemd-user-session.service to be activated. This has the
bad side effect to block login for root until the dbus call done by pam_systemd
times out and the PAM stack proceeds anyways.

To solve this problem, this patch orders the session scope units and the user
instances only after systemd-user-sessions.service for unprivileged users only.

3 years agosmack: Add DefaultSmackProcessLabel to user.conf and system.conf
Łukasz Stelmach [Wed, 6 Jul 2022 11:09:51 +0000 (13:09 +0200)] 
smack: Add DefaultSmackProcessLabel to user.conf and system.conf

DefaultSmackProcessLabel tells systemd what label to assign to its child
process in case SmackProcessLabel is not set in the service file. By
default, when DefaultSmackProcessLabel is not set child processes inherit
label from systemd.

If DefaultSmackProcessLabel is set to "/" (which is an invalid character
for a SMACK label) the DEFAULT_SMACK_PROCESS_LABEL set during compilation
is ignored and systemd act as if the option was unset.

3 years agoMerge pull request #23982 from medhefgo/boot-misc
Luca Boccassi [Tue, 12 Jul 2022 21:43:14 +0000 (22:43 +0100)] 
Merge pull request #23982 from medhefgo/boot-misc

boot: Misc cleanups

3 years agoMerge pull request #23979 from DaanDeMeyer/nspawn-relative-paths
Luca Boccassi [Tue, 12 Jul 2022 21:41:10 +0000 (22:41 +0100)] 
Merge pull request #23979 from DaanDeMeyer/nspawn-relative-paths

nspawn: Support relative paths for --bind and --overlay

3 years agonspawn: Support relative source paths for --bind and --overlay 23979/head
Daan De Meyer [Mon, 11 Jul 2022 19:45:08 +0000 (21:45 +0200)] 
nspawn: Support relative source paths for --bind and --overlay

3 years agobcd: Clean up includes 23982/head
Jan Janssen [Tue, 12 Jul 2022 08:01:03 +0000 (10:01 +0200)] 
bcd: Clean up includes

Also, now that bcd.h does not depend on efi.h anymore we can now
properly include it in the test instead.

3 years agobcd: Use std alignof
Jan Janssen [Tue, 12 Jul 2022 07:52:29 +0000 (09:52 +0200)] 
bcd: Use std alignof

3 years agoboot: Remove _cleanup_freepool_
Jan Janssen [Tue, 12 Jul 2022 07:48:38 +0000 (09:48 +0200)] 
boot: Remove _cleanup_freepool_

3 years agoboot: Use int instead of INTN
Jan Janssen [Tue, 12 Jul 2022 07:46:44 +0000 (09:46 +0200)] 
boot: Use int instead of INTN

3 years agoboot: Use uintptr_t when converting EFI_PHYSICAL_ADDRESS
Jan Janssen [Tue, 12 Jul 2022 07:43:13 +0000 (09:43 +0200)] 
boot: Use uintptr_t when converting EFI_PHYSICAL_ADDRESS

uintptr_t is the more appropriate type when casting to/from pointers.

3 years agokernel-install: suppress bogus shellcheck hint 23881/head
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 12:55:05 +0000 (14:55 +0200)] 
kernel-install: suppress bogus shellcheck hint

I don't quite understand this, but '{ ! true; }' is not the same as '( ! true )'.
In interactive mode, it seems to work as expected. But in a script, it doesn't.

3 years agokernel-install: use set -e
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 12:45:07 +0000 (14:45 +0200)] 
kernel-install: use set -e

This means that we'll fail hard if something goes wrong, e.g. reading
of a config file. I think this is appropriate. If errors should be ignored,
the caller should do that on their end.

3 years agokernel-install: return 0 for unknown verbs in plugins
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 12:44:01 +0000 (14:44 +0200)] 
kernel-install: return 0 for unknown verbs in plugins

In practice this makes little difference, because kernel-install will
only call the plugins for 'add' or 'remove', and if we were to add a
new verb to kernel-install, we'd just change the plugins at the same
time. But our plugins serve as documentation for external plugins too,
and there it's better to silently ignore unknown verbs so that we can
add new verbs in the future.

(50-depomod.install was already like that.)

3 years agokernel-install: raise fuss if plugins are called without the expected parameters
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 12:41:41 +0000 (14:41 +0200)] 
kernel-install: raise fuss if plugins are called without the expected parameters

3 years agotest-kernel-install: add a simple test that kernel-install copies the files
Zbigniew Jędrzejewski-Szmek [Fri, 1 Jul 2022 11:08:31 +0000 (13:08 +0200)] 
test-kernel-install: add a simple test that kernel-install copies the files

I opted to tweaking kernel-install to allow overriding config
(with $KERNEL_INSTALL_CONF_ROOT, $KERNEL_INSTALL_PLUGINS). An alternative
would be to build a test environment in test/. We can still do that,
but I think it's nice to have a simple test that is very quick and easy
to debug.

Invocation as installkernel is for #23681.

3 years agokernel-install: mark the plugins as executable in git
Zbigniew Jędrzejewski-Szmek [Fri, 1 Jul 2022 11:04:11 +0000 (13:04 +0200)] 
kernel-install: mark the plugins as executable in git

We mark them as executable during installation, but it's also nice to mark
them as such in sources, so they can be executed directly.

3 years agokernel-install: allow overriding the plugin list too
Zbigniew Jędrzejewski-Szmek [Fri, 1 Jul 2022 10:55:32 +0000 (12:55 +0200)] 
kernel-install: allow overriding the plugin list too

The use of IFS=<newline> is dropped. Let's just iterate over the list, using
any whitespace as separator.

3 years agoMerge pull request #23980 from yuwata/test-network
Yu Watanabe [Mon, 11 Jul 2022 23:27:36 +0000 (01:27 +0200)] 
Merge pull request #23980 from yuwata/test-network

test-network: tiny output improvements

3 years agoMerge pull request #23972 from yuwata/sd-device
Yu Watanabe [Mon, 11 Jul 2022 20:44:56 +0000 (22:44 +0200)] 
Merge pull request #23972 from yuwata/sd-device

sd-device: do not return -ENOENT by sd_device_get_is_initialized()

3 years agoFix automatic screen rotation for Asus Transformer T100TAM
Michal Stanke [Mon, 11 Jul 2022 12:11:12 +0000 (14:11 +0200)] 
Fix automatic screen rotation for Asus Transformer T100TAM

3 years agoMerge pull request #23974 from yuwata/align-tables
Yu Watanabe [Mon, 11 Jul 2022 20:43:45 +0000 (22:43 +0200)] 
Merge pull request #23974 from yuwata/align-tables

basic: align tables

3 years agotest-network: support to remove routing policy rules with l3mdev flag 23980/head
Yu Watanabe [Mon, 11 Jul 2022 20:32:10 +0000 (22:32 +0200)] 
test-network: support to remove routing policy rules with l3mdev flag

3 years agotest-network: merge stdout and stderr of invoked command by call()
Yu Watanabe [Mon, 11 Jul 2022 20:31:12 +0000 (22:31 +0200)] 
test-network: merge stdout and stderr of invoked command by call()

Otherwise, the logs may be messed up.

3 years agoman: explain why pam_systemd_home wants to be in all four stacks
Lennart Poettering [Mon, 11 Jul 2022 13:12:24 +0000 (15:12 +0200)] 
man: explain why pam_systemd_home wants to be in all four stacks

Suggested here:

https://bugzilla.redhat.com/show_bug.cgi?id=2085485#c5

3 years agoMerge pull request #23969 from yuwata/test-network
Frantisek Sumsal [Mon, 11 Jul 2022 20:03:04 +0000 (20:03 +0000)] 
Merge pull request #23969 from yuwata/test-network

test-network: fixlets and performance improvements

3 years agonspawn: Rewrap --overlay docs
Daan De Meyer [Mon, 11 Jul 2022 19:43:41 +0000 (21:43 +0200)] 
nspawn: Rewrap --overlay docs

3 years agonspawn: Drop unnecessary intermediate variable
Daan De Meyer [Mon, 11 Jul 2022 19:38:26 +0000 (21:38 +0200)] 
nspawn: Drop unnecessary intermediate variable

3 years agosd-netlink: add sizes for some IP and Ethernet addresses
Topi Miettinen [Sun, 10 Jul 2022 09:17:32 +0000 (12:17 +0300)] 
sd-netlink: add sizes for some IP and Ethernet addresses

Add sizes for some uses of NETLINK_TYPE_IN_ADDR and NETLINK_TYPE_ETHER_ADDR
types.

3 years agotest-network: various cleanups 23969/head
Yu Watanabe [Sat, 9 Jul 2022 11:05:23 +0000 (20:05 +0900)] 
test-network: various cleanups

- introduce several helper functions
- do not list unit files, but remove the runtime unit directory in
  tearDown().
- do not list used interfaces, but remove all interfaces previously not
  exists in tearDown().
- save routes and routing policy rules before running tests, and flush
  unnecessary routes and rules in each tearDown() calls.
- drop many time.sleep() calls.
- call tearDown() after each sub tests.
- shorten code.
- several coding style fixes.
- etc, etc...

Hopefully, this improves performance of the test.

3 years agoupdate TODO
Lennart Poettering [Mon, 11 Jul 2022 15:37:41 +0000 (17:37 +0200)] 
update TODO

3 years agotest-network: extend timeout for DHCP lease to be expired
Yu Watanabe [Sun, 10 Jul 2022 21:54:40 +0000 (23:54 +0200)] 
test-network: extend timeout for DHCP lease to be expired

Fixes #23964.

3 years agosd-device: shorten code a bit 23972/head
Yu Watanabe [Mon, 11 Jul 2022 10:02:31 +0000 (12:02 +0200)] 
sd-device: shorten code a bit

3 years agotree-wide: trivial tweaks
Lennart Poettering [Mon, 11 Jul 2022 13:10:38 +0000 (15:10 +0200)] 
tree-wide: trivial tweaks

3 years agoupdate TODO
Lennart Poettering [Fri, 8 Jul 2022 16:05:12 +0000 (18:05 +0200)] 
update TODO

3 years agomkosi: update to latest main
Luca Boccassi [Mon, 11 Jul 2022 10:08:14 +0000 (11:08 +0100)] 
mkosi: update to latest main

Fix build failure on SUSE Tumbleweed due to config changes

3 years agounit-def: align string tables 23974/head
Yu Watanabe [Mon, 11 Jul 2022 12:19:59 +0000 (14:19 +0200)] 
unit-def: align string tables

3 years agovirt: align tables
Yu Watanabe [Mon, 11 Jul 2022 12:13:33 +0000 (14:13 +0200)] 
virt: align tables

3 years agosd-device: make sd_device_get_is_initialized() not return -ENOENT
Yu Watanabe [Mon, 11 Jul 2022 10:02:04 +0000 (12:02 +0200)] 
sd-device: make sd_device_get_is_initialized() not return -ENOENT

3 years agoMerge pull request #23962 from keszybz/taint-flag-support-ended
Luca Boccassi [Sun, 10 Jul 2022 21:42:56 +0000 (22:42 +0100)] 
Merge pull request #23962 from keszybz/taint-flag-support-ended

Taint flag "support-ended"

3 years agomanager: add taint flag "support-ended" 23962/head
Zbigniew Jędrzejewski-Szmek [Sat, 9 Jul 2022 16:00:33 +0000 (18:00 +0200)] 
manager: add taint flag "support-ended"

In the welcome line, use NAME= as the fallback for PRETTY_NAME=.
PRETTY_NAME= doesn't have to be set, but NAME= should.

Example output:
---
Welcome to Fedora Linux 37 (Rawhide Prerelease)!

[  !!  ] This OS version (Fedora Linux 37 (Rawhide Prerelease)) is past its end-of-support date (1999-01-01)
Queued start job for default target graphical.target.
[  OK  ] Created slice system-getty.slice.
---

3 years agoman: update the description of taint flags
Zbigniew Jędrzejewski-Szmek [Sat, 9 Jul 2022 15:42:07 +0000 (17:42 +0200)] 
man: update the description of taint flags

We had a description in README, and an outdated list in the man page.
I think we should keep a reference-style list in the man page. The description
in README is more free-form.

3 years agoman: redefine SUPPORT_END= to mean one day earlier
Zbigniew Jędrzejewski-Szmek [Sat, 9 Jul 2022 15:50:36 +0000 (17:50 +0200)] 
man: redefine SUPPORT_END= to mean one day earlier

I thought it would be nice to specify the last day of support, because I
thought it'd seem more natural. But in practice this doesn't work well, because
such a truncated timestamp is usually taken to mean midnight that starts the
given date. I.e. 2011-12-13 is a shorthand for 2011-12-13 00:00:00 and not
2011-12-13 23:59:59.999999999999. Let's instead specify that the given date is
the first unsupported day, which is meaningful for humans, and let the computer
treat it as midnight, which gives consistent interpratation.

3 years agoresolve: introduce FORMAT_DNS_RCODE() macro
Yu Watanabe [Sat, 9 Jul 2022 06:56:50 +0000 (15:56 +0900)] 
resolve: introduce FORMAT_DNS_RCODE() macro

Fixes #23958.

3 years agoMerge pull request #23959 from yuwata/test-network
Frantisek Sumsal [Sat, 9 Jul 2022 08:21:32 +0000 (08:21 +0000)] 
Merge pull request #23959 from yuwata/test-network

test-network: several performance improvements

3 years agotest-network: use wait_operstate() at one more place 23959/head
Yu Watanabe [Sat, 9 Jul 2022 03:20:11 +0000 (12:20 +0900)] 
test-network: use wait_operstate() at one more place

3 years agotest-network: suppress periodic output in wait_operstate()
Yu Watanabe [Sat, 9 Jul 2022 03:19:52 +0000 (12:19 +0900)] 
test-network: suppress periodic output in wait_operstate()

3 years agotest-network: disable debugging logs from networkctl, resolvectl, and so on
Yu Watanabe [Sat, 9 Jul 2022 02:59:38 +0000 (11:59 +0900)] 
test-network: disable debugging logs from networkctl, resolvectl, and so on

3 years agotest-network: merge two DHCPv6 client tests
Yu Watanabe [Sat, 9 Jul 2022 01:13:33 +0000 (10:13 +0900)] 
test-network: merge two DHCPv6 client tests

3 years agotest-network: replace sleep with wait_address() and wait_address_dropped()
Yu Watanabe [Sat, 9 Jul 2022 01:07:17 +0000 (10:07 +0900)] 
test-network: replace sleep with wait_address() and wait_address_dropped()

3 years agotest-network: merge two more tests with test_dhcp_client_ipv4_only
Yu Watanabe [Sat, 9 Jul 2022 01:01:51 +0000 (10:01 +0900)] 
test-network: merge two more tests with test_dhcp_client_ipv4_only

3 years agotest-network: merge tests for UseDNS=
Yu Watanabe [Sat, 9 Jul 2022 00:49:20 +0000 (09:49 +0900)] 
test-network: merge tests for UseDNS=

3 years agotest-network: merge two IPv4LL tests
Yu Watanabe [Fri, 8 Jul 2022 23:58:48 +0000 (08:58 +0900)] 
test-network: merge two IPv4LL tests

3 years agotest-network: drop test_dhcp_client_ipv4_ipv6
Yu Watanabe [Fri, 8 Jul 2022 23:10:08 +0000 (08:10 +0900)] 
test-network: drop test_dhcp_client_ipv4_ipv6

As the test is covered by test_dhcp_client_reuse_address_as_static.

3 years agosd-dhcp-client: fix log message
Yu Watanabe [Fri, 8 Jul 2022 22:52:11 +0000 (07:52 +0900)] 
sd-dhcp-client: fix log message

3 years agotest-network: check DHCPv4 address in more detail
Yu Watanabe [Fri, 8 Jul 2022 22:40:06 +0000 (07:40 +0900)] 
test-network: check DHCPv4 address in more detail

Also, this drops redundant address check through networkctl.

3 years agotest-network: drop 25-dhcp-v4-server-veth-peer.network
Yu Watanabe [Fri, 8 Jul 2022 22:15:37 +0000 (07:15 +0900)] 
test-network: drop 25-dhcp-v4-server-veth-peer.network

3 years agotest-network: drop meaningless test
Yu Watanabe [Fri, 8 Jul 2022 22:03:31 +0000 (07:03 +0900)] 
test-network: drop meaningless test

On DHCPv6 lease renew, the kernel do not drop static routes, and hence
we do not try to reassign them. Hence, the test is mostly meaningless.

3 years agotest-network: introduce read_dnsmasq_log_file() helper function
Yu Watanabe [Fri, 8 Jul 2022 21:34:20 +0000 (06:34 +0900)] 
test-network: introduce read_dnsmasq_log_file() helper function

This reduces the number of times that the log file is read.
Also, dropped unnecessary dump of the log file.

3 years agotest-network: shorten sleep time a bit
Yu Watanabe [Fri, 8 Jul 2022 21:22:39 +0000 (06:22 +0900)] 
test-network: shorten sleep time a bit

Network interfaces will be ready after lease is acquired.
Hence, it is not necessary to wait more than lease time.

3 years agotest-network: introduce read_link_state_file() helper function
Yu Watanabe [Fri, 8 Jul 2022 21:17:46 +0000 (06:17 +0900)] 
test-network: introduce read_link_state_file() helper function

3 years agonetwork: drop redundant warning
Yu Watanabe [Fri, 10 Jun 2022 00:12:55 +0000 (09:12 +0900)] 
network: drop redundant warning

If file is world readable, then `read_full_file_full()` will warn
about that.

3 years agoMerge pull request #23940 from yuwata/core-extract-first-word
Luca Boccassi [Sat, 9 Jul 2022 00:09:06 +0000 (01:09 +0100)] 
Merge pull request #23940 from yuwata/core-extract-first-word

core: fix error value in log_syntax()

3 years agoMerge pull request #23731 from bluca/bootctl_image
Luca Boccassi [Fri, 8 Jul 2022 20:59:16 +0000 (21:59 +0100)] 
Merge pull request #23731 from bluca/bootctl_image

bootctl: add --root and --image

3 years agoMerge pull request #23954 from yuwata/resolve-overflow
Evgeny Vereshchagin [Fri, 8 Jul 2022 20:39:31 +0000 (23:39 +0300)] 
Merge pull request #23954 from yuwata/resolve-overflow

resolve: fix heap-buffer-overflow

3 years agosd-device: send udev database version 23817/head
Yu Watanabe [Fri, 24 Jun 2022 04:05:13 +0000 (13:05 +0900)] 
sd-device: send udev database version

Otherwise, sd-device object received through sd-device-monitor does not
show current tags.

Fixes #23799.

3 years agosd-device: make device_get_properties_{nulstr,strv}() take NULL for result value
Yu Watanabe [Fri, 8 Jul 2022 19:13:49 +0000 (04:13 +0900)] 
sd-device: make device_get_properties_{nulstr,strv}() take NULL for result value

In most cases, it is not necessary to call them without retrieving
result. But, most of other getter functions for sd-device can take NULL.
Let's follow the way for consistency.

3 years agosd-device: change type of properties nulstr from uint8_t* to char*
Yu Watanabe [Fri, 24 Jun 2022 04:00:34 +0000 (13:00 +0900)] 
sd-device: change type of properties nulstr from uint8_t* to char*

3 years agocore/cgroup: drop unnecessary else 23940/head
Yu Watanabe [Thu, 7 Jul 2022 21:22:59 +0000 (06:22 +0900)] 
core/cgroup: drop unnecessary else

3 years agocore: shorten code a bit
Yu Watanabe [Thu, 7 Jul 2022 21:20:03 +0000 (06:20 +0900)] 
core: shorten code a bit

3 years agocore/load-fragment: fix error value in log_syntax()
Yu Watanabe [Thu, 7 Jul 2022 21:10:36 +0000 (06:10 +0900)] 
core/load-fragment: fix error value in log_syntax()

`extract_first_word()` may return positive value on success.

3 years agotest: start test user session before idle action setting is changed
Yu Watanabe [Fri, 8 Jul 2022 11:22:40 +0000 (20:22 +0900)] 
test: start test user session before idle action setting is changed

Otherwise, idle action may be triggered before starting the test user
session.

This also introduce create_session() and cleanup_session() helper
functions.

Fixes #23952.

3 years agoUpdate TODO 23731/head
Luca Boccassi [Sun, 12 Jun 2022 23:22:46 +0000 (00:22 +0100)] 
Update TODO

3 years agobootctl: add --install-source=auto|image|host
Luca Boccassi [Sun, 12 Jun 2022 23:21:41 +0000 (00:21 +0100)] 
bootctl: add --install-source=auto|image|host

When using --root=/--image= the binaries to install/update will be
picked from the directory/image. Add an option to let the caller
choose.
By default (auto) the image is tried first, and if nothing is found
then the host. The other options allow to strictly try the image
or host and ignore the other.

3 years agobootctl: add --root and --image
Luca Boccassi [Sun, 12 Jun 2022 23:01:02 +0000 (00:01 +0100)] 
bootctl: add --root and --image

Operate on image/directory, and also take files to install from it

3 years agomac: rework labelling code to be simpler, and less racy
Lennart Poettering [Fri, 8 Jul 2022 08:05:57 +0000 (10:05 +0200)] 
mac: rework labelling code to be simpler, and less racy

This merges the various labelling calls into a single label_fix_full(),
which can operate on paths, on inode fds, and in a dirfd/fname style
(i.e. like openat()). It also systematically separates the path to look
up in the db from the path we actually use to reference the inode to
relabel.

This then ports tmpfiles over to labelling by fd. This should make the
code a bit less racy, as we'll try hard to always operate on the very
same inode, pinning it via an fd.

User-visibly the behaviour should not change.

3 years agotmpfiles: take error code from "errno" earlier
Lennart Poettering [Fri, 8 Jul 2022 08:00:20 +0000 (10:00 +0200)] 
tmpfiles: take error code from "errno" earlier

This uses RET_NERRNO to more quickly pull the error code we see into
"r" out of "errno".

This does not change anything really. The only reason to do this is
because it is harder to break this accidentally. The thing is that
"errno" is easily set as side-effect of arbitrary functions. Thus, if we
rely on it being set for long code paths, we need to make carefully sure
that no code in between calls any function that might corrupt it as
side-effect. As far as I can see we did get this right. Nonetheless, I
think we should just store the value in "r" instead, to make it easier
to maintain this in the long run, if more code is inserted one day, who
knows.

3 years agoMerge pull request #23946 from poettering/tmpfiles-extrat-dir-fn
Lennart Poettering [Fri, 8 Jul 2022 14:10:42 +0000 (16:10 +0200)] 
Merge pull request #23946 from poettering/tmpfiles-extrat-dir-fn

tmpfiles: port from basename()/dirname() → path_extract_direcory()/path_extract_filename()

3 years agomkdir-label: don't use mkdirat_errno_wrapper() without reason
Lennart Poettering [Thu, 7 Jul 2022 21:22:04 +0000 (23:22 +0200)] 
mkdir-label: don't use mkdirat_errno_wrapper() without reason

mkdirat_errno_wrapper(x,y,z) is identical to RET_NERRNO(mkdirat(x, y,
z)). Let's always use the latter when we can, because easier to read,
shorter.

The only reason to have mkdirat_errno_wrapper() at all is so that we can
pass a function pointer to it around. Otherwise, let's not use it.

3 years agotime-util: fix buffer-over-run
Yu Watanabe [Thu, 7 Jul 2022 09:27:02 +0000 (18:27 +0900)] 
time-util: fix buffer-over-run

Fixes #23928.

3 years agosmack: catch more types of 'not supported' errors
Lennart Poettering [Thu, 7 Jul 2022 22:08:22 +0000 (00:08 +0200)] 
smack: catch more types of 'not supported' errors

3 years agotmpfiles: shorten code a bit
Lennart Poettering [Fri, 8 Jul 2022 08:05:39 +0000 (10:05 +0200)] 
tmpfiles: shorten code a bit

3 years agoresolve: fix possible integer overflow 23954/head
Yu Watanabe [Fri, 8 Jul 2022 13:13:24 +0000 (22:13 +0900)] 
resolve: fix possible integer overflow

3 years agotest-network: merge DHCP client tests to improve performance
Yu Watanabe [Fri, 8 Jul 2022 07:32:38 +0000 (16:32 +0900)] 
test-network: merge DHCP client tests to improve performance

3 years agoresolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1
Yu Watanabe [Fri, 8 Jul 2022 13:00:58 +0000 (22:00 +0900)] 
resolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1

Fixes #23942.

3 years agoMerge pull request #23943 from poettering/tmpfiles-errno-fix
Zbigniew Jędrzejewski-Szmek [Fri, 8 Jul 2022 12:50:18 +0000 (14:50 +0200)] 
Merge pull request #23943 from poettering/tmpfiles-errno-fix

two errno variable fixes

3 years agotmpfiles: port from dirname/basename to path_extract_directory/filename() 23946/head
Lennart Poettering [Thu, 7 Jul 2022 22:15:09 +0000 (00:15 +0200)] 
tmpfiles: port from dirname/basename to path_extract_directory/filename()

let's use our better, newer internal APIs for these purposes. This gets us
two things: safer handling when the root dir is specified, and better
handling of paths with trailing slashes, as we can refuse them whenever
a directory is not acceptable.

3 years agopath-util: NULL strings are definitely not valid paths
Lennart Poettering [Thu, 7 Jul 2022 21:19:12 +0000 (23:19 +0200)] 
path-util: NULL strings are definitely not valid paths

Let's make this functions that check validity of paths a bit more
friendly towards one specific kind of invalid path: a NULL pointer.

This follows similar logic in path_is_valid(), path_is_normalized() and
so on.

3 years agoupdate TODO
Lennart Poettering [Thu, 7 Jul 2022 21:18:38 +0000 (23:18 +0200)] 
update TODO

3 years agotmpfiles: correct error variable to use 23943/head
Lennart Poettering [Fri, 8 Jul 2022 07:59:57 +0000 (09:59 +0200)] 
tmpfiles: correct error variable to use