]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agoMerge pull request #31338 from ssahani/network-bond-missed
Yu Watanabe [Fri, 16 Feb 2024 21:16:42 +0000 (06:16 +0900)] 
Merge pull request #31338 from ssahani/network-bond-missed

network: netdev - bond add support for ARP missed max

7 months agoresolve: provide service resolve over varlink
Vishal Chillara Srinivas [Wed, 15 Nov 2023 07:08:23 +0000 (12:38 +0530)] 
resolve: provide service resolve over varlink

ported the d-bus implementation of service resolve to varlink
extended TEST-75-RESOLVED to cover this use-case

7 months agoMerge pull request #31218 from CodethinkLabs/vmspawn/journal_forwarding
Luca Boccassi [Fri, 16 Feb 2024 12:09:52 +0000 (12:09 +0000)] 
Merge pull request #31218 from CodethinkLabs/vmspawn/journal_forwarding

vmspawn: support journal forwarding

7 months agovarlink: fix varlink_collect_full not resetting state
Tomáš Pecka [Fri, 16 Feb 2024 08:43:18 +0000 (09:43 +0100)] 
varlink: fix varlink_collect_full not resetting state

The varlink_collect_full function did not set varlink client's state
when the reply was an error. The state was stuck in "collecting-reply".

I discovered that while hacking on network varlink interface (adding a
new varlink method). The debug logs shows the process of performing the
first query which replies with an error:

  varlink: Setting state idle-client
  network: Sending message: {"method":"io.systemd.Network.LLDPNeighbors","parameters":{"ifindex":1},"more":true}
  network: Changing state idle-client → collecting
  network: Received message: {"error":"org.varlink.service.MethodNotFound","parameters":{"method":"io.systemd.Network.LLDPNeighbors"}}
  network: Changing state collecting → collecting-reply

Now another varlink_collect call is being made, but

  network: Connection busy.
  Failed to execute varlink call: Device or resource busy

This was not caught by the tests because there were no varlink_collect
calls that resulted in error reply.

7 months agoMerge pull request #31311 from yuwata/journal-user-corruption
Luca Boccassi [Fri, 16 Feb 2024 12:07:50 +0000 (12:07 +0000)] 
Merge pull request #31311 from yuwata/journal-user-corruption

journal: fix user journal corruption on rotation

7 months agohwdb: Remove version check in CH Pro Pedals rule
Colin Geniet [Thu, 15 Feb 2024 19:23:49 +0000 (20:23 +0100)] 
hwdb: Remove version check in CH Pro Pedals rule

CH Pedals are incorrectly reported as an accelerometer [1], because they
have no button.  This is fixed by a rule in 60-input-id.hwdb [2], but
the rule checks id/version="0100", while my pedals report id/version="0111".

So there are several versions of the pedals, presumably all affected
by the bug. Remove the version check in the rule to fix them all.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=81889
[2] commit: 230ed4c4ba (hwdb: CH Pro Pedals not classified correctly due to no buttons, 2022-01-19)
    PR: https://github.com/systemd/systemd/pull/22184

7 months agovmspawn: fix possible NULL dereference in discover_boot_entry
Sam Leonard [Thu, 15 Feb 2024 18:16:17 +0000 (18:16 +0000)] 
vmspawn: fix possible NULL dereference in discover_boot_entry

7 months agoMerge pull request #30263 from msizanoen1/fix-onboot-rotate-2
Lennart Poettering [Fri, 16 Feb 2024 11:02:09 +0000 (12:02 +0100)] 
Merge pull request #30263 from msizanoen1/fix-onboot-rotate-2

journal: Reset runtime seqnum data when flushing to system journal

7 months agotest: properly preserve journal from sd-bsod tests
Frantisek Sumsal [Thu, 15 Feb 2024 20:13:07 +0000 (21:13 +0100)] 
test: properly preserve journal from sd-bsod tests

I (incorrectly) assumed that --relinquish-var does everything --flush
does, including moving already existing stuff from /var/log/journal/ to
/run/log/journal/, but that's not the case. To actually do that we need
to shuffle things manually, so let's do just that.

This should make issues like #31334 easier to debug, since with this
patch we now have a coredump in the test journal as well:

~# make -C test/TEST-04-JOURNAL/ clean setup run TEST_MATCH_SUBTEST=bsod BUILD_DIR=$PWD/build TEST_NO_NSPAWN=1
...
[   12.176089] testsuite-04.sh[712]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-04.bsod.sh failed'
[   12.176089] testsuite-04.sh[712]: Subtest /usr/lib/systemd/tests/testdata/units/testsuite-04.bsod.sh failed
[   12.176089] testsuite-04.sh[712]: + return 1
[   12.177347] systemd[1]: testsuite-04.service: Failed with result 'exit-code'.
[   12.220580] systemd[1]: Failed to start testsuite-04.service.
Spawning getter /home/mrc0mmand/repos/@systemd/systemd/build/journalctl -o export -D /var/tmp/systemd-tests/systemd-test.Qtqmmr/root/var/log/journal...
Finishing after writing 7649 entries
TEST-04-JOURNAL: (failed; see logs)
-rw-r----- 1 root root 16777216 Feb 15 21:13 /var/tmp/systemd-tests/systemd-test.Qtqmmr/system.journal
...

~# coredumpctl --file /var/tmp/systemd-tests/systemd-test.Qtqmmr/system.journal
TIME                        PID UID GID SIG     COREFILE EXE                           SIZE
Thu 2024-02-15 21:13:38 CET 812   0   0 SIGABRT journal  /usr/lib/systemd/systemd-bsod    -

7 months agotest-network: Add test for bond arp_missed_max option 31338/head
Susant Sahani [Thu, 15 Feb 2024 15:44:58 +0000 (21:14 +0530)] 
test-network: Add test for bond arp_missed_max option

7 months agonetwork: netdev - bond add support for ARP missed max
Susant Sahani [Thu, 15 Feb 2024 10:41:22 +0000 (16:11 +0530)] 
network: netdev - bond add support for ARP missed max

Allows to configure bond arp_missed_max is the maximum number of arp_interval monitor cycle
for missed ARP replies. If this number is exceeded, link is reported as
down.

7 months agopo: Translated using Weblate (Lithuanian)
mooo [Thu, 15 Feb 2024 23:36:05 +0000 (00:36 +0100)] 
po: Translated using Weblate (Lithuanian)

Currently translated at 69.6% (158 of 227 strings)

Co-authored-by: mooo <hazap@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/lt/
Translation: systemd/main

7 months agoMerge pull request #31320 from DaanDeMeyer/versioning
Daan De Meyer [Thu, 15 Feb 2024 19:15:04 +0000 (20:15 +0100)] 
Merge pull request #31320 from DaanDeMeyer/versioning

meson: Start adding devel and rc suffixes to the project version

7 months agotest: add test cases for journal corruption on btrfs 31311/head
Frantisek Sumsal [Sat, 10 Feb 2024 07:24:10 +0000 (16:24 +0900)] 
test: add test cases for journal corruption on btrfs

For issue #24150 and #31222.

7 months agojournal-file-util: use COPY_VERIFY_LINKED
Yu Watanabe [Thu, 15 Feb 2024 13:46:06 +0000 (22:46 +0900)] 
journal-file-util: use COPY_VERIFY_LINKED

As the main thread may call journal_directory_vacuum() ->
unlinkat_deallocate() while another thread is copying the file.

Fixes #24150 and #31222.

7 months agocopy: introduce COPY_VERIFY_LINKED flag
Yu Watanabe [Thu, 15 Feb 2024 10:37:43 +0000 (19:37 +0900)] 
copy: introduce COPY_VERIFY_LINKED flag

If the flag is set, then copy_file() and friends check if the source
file still exists when the copy operation finished.

7 months agosd-journal: use stat_verify_linked()
Yu Watanabe [Thu, 15 Feb 2024 01:08:23 +0000 (10:08 +0900)] 
sd-journal: use stat_verify_linked()

7 months agostat-util: introduce {stat,fd}_verify_linked()
Yu Watanabe [Thu, 15 Feb 2024 10:16:36 +0000 (19:16 +0900)] 
stat-util: introduce {stat,fd}_verify_linked()

7 months agostat-util: rebreak comment
Yu Watanabe [Thu, 15 Feb 2024 10:16:16 +0000 (19:16 +0900)] 
stat-util: rebreak comment

7 months agobsod: fix -c/--continuous support
Yu Watanabe [Thu, 15 Feb 2024 16:05:51 +0000 (01:05 +0900)] 
bsod: fix -c/--continuous support

Fixes a bug introduced by f7f062bf9f194dc14a4ffc6e7fff9d8bfdea2147.

Fixes #31334.

7 months agoMerge pull request #31331 from yuwata/xopenat
Yu Watanabe [Thu, 15 Feb 2024 16:32:21 +0000 (01:32 +0900)] 
Merge pull request #31331 from yuwata/xopenat

tree-wide: several cleanups related to xopenat()

7 months agojournal-file-util: use the file descriptor of journal file on copy 31331/head
Yu Watanabe [Wed, 14 Feb 2024 00:36:45 +0000 (09:36 +0900)] 
journal-file-util: use the file descriptor of journal file on copy

No effective functionality changed, just refactoring.

7 months agotest: add test for copying symlink with copy_tree_at()
Yu Watanabe [Thu, 15 Feb 2024 10:00:54 +0000 (19:00 +0900)] 
test: add test for copying symlink with copy_tree_at()

7 months agocopy: use xopenat() to make 'from' argument optional
Yu Watanabe [Wed, 14 Feb 2024 22:06:21 +0000 (07:06 +0900)] 
copy: use xopenat() to make 'from' argument optional

7 months agofs-util: rename xopenat() -> xopanat_full()
Yu Watanabe [Wed, 14 Feb 2024 23:23:35 +0000 (08:23 +0900)] 
fs-util: rename xopenat() -> xopanat_full()

7 months agoloop-util: fix error handling
Yu Watanabe [Thu, 15 Feb 2024 15:16:00 +0000 (00:16 +0900)] 
loop-util: fix error handling

Follow-up for 972c8db589f1f031d1fbbe01d821ddb1795fe285.

7 months agochattr-util: fix error code
Yu Watanabe [Thu, 15 Feb 2024 11:04:00 +0000 (20:04 +0900)] 
chattr-util: fix error code

Follow-up for cf91b9155c20a57bfc756b2b7e1a8f401f2bf16d.

7 months agochase: do not wrap xopenat() with RET_NERRNO()
Yu Watanabe [Thu, 15 Feb 2024 11:02:51 +0000 (20:02 +0900)] 
chase: do not wrap xopenat() with RET_NERRNO()

Follow-up for 47f0e1b5e04c27572b540ae4a86e522d268ffd3c.

7 months agofs-util: readlinkat() supports an empty string
Yu Watanabe [Wed, 14 Feb 2024 22:01:17 +0000 (07:01 +0900)] 
fs-util: readlinkat() supports an empty string

From readlinkat(2):
Since Linux 2.6.39, pathname can be an empty string, in which case the
call operates on the symbolic link referred to by dirfd (which should
have been obtained using open(2) with the O_PATH and O_NOFOLLOW flags).

7 months agoMerge pull request #30910 from YHNdnzj/logind-followup
Luca Boccassi [Thu, 15 Feb 2024 14:32:48 +0000 (14:32 +0000)] 
Merge pull request #30910 from YHNdnzj/logind-followup

logind-user: switch tracking logic to user-runtime-dir@.service

7 months agosystemctl: drop chain invocation of telinit
Michael Biebl [Thu, 8 Feb 2024 13:06:00 +0000 (14:06 +0100)] 
systemctl: drop chain invocation of telinit

This functionality relied on telinit being available in a different path
then the compat symlink shipped by systemd itself. This is no longer the
case for any known distro, so remove that code.

Fixes: #31220
Replaces: #31249

7 months agoman: enchance sd_bus_set_watch_bind() example to handle one more failure
Luca Boccassi [Wed, 14 Feb 2024 17:14:21 +0000 (17:14 +0000)] 
man: enchance sd_bus_set_watch_bind() example to handle one more failure

In case the D-Bus policy is not set up correctly the example just
loops forever. Check the return of sd_bus_request_name_async() in
a callback and exit if the error is not temporary.

Follow-up for 34bbda18a5f07fa5a52e8d85d20637ce1c00c4ec

7 months agovmspawn: add --forward-journal= 31218/head
Sam Leonard [Tue, 6 Feb 2024 11:27:17 +0000 (11:27 +0000)] 
vmspawn: add --forward-journal=

7 months agojournal-remote: allow AF_VSOCK and AF_UNIX for --listen-raw
Sam Leonard [Mon, 22 Jan 2024 16:12:39 +0000 (16:12 +0000)] 
journal-remote: allow AF_VSOCK and AF_UNIX for --listen-raw

This allows log messages forwarded over an AF_UNIX or AF_VSOCK socket by
journald to be received by systemd-journal-remote.

7 months agojournald: implement socket forwarding
Sam Leonard [Thu, 21 Dec 2023 15:32:15 +0000 (15:32 +0000)] 
journald: implement socket forwarding

This commit adds a new way of forwarding journal messages - forwarding
over a socket.

The socket can be any of AF_INET, AF_INET6, AF_UNIUX or AF_VSOCK.

The address to connect to is retrieved from the "journald.forward_address" credential.

It can also be specified in systemd-journald's unit file with ForwardAddress=

7 months agojournald: Add assertions to config_parse_compress
Sam Leonard [Tue, 13 Feb 2024 08:44:00 +0000 (08:44 +0000)] 
journald: Add assertions to config_parse_compress

7 months agocore/manager: don't propagate manager session env to children 30910/head
Mike Yuan [Tue, 13 Feb 2024 04:47:53 +0000 (12:47 +0800)] 
core/manager: don't propagate manager session env to children

Follow-up for 4cb4e6cf6dce2b66dcb59a8534aa6ca885e2f732

Fixes #31287

7 months agoenv-util: minor modernization
Mike Yuan [Tue, 13 Feb 2024 04:59:00 +0000 (12:59 +0800)] 
env-util: minor modernization

7 months agologind-session: use Requires= for user{,-runtime-dir}@.service
Mike Yuan [Fri, 12 Jan 2024 13:30:49 +0000 (21:30 +0800)] 
logind-session: use Requires= for user{,-runtime-dir}@.service

Since we do require these basic user services, let's make
the dependency stronger. Note that logind should enqueue
start jobs for these already in user_start(), so mostly
just paranoia.

7 months agologind-user: track user started/stopping state through user-runtime-dir@.service
Mike Yuan [Sat, 13 Jan 2024 18:38:11 +0000 (02:38 +0800)] 
logind-user: track user started/stopping state through user-runtime-dir@.service

Before #30884, the user state is tied to user@.service (user service
manager). However, #30884 introduced sessions that need no manager,
and we can no longer rely on that.

Consider the following situation:

1. A 'background-light' session '1' is created (i.e. no user service manager
   is needed)
2. Session '1' scope unit pulls in user-runtime-dir@.service
3. Session '1' exits. A stop job is enqueued for user-runtime-dir@.service
   due to StopWhenUnneeded=yes
4. At the same time, another session '2' which requires user manager is started.
   However, session scope units have JobMode=fail, therefore the start job
   for user-runtime-dir@.service that was pulled in by session '2' scope job
   is deleted as it conflicts with the stop job.

We want session scope units to continue using JobMode=fail, but we still need
the dependencies to be started correctly, i.e. explicitly requested by logind
beforehand. Therefore, let's stop using StopWhenUnneeded=yes for
user-runtime-dir@.service, and track users' `started` and `stopping` state
based on that when user@.service is not needed. Then, for every invocation
of user_start(), we'll recheck if we need the service manager and start it
if so.

Also, the dependency type on user-runtime-dir@.service from user@.service
is upgraded to `BindsTo=`, in order to ensure that when logind stops the
former, the latter is stopped as well.

7 months agologin/logind-session-dbus: some follow-ups for 'user-incomplete' (#30226)
Mike Yuan [Wed, 14 Feb 2024 16:43:14 +0000 (00:43 +0800)] 
login/logind-session-dbus: some follow-ups for 'user-incomplete' (#30226)

We don't usually say ", refusing" in bus error messages.
Also, make use of unref_and_replace_full.

7 months agokeyring-util: Use reported key size to resize buf
Adrian Vovk [Thu, 1 Feb 2024 22:53:01 +0000 (17:53 -0500)] 
keyring-util: Use reported key size to resize buf

According to keyctl(2), the return value for KEYCTL_READ is:

    The amount of data that is available in the key,
    irrespective of the provided buffer size

So, we could pass in a NULL buffer to query the size, then allocate the
exact right amount of space, then call keyctl again to get the key data.
However, we must still keep the for loop to avoid TOCTOU issues: the key
might have been replaced with something bigger while we're busy
allocating the buffer to store it.

Thus, we can actually save a syscall by picking some reasonable default
buffer size and skipping the NULL call to keyctl. If our default is big
enough, we're done and have saved a syscall! If not, then the first call
behaves essentially the same as the NULL call, and we use the size it
returns to reallocate the buffer appropriately.

7 months agonspawn: add support for owneridmap bind option
Benjamin Franzke [Fri, 17 Nov 2023 07:03:57 +0000 (08:03 +0100)] 
nspawn: add support for owneridmap bind option

owneridmap bind option will map the target directory owner from inside the
container to the owner of the directory bound from the host filesystem.
This will ensure files and directories created in the container will be owned
by the directory owner of the host filesystem. All other users will remain
unmapped. Files to be written as other users in the container will not be
allowed.

Resolves: #27037

7 months agolog: reorder arguments of internal macro
Yu Watanabe [Thu, 15 Feb 2024 01:49:49 +0000 (10:49 +0900)] 
log: reorder arguments of internal macro

To make the order matches with log_internal().

No functional change. Hopefully silence coverity issues like
CID#1534478, CID#1534479, CID#1534480, CID#1534482.

7 months agotest: fix cleanup function
Yu Watanabe [Thu, 15 Feb 2024 03:11:06 +0000 (12:11 +0900)] 
test: fix cleanup function

Follow-up for 8349bbdfd829c80fc5eabaca6c9d0afed28d1b3f.

7 months agohomed: Pass in username and uid as Polkit details
Adrian Vovk [Fri, 2 Feb 2024 19:53:01 +0000 (14:53 -0500)] 
homed: Pass in username and uid as Polkit details

This lets the Javascript polkit policies to decide whether to
allow/deny/authenticate based on the user that's being operated on.

7 months agovmspawn: fix alignment of merged initrd
Yu Watanabe [Thu, 15 Feb 2024 01:44:21 +0000 (10:44 +0900)] 
vmspawn: fix alignment of merged initrd

Follow-up for 811ad9e6b2b243428165c239aeb4791bc65b93dd.

Fixes CID#1534481.

7 months agoMerge pull request #31330 from yuwata/sd-journal-trivial-cleanups
Daan De Meyer [Thu, 15 Feb 2024 07:56:56 +0000 (08:56 +0100)] 
Merge pull request #31330 from yuwata/sd-journal-trivial-cleanups

sd-journal: trivial cleanups

7 months agocopy: rebreak comment and fix typo
Yu Watanabe [Thu, 15 Feb 2024 01:19:02 +0000 (10:19 +0900)] 
copy: rebreak comment and fix typo

7 months agosd-journal: fix potential memory leak 31330/head
Yu Watanabe [Wed, 14 Feb 2024 00:21:13 +0000 (09:21 +0900)] 
sd-journal: fix potential memory leak

Though, hopefully, the memory leak is hypothetical, as we always close
journal file with the timer by journal_file_offline_close().

7 months agojournal-file-util: drop unused template argument for journal_file_open_reliably()
Yu Watanabe [Fri, 9 Feb 2024 11:21:25 +0000 (20:21 +0900)] 
journal-file-util: drop unused template argument for journal_file_open_reliably()

I understand that the original motivation to introduce the template
argument here is to make journal_file_open() and _reliabrly() take the
same arguments. But, yeah, that's completely unused, not necessary to
complicate the code even the difference is not big.

7 months agosd-journal: use -EBADF for journal_file_open()
Yu Watanabe [Wed, 14 Feb 2024 21:06:20 +0000 (06:06 +0900)] 
sd-journal: use -EBADF for journal_file_open()

7 months agosd-journal: shorten code a bit
Yu Watanabe [Fri, 9 Feb 2024 11:07:22 +0000 (20:07 +0900)] 
sd-journal: shorten code a bit

7 months agotest-network: show interface status again when wait-online failed
Yu Watanabe [Wed, 14 Feb 2024 20:51:14 +0000 (05:51 +0900)] 
test-network: show interface status again when wait-online failed

Fixes a bug in 10d670a3c1c4b06782a76fc50e70a4719f7bb7ed.

This also makes wait_online() show a short message when a requested
interface not found.

7 months agoMerge pull request #31173 from yuwata/network-route-check-conflict
Yu Watanabe [Wed, 14 Feb 2024 23:12:42 +0000 (08:12 +0900)] 
Merge pull request #31173 from yuwata/network-route-check-conflict

network/route: check if existing route can be updated

7 months agologin: fix typo
Yu Watanabe [Wed, 14 Feb 2024 20:38:44 +0000 (05:38 +0900)] 
login: fix typo

Follow-up for 6e9bf0ad29f4027586f854763c27a35fedcb75df.

7 months agoMerge pull request #31286 from poettering/bootctl-varlink
Luca Boccassi [Wed, 14 Feb 2024 18:59:33 +0000 (18:59 +0000)] 
Merge pull request #31286 from poettering/bootctl-varlink

bootctl: add simple varlink IPC interface

7 months agomeson-vcs-tag: Say version format specification 31320/head
Daan De Meyer [Wed, 14 Feb 2024 18:56:30 +0000 (19:56 +0100)] 
meson-vcs-tag: Say version format specification

That's the official name so let's use it.

7 months agoMerge pull request #31317 from fbuihuu/update-tests-for-suse
Luca Boccassi [Wed, 14 Feb 2024 17:31:40 +0000 (17:31 +0000)] 
Merge pull request #31317 from fbuihuu/update-tests-for-suse

Update tests for SUSE

7 months agoImprove IgnoreSIGPIPE description
Winterhuman [Wed, 14 Feb 2024 15:02:35 +0000 (15:02 +0000)] 
Improve IgnoreSIGPIPE description

Reword the description of the `IgnoreSIGPIPE=` service option to be more grammatical.

7 months agosystemctl: don't warn unit needs reload if --no-warn
Mike Yuan [Wed, 14 Feb 2024 13:19:21 +0000 (21:19 +0800)] 
systemctl: don't warn unit needs reload if --no-warn

7 months agoMerge pull request #30226 from poettering/homed-fallback-shell
Lennart Poettering [Wed, 14 Feb 2024 16:08:04 +0000 (17:08 +0100)] 
Merge pull request #30226 from poettering/homed-fallback-shell

homed: allow logging into home areas via ssh without unlocking them locally first

7 months agotest-network: add test for advertised hop limit 31173/head
Yu Watanabe [Thu, 8 Feb 2024 09:49:44 +0000 (18:49 +0900)] 
test-network: add test for advertised hop limit

For issue #28437.

7 months agonetwork/ndisc: also set sysctl hop_limit value
Matt Muggeridge [Wed, 7 Feb 2024 21:21:58 +0000 (06:21 +0900)] 
network/ndisc: also set sysctl hop_limit value

Otherwise, the hop limit set to the routes may not be used in some
situations.

Fixes #28437.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
7 months agotest-network: add test case for removing conflicting routes
Yu Watanabe [Thu, 8 Feb 2024 09:24:33 +0000 (18:24 +0900)] 
test-network: add test case for removing conflicting routes

For issue #28439.

7 months agotest-network: drop unnecessary IPv6SendRA=yes setting
Yu Watanabe [Thu, 8 Feb 2024 10:01:27 +0000 (19:01 +0900)] 
test-network: drop unnecessary IPv6SendRA=yes setting

7 months agonetwork/ndisc: remove conflicting routes on configuring routes based on newly received RA
Yu Watanabe [Fri, 2 Feb 2024 03:30:32 +0000 (12:30 +0900)] 
network/ndisc: remove conflicting routes on configuring routes based on newly received RA

The linux kernel does not update several parameters, e.g. RTA_PREF.
Hence, when we configure routes based on a RA, we need to remove
existing conflicting routes.

Fixes #28426 and #28439.

7 months agonetwork/route: remove existing route if some property conflict with requested ones
Yu Watanabe [Fri, 2 Feb 2024 03:18:33 +0000 (12:18 +0900)] 
network/route: remove existing route if some property conflict with requested ones

Fixes #28853.

7 months agonetwork: rename link_drop_managed_xyz() -> link_drop_static_xyz()
Yu Watanabe [Fri, 9 Feb 2024 05:33:07 +0000 (14:33 +0900)] 
network: rename link_drop_managed_xyz() -> link_drop_static_xyz()

As networkd does not configure nexthops, neighbors, or routing policy rules
dynamically, this only changes link_drop_managed_addresses(). Previously
it also removed dynamic addresses, but with this commit, now it only
removes static addresses. Note, link_drop_managed_routes() has removed
only static routes, so this commit only changes its name.

Note. as commented in the code, the dynamic addresses will be removed
on lease expiration or stopping client, and link_drop_managed_xyz() are
called on reconfiguration or so, and at that time, all dynamic
addressing clients are stopped or restarted, so this should not
effective behavior change.

7 months agonetwork/ndisc: also drop SLAAC addresses and routes on reconfiguring
Yu Watanabe [Fri, 9 Feb 2024 05:50:46 +0000 (14:50 +0900)] 
network/ndisc: also drop SLAAC addresses and routes on reconfiguring

Especially, this is important for routes, as link_drop_managed_routes()
removes only static routes, rather than non-foreign routes.

7 months agotest-network: allow to specify multiple interfaces to wait_online() without square...
Yu Watanabe [Fri, 9 Feb 2024 09:26:37 +0000 (18:26 +0900)] 
test-network: allow to specify multiple interfaces to wait_online() without square bracket

7 months agobootctl: add a Varlink interface 31286/head
Lennart Poettering [Mon, 12 Feb 2024 16:30:31 +0000 (17:30 +0100)] 
bootctl: add a Varlink interface

For now, just super basic functionality: return the list of boot menu
entries, and read/write the reboot to firmware flag

7 months agobootspec: split out helper that turns BootEntry into a JSON object
Lennart Poettering [Mon, 12 Feb 2024 16:29:17 +0000 (17:29 +0100)] 
bootspec: split out helper that turns BootEntry into a JSON object

We can use that later for returning the boot loader entry list as JSON
via Varlink.

7 months agomeson: Start adding devel and rc suffixes to the project version
Daan De Meyer [Wed, 14 Feb 2024 10:04:36 +0000 (11:04 +0100)] 
meson: Start adding devel and rc suffixes to the project version

Let's make sure that versions generated by meson-vcs-tag.sh always
sort higher than official and stable releases. We achieve this by
immediately updating the meson version in meson.build after a new
release. To make sure this version always sorts lower than future
rcs, we suffix it with "~devel" which will sort lower than "~rcX".

The new release workflow is to update the version in meson.build
for each rc and the official release and to also update the version
number after a new release to the next development version.

The full version is exposed as PROJECT_VERSION_FULL and used where
it makes sense over PROJECT_VERSION.

We also switch to reading the version from a meson.version file in
the repo instead of hardcoding it in meson.build. This makes it
easier to access both inside and outside of the project.

The meson-vcs-tag.sh script is rewritten to query the version from
meson.version instead of passing it in via the command line. This
makes it easier to use outside of systemd since users don't have to
query the version themselves first.

7 months agodocs: Use v255~rc1 instead of v255-rc1
Daan De Meyer [Wed, 14 Feb 2024 10:35:22 +0000 (11:35 +0100)] 
docs: Use v255~rc1 instead of v255-rc1

This gets the point across better that we want the rc to sort lower
than the official release.

7 months agoefi-loader: make efi_loader_get_entries() handling missing NUL termination gracefully
Lennart Poettering [Mon, 12 Feb 2024 16:23:59 +0000 (17:23 +0100)] 
efi-loader: make efi_loader_get_entries() handling missing NUL termination gracefully

Our function so far assumed that the LoaderEntries's last string is or
is not NUL terminated. But if it was, then we'd debug log about this,
claiming there was an invalid id. sd-boot actually ends the list in a
properly NUL-terminated string, hence we should just accept that. Handle
that case gracefully, and add comments explaining why we have two ways
why we exit the loop.

This is cosmetic only, just suppresses a misleading debug log message.

7 months agoupdate TODO 30226/head
Lennart Poettering [Mon, 27 Nov 2023 14:09:05 +0000 (15:09 +0100)] 
update TODO

7 months agotest: add test that ensures homed logins via SSH work
Lennart Poettering [Tue, 28 Nov 2023 14:44:41 +0000 (15:44 +0100)] 
test: add test that ensures homed logins via SSH work

7 months agopam_systemd_home: make sure we handle RefUnit() returning HomeBusy properly
Lennart Poettering [Tue, 28 Nov 2023 14:42:13 +0000 (15:42 +0100)] 
pam_systemd_home: make sure we handle RefUnit() returning HomeBusy properly

RefUnit() only succeeds it a home dir is fully up. We already dealt with
it not being up at all, but let's also cover the case where it is
currently busy with changing state, and in that case fall back to
RefUnrestricted(), with the usual implications.

This has the effect that two subsequent ssh logins one-after-the-other
will work correctly.

7 months agoman: update D-Bus docs with new calls
Lennart Poettering [Mon, 27 Nov 2023 21:34:12 +0000 (22:34 +0100)] 
man: update D-Bus docs with new calls

7 months agohomed: generate fallback data in user record, for inactive homes
Lennart Poettering [Fri, 13 May 2022 16:38:56 +0000 (18:38 +0200)] 
homed: generate fallback data in user record, for inactive homes

7 months agopam_systemd_home: in ssh logins and similar, ask via fallback shall for home password
Lennart Poettering [Mon, 27 Nov 2023 22:00:12 +0000 (23:00 +0100)] 
pam_systemd_home: in ssh logins and similar, ask via fallback shall for home password

ssh runs PAM session hooks before they allocate a pty for the session.
(That's because they allow multiplexed connections, and hence might run
multiple ptys over the same same session). This means PAM modules cannot
interactively ask the user for additional information as they deem fit.
That's a problem for us, since generally during an SSH login no
authentication token (aka "password") is supplied to us which we could
use to unlock the user's home dir.

With this commit we implement a way out: we allow the login to proceed,
but without the home dir activated, and then override the user's shell
with our fallback shell, which will ask for the user's password and then
chainload the actual shell.

This will of course only work if the login actually involves invoking
the configured interactive shell of the user. For other logins (such as
sftp or so), this cannot work, and they'll see an empty home dir
instead.

7 months agohomectl: implement fallback shell stub
Lennart Poettering [Fri, 13 May 2022 22:03:16 +0000 (00:03 +0200)] 
homectl: implement fallback shell stub

7 months agohomed: add a ActivateHomeIfReferenced() bus call
Lennart Poettering [Mon, 27 Nov 2023 16:05:54 +0000 (17:05 +0100)] 
homed: add a ActivateHomeIfReferenced() bus call

This is very similar to ActivateHome() but will fail if the home
directory is not referenced yet. Or in other words, this doesn't add any
new reference, but simply is the other side of RefUnrestricted(): if we
allowed a home dir to be referenced without it actually being active,
then this can catch up with things and activated what was previously
referenced already.

This also relaxes access rights to that users can always activate their
own home dirs. This is useful once we allow user code to run without the
home dir being activated.

7 months agohomed: add bus call that allows referencing a home without activating it
Lennart Poettering [Mon, 27 Nov 2023 16:08:17 +0000 (17:08 +0100)] 
homed: add bus call that allows referencing a home without activating it

This is useful for allowing users to login without the ability to unlock
their home dir. Usecase is ssh: ssh might grant access without giving
us the chance to unlock the home dir for the user (because it doesn't
allow us asking questions during authentication), hence with this call
we can pin the home dir, but not activate it and then allow the
activation to be delayed until later.

7 months agouser-record-show: show if fallback data is used
Lennart Poettering [Fri, 13 May 2022 16:38:35 +0000 (18:38 +0200)] 
user-record-show: show if fallback data is used

7 months agouser-record: add fields for a fallback home dir + shell
Lennart Poettering [Fri, 13 May 2022 16:21:01 +0000 (18:21 +0200)] 
user-record: add fields for a fallback home dir + shell

This adds fields to the user record logic to allow a "fallback" home
directory and shell to be set as part of the "status" section of the
user record, i.e. supplied by the manager of the user record.

The idea is that if the fallback homedir/shell is set it will take
precedence over the real one in most ways.

Usecase: let's try to make ssh logins into homed directories work.
systemd-homed would set a fallback shell/homedir for inactive home dirs.
Thus, when ssh logins take place via key auth, we can allow them, and
these fallback session params would be used because the real home cannot
be activated just yet becasue we cannot acquire any password for it from
the user.

7 months agologind: add ability to upgrade session class from 'user-incomplete' to 'user'
Lennart Poettering [Mon, 27 Nov 2023 16:48:37 +0000 (17:48 +0100)] 
logind: add ability to upgrade session class from 'user-incomplete' to 'user'

7 months agopam-systemd: automatically enable "incomplete" user session if XDG_SESSION_INCOMPLETE...
Lennart Poettering [Mon, 27 Nov 2023 16:30:15 +0000 (17:30 +0100)] 
pam-systemd: automatically enable "incomplete" user session if XDG_SESSION_INCOMPLETE env var is set

This allows earlier PAM modules (i.e. pam_systemd_home) to inform
pam_systemd that the session is not "complete" yet (i.e. doesn't have
the home dir set up properly yet).

7 months agologind: add new 'user-incomplete' session class
Lennart Poettering [Mon, 27 Nov 2023 17:36:06 +0000 (18:36 +0100)] 
logind: add new 'user-incomplete' session class

7 months agoMerge pull request #28761 from esposem/cmdline_manager
Luca Boccassi [Wed, 14 Feb 2024 13:56:31 +0000 (13:56 +0000)] 
Merge pull request #28761 from esposem/cmdline_manager

bootctl: handle UKI cmdline addons

7 months agoMerge pull request #31283 from CodethinkLabs/vmspawn/start_from_template
Luca Boccassi [Wed, 14 Feb 2024 13:55:04 +0000 (13:55 +0000)] 
Merge pull request #31283 from CodethinkLabs/vmspawn/start_from_template

vmspawn: Support being invoked from a template unit

7 months agoMerge pull request #31319 from poettering/journal-tighten-memfd-flags
Lennart Poettering [Wed, 14 Feb 2024 13:40:46 +0000 (14:40 +0100)] 
Merge pull request #31319 from poettering/journal-tighten-memfd-flags

journald: tighten checks on incoming memfds a bit

7 months agoMerge pull request #31314 from yuwata/network-ndisc-check-conflicting-address
Yu Watanabe [Wed, 14 Feb 2024 13:19:05 +0000 (22:19 +0900)] 
Merge pull request #31314 from yuwata/network-ndisc-check-conflicting-address

network/ndisc: check conflicting address

7 months agomeson: do not attempt to install tests when they are disabled
Luca Boccassi [Tue, 13 Feb 2024 13:43:49 +0000 (13:43 +0000)] 
meson: do not attempt to install tests when they are disabled

If -Dtests=false but -Dinstall-tests=true the build will fail, as some tests will
be pulled in the build but not their prerequisites. It doesn't make sense to ask
for tests to be installed if they are disabled.

FAILED: test-acd
cc  -o test-acd test-acd.p/src_libsystemd-network_test-acd.c.o -flto -Wl,--as-needed -Wl,--no-undefined -pie -fstack-protector -Wl,-z,relro -specs=/usr/share/debhelper/dh_package_notes/debian-package-notes.specs -g -O2 -ffile-prefix-map=/tmp/s=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -ffat-lto-objects -Wdate-time -D_FORTIFY_SOURCE=2 '-Wl,-rpath,$ORIGIN/src/shared:XXXXXXXXXXXXXXX' -Wl,-rpath-link,/tmp/s/obj-x86_64-linux-gnu/src/shared -Wl,--start-group src/shared/libsystemd-shared-255.so src/libsystemd-network/libsystemd-network.a -Wl,--end-group -Wl,--fatal-warnings -Wl,-z,now -Wl,-z,relro -Wl,--warn-common -Wl,--gc-sections -Wl,--fatal-warnings -Wl,-z,now -Wl,-z,relro -Wl,--warn-common -Wl,--gc-sections
/usr/bin/ld: /tmp/cc0oYwFZ.ltrans0.ltrans.o: in function `main':
./obj-x86_64-linux-gnu/./obj-x86_64-linux-gnu/<artificial>:85:(.text.startup+0x33): undefined reference to `test_setup_logging'
collect2: error: ld returned 1 exit status

7 months agojournald: rebreak some comments 31319/head
Lennart Poettering [Wed, 14 Feb 2024 09:56:09 +0000 (10:56 +0100)] 
journald: rebreak some comments

7 months agojournald: when getting journal data via memfd, check flags are valid
Lennart Poettering [Wed, 14 Feb 2024 09:55:22 +0000 (10:55 +0100)] 
journald: when getting journal data via memfd, check flags are valid

Add some extra safety checks: refuse weird open flags.

And while we are at it, also use stat_verify_regular()

7 months agobootctl: discover and pring global UKI PE addons 28761/head
Emanuele Giuseppe Esposito [Thu, 21 Sep 2023 11:59:24 +0000 (07:59 -0400)] 
bootctl: discover and pring global UKI PE addons

An UKI final command line is not just made of the content of .cmdline,
but also from the addons that are inserted in
/boot/efi/EFI/Linux/<UKI_NAME>.efi.extra.d (local addons) and /boot/efi/loader/addons
(global addons).

Therefore bootclt "status" and "list" should also include these addons
when printing the UKI command line.

Support for /boot/efi/EFI/Linux/<UKI_NAME>.efi.extra.d is already present,
so now cover addons present in /boot/efi/loader/addons (global addons).

Example (assume UKI_NAME=devel):
$ bootctl
ukiCmdline: console=tty0 console=ttyS0
  globalAddon: loader/addons/global.addon.efi
      cmdline: └─quiet
   localAddon: devel.efi.extra.d/rpm_addon.addon.efi
      cmdline: └─this is a normal addon
 finalCmdline: console=tty0 console=ttyS0 quiet this is a normal addon

7 months agobootctl: discover local UKI PE addons
Emanuele Giuseppe Esposito [Thu, 21 Sep 2023 06:21:42 +0000 (02:21 -0400)] 
bootctl: discover local UKI PE addons

An UKI final command line is not just made of the content of .cmdline,
but also from the addons that are inserted in
/boot/efi/EFI/Linux/<UKI_NAME>.efi.extra.d (local addons) and
/boot/efi/loader/addons (global addons).

Therefore bootclt "status" and "list" should also include these addons
when printing the UKI command line.

Right now, discover addons present in
/boot/efi/EFI/Linux/<UKI_NAME>.efi.extra.d.

Example output (assume UKI_NAME=devel):
$ bootctl
ukiCmdline: console=tty0 console=ttyS0
   localAddon: devel.efi.extra.d/rpm_addon.addon.efi
      cmdline: └─this is a normal addon
 finalCmdline: console=tty0 console=ttyS0 this is a normal addon

7 months agobootspec: refactor find_sections
Emanuele Giuseppe Esposito [Thu, 21 Sep 2023 06:18:32 +0000 (02:18 -0400)] 
bootspec: refactor find_sections

Prepare for the incoming changes that introduce PE addons support.
Addons will contain a .cmdline section, but not .osrel.