]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agoman/bootctl: typo in `--print-boot-path` description 31057/head
Antonio Alvarez Feijoo [Tue, 23 Jan 2024 09:33:26 +0000 (10:33 +0100)] 
man/bootctl: typo in `--print-boot-path` description

7 months agobootctl: return earlier with `--print-esp-path`
Antonio Alvarez Feijoo [Tue, 23 Jan 2024 09:24:44 +0000 (10:24 +0100)] 
bootctl: return earlier with `--print-esp-path`

`--print-esp-path` and `--print-boot-path` cannot be combined, so it's not
necessary to acquire the XBOOTLDR partition with `--print-esp-path`.

7 months agoMerge pull request #31015 from yuwata/local-addresses
Yu Watanabe [Tue, 23 Jan 2024 01:25:35 +0000 (10:25 +0900)] 
Merge pull request #31015 from yuwata/local-addresses

local-addresses: several cleanups and fixes, add test cases

7 months agoFix systemd-backlight ignoring numbered kbd_backlight entries
Werner Sembach [Fri, 19 Jan 2024 19:56:15 +0000 (20:56 +0100)] 
Fix systemd-backlight ignoring numbered kbd_backlight entries

If there are name collisions in the leds subsystem, the 2nd device node with the
colliding name gets automatically renamed by appending _1, the third by
appending _2 and so on.

This wildcard change makes sure that systemd-backlight also catches these
renamed nodes for kbd_backlight entries.

7 months agoMerge pull request #31044 from keszybz/uhttpd-alloca-print
Luca Boccassi [Mon, 22 Jan 2024 22:03:08 +0000 (22:03 +0000)] 
Merge pull request #31044 from keszybz/uhttpd-alloca-print

Use macro wrapper instead of alloca in µhttp-utils

7 months agocgroup: Rename effective limits internal table
Michal Koutný [Mon, 22 Jan 2024 15:58:18 +0000 (16:58 +0100)] 
cgroup: Rename effective limits internal table

Post-merge fixup of commit 4fb0d2dc14 ("cgroup: Add EffectiveMemoryMax=,
EffectiveMemoryHigh= and EffectiveTasksMax= properties"), no functional
change intended.

7 months agomeson: correctly handle "no" value for sshd?confdir options
Frantisek Sumsal [Mon, 22 Jan 2024 16:11:14 +0000 (17:11 +0100)] 
meson: correctly handle "no" value for sshd?confdir options

7 months agovmspawn: document -q/--quiet
Sam Leonard [Mon, 22 Jan 2024 18:26:22 +0000 (18:26 +0000)] 
vmspawn: document -q/--quiet

7 months agocore: raise the log priority if sd-executor is missing
Frantisek Sumsal [Mon, 22 Jan 2024 13:15:31 +0000 (14:15 +0100)] 
core: raise the log priority if sd-executor is missing

Log about missing executor at the emergency level, so the message always
makes it to the console - otherwise it won't get anywhere, since we
can't even start systemd-journald in that case.

Before:

Welcome to Arch Linux!

[    5.202479] systemd[1]: Failed to allocate manager object: No such file or directory
[!!!!!!] Failed to allocate manager object.
[    5.207741] systemd[1]: Freezing execution.

After:

Welcome to Arch Linux!

[    5.279408] systemd[1]: Failed to open executor binary '/usr/lib/systemd/systemd-executor': No such file or directory
[    5.290756] systemd[1]: Failed to allocate manager object: No such file or directory
[!!!!!!] Failed to allocate manager object.
[    5.295919] systemd[1]: Freezing execution.

7 months agoMerge pull request #31011 from poettering/getpwnam-tweaks
Lennart Poettering [Mon, 22 Jan 2024 19:58:33 +0000 (20:58 +0100)] 
Merge pull request #31011 from poettering/getpwnam-tweaks

clean up getpwnam() calls and related interfaces

7 months agoIPv6 RA: Support the Retrans Timer field (IPv6 Conformance Test: v6LC.2.1.5)
Matt Muggeridge [Mon, 22 Jan 2024 09:55:41 +0000 (19:55 +1000)] 
IPv6 RA: Support the Retrans Timer field (IPv6 Conformance Test: v6LC.2.1.5)

The RA's Retransmission Timer field was being ignored. This resolves the IPv6
Core Conformance test, v6LC.2.1.5 [1].

Retransmission Timer is a 32-bit unsigned integer. The time, in milliseconds,
between retransmitted Neighbor Solicitation messages. Used by the Address
Resolution and Neighbor Unreachability Detection (NUD) algorithm.

Support setting a default value for the neighbour retransmission timer value with:

    [Network]
    IPv6RetransmissionTimeSec=<int>

By default, upon receiving a Router Advertisement with the Retransmission Timer
field set to a non-zero value, it will update the kernel's retransmit timer value.
To disable this behaviour, configure the UseIPv6RetransmissionTime= under the
[IPv6AcceptRA] section.

    [IPv6AcceptRA]
    UseIPv6RetransmissionTime=<bool>

RFC4861: Neighbor Discovery in IPv6
  * Section 4.2 RA Message Format.
  * Section 6.3.4 Processing Received Router Advertisements

A Router Advertisement field (e.g., Cur Hop Limit, Reachable Time,
and Retrans Timer) may contain a value denoting that it is
unspecified. In such cases, the parameter should be ignored and the
host should continue using whatever value it is already using. In
particular, a host MUST NOT interpret the unspecified value as
meaning change back to the default value that was in use before the
first Router Advertisement was received.

The RetransTimer variable SHOULD be copied from the Retrans Timer
field, if the received value is non-zero.

References
[1] IPv6 Core Conformance Spec (PDF)

7 months agouser-util: add get{pw,gr}{uid,gid,name}_malloc() helpers 31011/head
Lennart Poettering [Fri, 19 Jan 2024 10:38:54 +0000 (11:38 +0100)] 
user-util: add get{pw,gr}{uid,gid,name}_malloc() helpers

These are wrappers around getpwuid_r() and friends, and will allocate the
right-sized buffer for this call.

We so far had multiple implementations of a buffer allocation loop
around getpwuid_r() and friends, and they all suck in some way. Let's
clean this up and add a common implementation, and use it everywhere.

Also, be more careful with error numbers, in particular systematically
turn ENOENT into ENOSRCH (the former is what is returned if /etc/passwd
is absent, which we want to consider identical to user not existing,
which is ENOSRCH). We so far did this at some invocations, but not all.

There are some invocations of getpwuid() left in the codebase. We really
should fix those too, and have a single unified implementation of the
logic, but those are not as trivial to convert, so left for another
time.

7 months agouser-util: validate the right field
Lennart Poettering [Fri, 19 Jan 2024 10:32:26 +0000 (11:32 +0100)] 
user-util: validate the right field

7 months agoMerge pull request #31023 from poettering/vmspawn-work
Lennart Poettering [Mon, 22 Jan 2024 16:54:43 +0000 (17:54 +0100)] 
Merge pull request #31023 from poettering/vmspawn-work

vmspawn: make it work on current fedora

7 months agonspawn,vmspawn: let's add some terminal magic to the welcome text 31023/head
Lennart Poettering [Fri, 19 Jan 2024 22:23:48 +0000 (23:23 +0100)] 
nspawn,vmspawn: let's add some terminal magic to the welcome text

Let's grey the text out, and prefix it with a vertical grey bar, to make
clear this is output from the host, not the payload, and make it clearly
distinguishable from what follows.

Let's also make the image name clickable (with new enough
shared-mime-info this should allow you to look into the image with
gnome-disk-utility or a similar tool.

7 months agovmspawn: make "-m" value formatting independent of locale
Lennart Poettering [Fri, 19 Jan 2024 22:12:05 +0000 (23:12 +0100)] 
vmspawn: make "-m" value formatting independent of locale

We cannot format the memory string via printf() %f format strings, since
that's locale dependent and qemu doesn't like that. hence format this as
an integer. We'll lose sub-MiB accuracy, but systems with less than 1
MiB memory don't really make much sense anyway.

7 months agovmspawn: print a helpful message when we start the VM
Lennart Poettering [Fri, 19 Jan 2024 18:32:36 +0000 (19:32 +0100)] 
vmspawn: print a helpful message when we start the VM

Let people know how they can exit the VM, it's not obvious after all.

7 months agovmspawn: make sure to pass the right firmware image type to qemu
Lennart Poettering [Fri, 19 Jan 2024 18:14:09 +0000 (19:14 +0100)] 
vmspawn: make sure to pass the right firmware image type to qemu

The JSON data reports whether firmware types are qcow or raw. Let's pass
that into the qemu cmdline.

7 months agovmspawn: rework firmware selection logic
Lennart Poettering [Fri, 19 Jan 2024 17:50:43 +0000 (18:50 +0100)] 
vmspawn: rework firmware selection logic

Let's make the firmware file to choose configurable, and enumeratable.

This adds --firmware= to select the formare, and in particular
--firmware=list to show available options.

7 months agovmspawn: ENODEV is not the only error the kernel returns if a device is not there
Lennart Poettering [Fri, 19 Jan 2024 17:47:41 +0000 (18:47 +0100)] 
vmspawn: ENODEV is not the only error the kernel returns if a device is not there

Let's use ERRNO_IS_DEVICE_ABSENT() to cover all cases.

(And while we are at it also use ERRNO_IS_PRIVILEGE() where appropriate)

7 months agovmspawn: close host vsock fd once we passed it to the child
Lennart Poettering [Fri, 19 Jan 2024 17:05:32 +0000 (18:05 +0100)] 
vmspawn: close host vsock fd once we passed it to the child

Without this I qemu simply froze in a weird state for me if I kill it:
it was supposedly a zombie, but we'd get the pidfd POLLIN event for it
only once the fd is closed. Hence let's close it right-away.

(Smells like a kernel issue actually, but too lazy to bother with this).

7 months agovmspawn: use execv() rather than execve() if we just want to pass 'environ' as env...
Lennart Poettering [Fri, 19 Jan 2024 17:05:28 +0000 (18:05 +0100)] 
vmspawn: use execv() rather than execve() if we just want to pass 'environ' as env block

7 months agovmspawn: modernize setup_notify_parent() a bit
Lennart Poettering [Fri, 19 Jan 2024 17:04:56 +0000 (18:04 +0100)] 
vmspawn: modernize setup_notify_parent() a bit

7 months agovmspawn: rework how we spawn qemu off
Lennart Poettering [Fri, 19 Jan 2024 17:03:49 +0000 (18:03 +0100)] 
vmspawn: rework how we spawn qemu off

Let's swicth to PidRef for tracking the qemu child.

let's also set a bunch of flags that ensure the child inherits less of
of context.

7 months agoevent-util: add helper for adding pidref child to event loop
Lennart Poettering [Fri, 19 Jan 2024 17:02:19 +0000 (18:02 +0100)] 
event-util: add helper for adding pidref child to event loop

7 months agomkosi: Use authselect local profile if it exists
Daan De Meyer [Mon, 22 Jan 2024 11:04:45 +0000 (12:04 +0100)] 
mkosi: Use authselect local profile if it exists

authselect 1.5.0 removed the "minimal" profile and added the "local"
profile instead. Let's modify our post-installation script to take
these changes into account.

7 months agotree-wide: link to docs.kernel.org for kernel documentation
nl6720 [Sun, 21 Jan 2024 11:48:16 +0000 (13:48 +0200)] 
tree-wide: link to docs.kernel.org for kernel documentation

https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
These URLs are shorter and nicer looking.

7 months agopo: Translated using Weblate (Indonesian)
Andika Triwidada [Sun, 21 Jan 2024 10:36:51 +0000 (11:36 +0100)] 
po: Translated using Weblate (Indonesian)

Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/id/
Translation: systemd/main

7 months agocore: path: Re-enter waiting if target is deactivating 30490/head
Adrian Vovk [Sat, 30 Dec 2023 19:06:39 +0000 (14:06 -0500)] 
core: path: Re-enter waiting if target is deactivating

Previously, path units would remain in the running state while their
target unit is deactivating. This left a window of time where the target
unit is no longer operational (i.e. it is busy deactivating/cleaning
up/etc) but the path unit would continue to ignore inotify events. In
short: any inotify event that occurs while the target unit deactivates
would be completely lost.

With this commit, the path will go back into a waiting state when the
target unit starts deactivating. This means that any inotify event that
occurs while the target unit deactivates will queue a start job.

8 months agonetwork/route: update MTU of IPv6 route even if the kernel returns -EEXIST
Yu Watanabe [Sat, 20 Jan 2024 06:55:06 +0000 (15:55 +0900)] 
network/route: update MTU of IPv6 route even if the kernel returns -EEXIST

8 months agoMerge pull request #31004 from AdrianVovk/misc-cleanups
Mike Yuan [Sat, 20 Jan 2024 08:43:20 +0000 (16:43 +0800)] 
Merge pull request #31004 from AdrianVovk/misc-cleanups

Misc cleanups

8 months agotest-local-addresses: add more test cases 31015/head
Yu Watanabe [Fri, 19 Jan 2024 13:34:22 +0000 (22:34 +0900)] 
test-local-addresses: add more test cases

8 months agolocal-addresses: introduce has_local_address() helper function
Yu Watanabe [Fri, 19 Jan 2024 13:33:36 +0000 (22:33 +0900)] 
local-addresses: introduce has_local_address() helper function

It will be used later.

8 months agosd-netlink: drop unused parser for RTA_MULTIPATH
Yu Watanabe [Fri, 19 Jan 2024 11:16:59 +0000 (20:16 +0900)] 
sd-netlink: drop unused parser for RTA_MULTIPATH

8 months agolocal-addresses: introduce own parser for RTA_MULTIPATH
Yu Watanabe [Fri, 19 Jan 2024 11:14:08 +0000 (20:14 +0900)] 
local-addresses: introduce own parser for RTA_MULTIPATH

8 months agolocal-addresses: also save weight of multipath routes
Yu Watanabe [Fri, 19 Jan 2024 11:12:09 +0000 (20:12 +0900)] 
local-addresses: also save weight of multipath routes

8 months agolocal-addresses: introduce generic setter add_local_addresses_full()
Yu Watanabe [Fri, 19 Jan 2024 11:08:06 +0000 (20:08 +0900)] 
local-addresses: introduce generic setter add_local_addresses_full()

8 months agolocal-addresses: RTA_OIF and RTA_MULTIPATH are exclusive
Yu Watanabe [Fri, 19 Jan 2024 11:07:17 +0000 (20:07 +0900)] 
local-addresses: RTA_OIF and RTA_MULTIPATH are exclusive

8 months agolocal-addresses: fix memleak of 'multipath_routes'
Yu Watanabe [Fri, 19 Jan 2024 11:04:01 +0000 (20:04 +0900)] 
local-addresses: fix memleak of 'multipath_routes'

Also reduces scopes of some variables.

8 months agolocal-addresses: always sort and dedup even if addresses are not requested
Yu Watanabe [Fri, 19 Jan 2024 10:47:29 +0000 (19:47 +0900)] 
local-addresses: always sort and dedup even if addresses are not requested

Otherwise, the return value may different when ret is NULL or not.

8 months agolocal-addresses: ignore tentative addresses
Yu Watanabe [Fri, 19 Jan 2024 10:44:49 +0000 (19:44 +0900)] 
local-addresses: ignore tentative addresses

As tentative addresses may be dropped soon if DAD failed.

8 months agolocal-addresses: check family more
Yu Watanabe [Fri, 19 Jan 2024 10:43:26 +0000 (19:43 +0900)] 
local-addresses: check family more

Just for safety. No functional change, unless the kernel sends broken
messages.

8 months agolocal-addresses: rename metric -> priority
Yu Watanabe [Fri, 19 Jan 2024 10:24:45 +0000 (19:24 +0900)] 
local-addresses: rename metric -> priority

To make it consistent with the netlink attribute RTA_PRIORITY.

8 months agotest-local-addresses: several modernization
Yu Watanabe [Fri, 19 Jan 2024 10:35:57 +0000 (19:35 +0900)] 
test-local-addresses: several modernization

- use size_t for number of addresses,
- use FOREACH_ARRAY() macro,
- use IN_ADDR_TO_STRING() macro, etc.

8 months agoptyfwd: when leaving a session with tinted background, clear to end of screen
Lennart Poettering [Fri, 19 Jan 2024 22:39:13 +0000 (23:39 +0100)] 
ptyfwd: when leaving a session with tinted background, clear to end of screen

So if we tint the background of a ptyfwd session with a color and the
session ends, then so far we reset the bg color and clear till the end
of line.

Let's instead clear till the end of the screen. This is nicer since it
means that any follow-up output will not be affected by the changed
background color anymore.

8 months agorun: the --background= switch expects an argument
Lennart Poettering [Fri, 19 Jan 2024 22:41:24 +0000 (23:41 +0100)] 
run: the --background= switch expects an argument

We got this right when running as "uid0", but wrong when invoked under
"systemd-run". Let's fix that.

8 months agoMerge pull request #31016 from poettering/pid1-priority-rework
Lennart Poettering [Fri, 19 Jan 2024 23:13:39 +0000 (00:13 +0100)] 
Merge pull request #31016 from poettering/pid1-priority-rework

pid1 event source priorities rework

8 months agologinctl: add --json= and -j to help text
Mike Yuan [Fri, 19 Jan 2024 15:01:42 +0000 (23:01 +0800)] 
loginctl: add --json= and -j to help text

Follow-up for ea54517476521a35fd10790664f2525a03c582b6

8 months agocgtop: fix sscanf return code checks
Luca Boccassi [Fri, 19 Jan 2024 15:12:49 +0000 (15:12 +0000)] 
cgtop: fix sscanf return code checks

sscanf can return EOF on error, so check that we get a result instead.

CodeQL#2386 and CodeQL#2387

8 months agoMerge pull request #31022 from aafeijoo-suse/bash-completion-cryptenroll-2
Luca Boccassi [Fri, 19 Jan 2024 18:00:10 +0000 (18:00 +0000)] 
Merge pull request #31022 from aafeijoo-suse/bash-completion-cryptenroll-2

fix typo and add some missing options to bash-completion

8 months agodocs: Fix typo in USER_RECORD 31004/head
Adrian Vovk [Wed, 10 Jan 2024 03:16:04 +0000 (22:16 -0500)] 
docs: Fix typo in USER_RECORD

8 months agofd-util: Close function for FD_TO_PTR
Adrian Vovk [Thu, 11 Jan 2024 20:43:05 +0000 (15:43 -0500)] 
fd-util: Close function for FD_TO_PTR

Just a function to be used as a destructor (i.e. in a _cleanup_
attribute, hash table operations, etc.) that closes an fd wrapped in
FD_TO_PTR

It just retrieves the fd via PTR_TO_FD and closes it

8 months agoportable: log structured message when attach/detach succeeds
Luca Boccassi [Thu, 18 Jan 2024 19:32:47 +0000 (19:32 +0000)] 
portable: log structured message when attach/detach succeeds

Currently portabled is completely silent (when not using debug level). But
when the system state is changed (ie: a portable is attached or detached)
there are no traces left in the journal. Log at info level when either of
those operations succeed, as they are effectively changing the state of
the system.

Create new MESSAGE_IDs for these logs, and also append PORTABLE_ROOT=
(and PORTABLE_EXTENSION= if any), like the units themselves are
configured to do via LogExtraFields=, so that the same metadata can
be found in the attach/detach messages and in logs from the units
themselves.

8 months agoman: clarify description of Attach/Detach flags
Luca Boccassi [Fri, 19 Jan 2024 14:46:25 +0000 (14:46 +0000)] 
man: clarify description of Attach/Detach flags

8 months agotest: add integration test for Type=exec robustness 31016/head
Lennart Poettering [Fri, 19 Jan 2024 13:36:13 +0000 (14:36 +0100)] 
test: add integration test for Type=exec robustness

This tests for #30799, so that it does not return.

8 months agomanager: order idle jobs
Lennart Poettering [Fri, 19 Jan 2024 13:09:42 +0000 (14:09 +0100)] 
manager: order idle jobs

Let's put the run queue really the last spot, as we should only start
doing more work if we really have nothing else to do anymore.

Let's move the service watchdog after the rewatch PID logic for similar
logic: it will possibly result in new jobs being enqueued to stop
things, and we should really have done all other work first.

8 months agomanager: renumber priorities
Lennart Poettering [Fri, 19 Jan 2024 13:08:38 +0000 (14:08 +0100)] 
manager: renumber priorities

no actual change, let's just make sure the priorities are densely
defined without "holes". Just to make this prettier and less surprising.

8 months agomanager: process exec_fd (i.e. Type=exec) events before SIGCHLD events
Lennart Poettering [Fri, 19 Jan 2024 13:03:55 +0000 (14:03 +0100)] 
manager: process exec_fd (i.e. Type=exec) events before SIGCHLD events

We want to make sure we don't confuse the case "process started
successfully but then failed quickly" from the case "process failed to
start". Hence we need to make sure we take notice of Type=exec before we
bother with SIGCHLD.

Hence move EVENT_PRIORITY_EXEC_FD to the front. In fact, let's move it
even further up than SIGCHLD, i.e. before sd_notify() handling, so that
we don't end up processing service state change notifications before we
even considered that the service is properly started.

This also gives the cgroup OOM handling and the exec_fd handling
different priorities, to improve robustness of the system, we should act
quickly on OOM, and it doesn't matter if a service started succcessfully
if we have to act on OOM anyway.

This is based on Andrew Onyshchuk <andryk.rv@gmail.com> work here:

See: #30799
Fixes: #28304
8 months agocore: maintain a single table with event source priorities
Lennart Poettering [Fri, 19 Jan 2024 12:50:17 +0000 (13:50 +0100)] 
core: maintain a single table with event source priorities

It's hard to oversee the assigned processing priorities of the various
event sources we have. Let's unify them in a table (an enum), where we
can have a single consisten look at them, and then reference the table
entries by expressive symbols.

This doesn#t change behaviour in any way, it just gives each priority a
nice label, but doesn't change any of the priorities.

Prompted by: #30799

8 months agodissect: fix typo 31022/head
Antonio Alvarez Feijoo [Fri, 19 Jan 2024 15:01:13 +0000 (16:01 +0100)] 
dissect: fix typo

8 months agobash-completion: add missing options to systemd-dissect
Antonio Alvarez Feijoo [Fri, 19 Jan 2024 14:50:15 +0000 (15:50 +0100)] 
bash-completion: add missing options to systemd-dissect

8 months agobash-completion: add missing options to systemd-cryptenroll
Antonio Alvarez Feijoo [Fri, 19 Jan 2024 14:49:52 +0000 (15:49 +0100)] 
bash-completion: add missing options to systemd-cryptenroll

8 months agonetwork: fix typo
Yu Watanabe [Fri, 19 Jan 2024 14:27:31 +0000 (23:27 +0900)] 
network: fix typo

Follow-up for 406fde1a4d87eb43cbec0b86213bf78b02595c6b.

8 months agoMerge pull request #31012 from YHNdnzj/pam-systemd-session-busy
Lennart Poettering [Fri, 19 Jan 2024 14:08:37 +0000 (15:08 +0100)] 
Merge pull request #31012 from YHNdnzj/pam-systemd-session-busy

pam_systemd: always check if session is busy

8 months agoMerge pull request #31013 from YHNdnzj/logind-modernization-split
Lennart Poettering [Fri, 19 Jan 2024 14:06:17 +0000 (15:06 +0100)] 
Merge pull request #31013 from YHNdnzj/logind-modernization-split

logind: minor modernizations

8 months agoMerge pull request #31009 from yuwata/network-route-convert-before-requesting
Luca Boccassi [Fri, 19 Jan 2024 13:20:32 +0000 (13:20 +0000)] 
Merge pull request #31009 from yuwata/network-route-convert-before-requesting

network/route: convert routes before requesting

8 months agologind-dbus: use SESSION_IS_{SELF,AUTO} instead of SEAT_* for sessions 31013/head
Mike Yuan [Thu, 18 Jan 2024 15:22:39 +0000 (23:22 +0800)] 
logind-dbus: use SESSION_IS_{SELF,AUTO} instead of SEAT_* for sessions

8 months agologind-user: use RET_GATHER more
Mike Yuan [Fri, 19 Jan 2024 12:12:14 +0000 (20:12 +0800)] 
logind-user: use RET_GATHER more

8 months agopam_systemd: always check if session is busy 31012/head
Mike Yuan [Fri, 19 Jan 2024 12:00:31 +0000 (20:00 +0800)] 
pam_systemd: always check if session is busy

We need to check for BUS_ERROR_SESSION_BUSY no matter
whether pidfd is used, i.e. after we retry with
CreateSession().

8 months agopam_systemd: close pidfd after use
Mike Yuan [Fri, 19 Jan 2024 11:57:31 +0000 (19:57 +0800)] 
pam_systemd: close pidfd after use

8 months agoboot: don't print error if device tree fixup protocol isn't supported
Clayton Craft [Fri, 19 Jan 2024 00:20:55 +0000 (16:20 -0800)] 
boot: don't print error if device tree fixup protocol isn't supported

This isn't a failure we care about, and it's somewhat alarming to see a
red error message flash up on the display when booting, so this just
simply returns EFI_SUCCESS and skips printing the "error" altogether.

8 months agoMerge pull request #30956 from yuwata/nspawn-network-pass-wifi
Luca Boccassi [Fri, 19 Jan 2024 11:41:58 +0000 (11:41 +0000)] 
Merge pull request #30956 from yuwata/nspawn-network-pass-wifi

nspawn: support passing wireless interface to container

8 months agojournalctl: consider shut down namespaced sd-journald instance synced
Frantisek Sumsal [Thu, 18 Jan 2024 16:20:52 +0000 (17:20 +0100)] 
journalctl: consider shut down namespaced sd-journald instance synced

If the namespaced systemd-journald instance was shut down due to
inactivity, we can consider it synchronized, so avoid throwing an error
in such case.

This should help with the random TEST-44-LOG-NAMESPACE fails where we
might try to sync the namespace just after it was shut down:

[    7.682941] H testsuite-44.sh[381]: + systemd-run --wait -p LogNamespace=foobaz echo 'hello world'
[    7.693916] H systemd-journald[389]: Failed to open /dev/kmsg, ignoring: Operation not permitted
[    7.693983] H systemd-journald[389]: Collecting audit messages is disabled.
[    7.725511] H systemd[1]: Started systemd-journald@foobar.service.
[    7.726496] H systemd[1]: Listening on systemd-journald-varlink@foobaz.socket.
[    7.726808] H systemd[1]: Listening on systemd-journald@foobaz.socket.
[    7.750774] H systemd[1]: Started run-u3.service.
[    7.795122] H systemd[1]: run-u3.service: Deactivated successfully.
[    7.842042] H testsuite-44.sh[390]: Running as unit: run-u3.service; invocation ID: 56380adeb36940a8a170d9ffd2e1e433
[    7.842561] H systemd[1]: systemd-journald-varlink@foobaz.socket: Deactivated successfully.
[    7.842762] H systemd[1]: Closed systemd-journald-varlink@foobaz.socket.
[    7.846394] H systemd[1]: systemd-journald@foobaz.socket: Deactivated successfully.
[    7.846566] H systemd[1]: Closed systemd-journald@foobaz.socket.
[    7.852983] H testsuite-44.sh[390]: Finished with result: success
[    7.852983] H testsuite-44.sh[390]: Main processes terminated with: code=exited/status=0
[    7.852983] H testsuite-44.sh[390]: Service runtime: 44ms
[    7.852983] H testsuite-44.sh[390]: CPU time consumed: 8ms
[    7.852983] H testsuite-44.sh[390]: Memory peak: 880.0K
[    7.852983] H testsuite-44.sh[390]: Memory swap peak: 0B
[    7.853785] H testsuite-44.sh[381]: + journalctl --namespace=foobar --sync
[    7.860095] H systemd-journald[389]: Received client request to sync journal.
[    7.862119] H testsuite-44.sh[381]: + journalctl --namespace=foobaz --sync
[    7.868381] H journalctl[396]: Failed to connect to /run/systemd/journal.foobaz/io.systemd.journal: Connection refused
[    7.871498] H systemd[1]: testsuite-44.service: Main process exited, code=exited, status=1/FAILURE
[    7.871642] H systemd[1]: testsuite-44.service: Failed with result 'exit-code'.
[    7.930772] H systemd[1]: Failed to start testsuite-44.service.

8 months agonetwork/route-nexthop: configure as a simple gateway when MultipathRoute= is specifie... 31009/head
Yu Watanabe [Sat, 13 Jan 2024 04:32:27 +0000 (13:32 +0900)] 
network/route-nexthop: configure as a simple gateway when MultipathRoute= is specified only once

The kernel handles such configuration completely equivalent to the case
that Gateway= is specified.

8 months agonetwork/route: drop unnecessary ownership transfer
Yu Watanabe [Sat, 13 Jan 2024 11:18:24 +0000 (20:18 +0900)] 
network/route: drop unnecessary ownership transfer

Let's free Route objects on the caller side.

8 months agonetwork/route-nexthop: drop unnecessary link arguments
Yu Watanabe [Sat, 13 Jan 2024 07:02:44 +0000 (16:02 +0900)] 
network/route-nexthop: drop unnecessary link arguments

These arguments are unused now.

8 months agonetwork/route: convert route before requesting
Yu Watanabe [Tue, 16 Jan 2024 13:36:29 +0000 (22:36 +0900)] 
network/route: convert route before requesting

Previously,
1. use the passed Route object as is when a route is requested,
2. when the route becomes ready to configure, convert the Route object
   if necessary, to resolve outgoing interface name, and split multipath
   routes, and save them to the associated interfaces,
3. configure the route with the passed Route object.

However, there are several inconsistencies with what kernel does:
- The kernel does not merge nor split IPv4 multipath routes. However, we
  unconditionally split multipath routes to manage.
- The kernel does not set gateway or so to a route if it has nexthop ID.

Fortunately, I do not find any issues caused by the inconsistencies. But
for safety, let's manage routes in a consistent way with the kernel.

This makes,
1. when a route is requested, split IPv6 multipath routes, but keep IPv4
   multipath routes as is, and queue (possibly multiple) requests for
   the route.
2. when the route becomes ready to configure, resolve nexthop and interface
   name, and requeue request if necessary.
3. configure the (possibly split) route.

By using the logic,
- Now we manage routes in a mostly consistent way with the kernel.
- We can drop ConvertedRoutes object.
- Hopefully the code becomes much simpler.

8 months agonetwork/route-nexthop: fix route_nexthop_copy()
Yu Watanabe [Fri, 19 Jan 2024 10:19:01 +0000 (19:19 +0900)] 
network/route-nexthop: fix route_nexthop_copy()

Follow-up for 413ea20ab3d86b5bccf775da21a945327b3880c9.

8 months agotest-13-NSPAWN: add more test case for passing network interfaces 30956/head
Yu Watanabe [Wed, 17 Jan 2024 01:55:35 +0000 (10:55 +0900)] 
test-13-NSPAWN: add more test case for passing network interfaces

- test interface renaming that conflicts with the current alternative
  network interface name,
- test passing wlan interfaces.

8 months agonspawn-network: support passing wireless interface to container
Yu Watanabe [Wed, 17 Jan 2024 01:36:28 +0000 (10:36 +0900)] 
nspawn-network: support passing wireless interface to container

Closes #7873.

8 months agonspawn-network: also check alternative names
Yu Watanabe [Wed, 17 Jan 2024 01:07:19 +0000 (10:07 +0900)] 
nspawn-network: also check alternative names

If the requested new name for a network interface is already assigned as a
alternative name, then it is not necessary to and cannot rename the
interface.

8 months agonspawn-network: split out move_network_interface_one()
Yu Watanabe [Wed, 17 Jan 2024 00:48:12 +0000 (09:48 +0900)] 
nspawn-network: split out move_network_interface_one()

This also changes to use sd_device to get some attributes.
So, on moving interfaces back to the parent, we need to populate sysfs
associated to the client netns.
That may look redundant and complicated, but it makes later change
easier, and hopefully faster.

8 months agonspawn-network: split out move_back_network_interfaces()
Yu Watanabe [Wed, 17 Jan 2024 00:28:31 +0000 (09:28 +0900)] 
nspawn-network: split out move_back_network_interfaces()

No functional change, just refactoring and preparation for later
commits.

8 months agosd-netlink: add policy for NL80211_ATTR_NETNS_FD
Yu Watanabe [Wed, 17 Jan 2024 01:32:10 +0000 (10:32 +0900)] 
sd-netlink: add policy for NL80211_ATTR_NETNS_FD

8 months agosd-netlink: introduce rtnl_rename_link()
Yu Watanabe [Fri, 19 Jan 2024 03:35:25 +0000 (12:35 +0900)] 
sd-netlink: introduce rtnl_rename_link()

8 months agosd-device: introduce device_get_sysattr_u32()
Yu Watanabe [Tue, 16 Jan 2024 07:07:58 +0000 (16:07 +0900)] 
sd-device: introduce device_get_sysattr_u32()

8 months agoudev-util: introduce reset_cached_udev_availability()
Yu Watanabe [Wed, 17 Jan 2024 05:09:05 +0000 (14:09 +0900)] 
udev-util: introduce reset_cached_udev_availability()

8 months agonamespace-util: introduce netns_acquire()
Yu Watanabe [Fri, 19 Jan 2024 02:34:17 +0000 (11:34 +0900)] 
namespace-util: introduce netns_acquire()

Similar to userns_acquire(), but for network namespace.

8 months agoprocess-util: introduce FORK_NEW_NETNS for safe_fork()
Yu Watanabe [Fri, 19 Jan 2024 02:32:10 +0000 (11:32 +0900)] 
process-util: introduce FORK_NEW_NETNS for safe_fork()

Similar to FORK_NEW_MOUNTNS or FORK_NEW_USERNS.

8 months agonamespace-util: downgrade log level in userns_acquire()
Yu Watanabe [Fri, 19 Jan 2024 02:30:16 +0000 (11:30 +0900)] 
namespace-util: downgrade log level in userns_acquire()

On failure, the caller logs the error in LOG_ERR.

8 months agotree-wide: add short comments for namespace_open() and namespace_enter()
Yu Watanabe [Fri, 19 Jan 2024 01:46:20 +0000 (10:46 +0900)] 
tree-wide: add short comments for namespace_open() and namespace_enter()

Also use -EBADF when unspecified.

8 months agonamespace-util: rename arguments to prefix 'ret_'
Yu Watanabe [Tue, 16 Jan 2024 19:20:06 +0000 (04:20 +0900)] 
namespace-util: rename arguments to prefix 'ret_'

Also reorder opening namespace fd to make it match with the order of the
arguments.

8 months agoRevert "man: add missing <cmdsynopsis> wrapper"
Antonio Alvarez Feijoo [Thu, 18 Jan 2024 13:45:24 +0000 (14:45 +0100)] 
Revert "man: add missing <cmdsynopsis> wrapper"

This reverts commit 35fc10756bc5302d2dff1c235f864fa23a6d8771.

Although DocBook 4.5 states that `cmdsynopsis` can be used within `term` [1],
and `term` within `varlistentry`, `man` does not display the list of commands
after this change. FWIW, `cmdsynopsis` is used tree-wide within `refsynopsisdiv`
only.

[1] https://tdg.docbook.org/tdg/4.5/term

8 months agonetwork: use strdup_or_null() where appropriate
Yu Watanabe [Fri, 19 Jan 2024 01:27:14 +0000 (10:27 +0900)] 
network: use strdup_or_null() where appropriate

8 months agovirt: support detection of Apple Virtualization guests with cpuid
Black-Hole1 [Fri, 19 Jan 2024 03:38:49 +0000 (11:38 +0800)] 
virt: support detection of Apple Virtualization guests with cpuid

This is a supplement to #24419. On macOS Intel machines, detection needs to be done through cpuid.
In macOS, `dmi_vendors` detection is only applicable to M series.

Signed-off-by: Black-Hole1 <bh@bugs.cc>
8 months agoMerge pull request #30975 from yuwata/network-route-several-helper-functions
Yu Watanabe [Fri, 19 Jan 2024 05:42:40 +0000 (14:42 +0900)] 
Merge pull request #30975 from yuwata/network-route-several-helper-functions

network/route: introduce several helper functions

8 months agonetwork/route: introduce route_get_request() 30975/head
Yu Watanabe [Tue, 16 Jan 2024 05:19:01 +0000 (14:19 +0900)] 
network/route: introduce route_get_request()

No functional change, just refactoring and preparation for later
commits.

8 months agonetwork: adjust nexthops of dynamic routes before requesting
Yu Watanabe [Tue, 16 Jan 2024 04:01:27 +0000 (13:01 +0900)] 
network: adjust nexthops of dynamic routes before requesting

No effective functionality is changed. Preparation for later commits.

8 months agonetwork/route-nexthop: introduce route_adjust_nexthops() and route_nexthops_needs_adj...
Yu Watanabe [Sun, 14 Jan 2024 05:50:19 +0000 (14:50 +0900)] 
network/route-nexthop: introduce route_adjust_nexthops() and route_nexthops_needs_adjust()

These are not used in this commit, but will be used later.
Preparation for later commits.

8 months agonetwork/route-nexthop: introduce route_nexthops_copy()
Yu Watanabe [Sun, 14 Jan 2024 04:49:30 +0000 (13:49 +0900)] 
network/route-nexthop: introduce route_nexthops_copy()

This also introduce an extra argument for route_dup(), but it is
currently unused, will be used later.

No functional change, just preparation for later commits.