]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agotest: add testcase that verifies we can safely delete subcgroups owned by other users... 35922/head
Lennart Poettering [Wed, 8 Jan 2025 12:55:07 +0000 (13:55 +0100)] 
test: add testcase that verifies we can safely delete subcgroups owned by other users if we own the parent

This is a test for the previous commits: we create an unpriv, delegated cgroup in
--user mode, then create a subcgroup that is owned by some other user
(to mimic the case where an unpriv user got a userns with delegated UIDs
assigned), and then try to stop the unit. traditionally this would fail,
because our unpriv systemd --user instance can't remove the subcrroup
owned by someone else. With the earlier patches this is addressed.

9 months agocgroup: when we fail to clean up a cgroup, let's ask PID 1 for help
Lennart Poettering [Tue, 12 Nov 2024 11:03:05 +0000 (12:03 +0100)] 
cgroup: when we fail to clean up a cgroup, let's ask PID 1 for help

9 months agopid1: add D-Bus API for removing delegated subcgroups
Lennart Poettering [Tue, 12 Nov 2024 10:59:40 +0000 (11:59 +0100)] 
pid1: add D-Bus API for removing delegated subcgroups

When running unprivileged containers, we run into a scenario where an
unpriv owned cgroup has a subcgroup delegated to another user (i.e. the
container's own UIDs). When the owner of that cgroup dies without
cleaning it up then the unpriv service manager might encounter a cgroup
it cannot delete anymore.

Let's address that: let's expose a method call on the service manager
(primarly in PID1) that can be used to delete a subcgroup of a unit one
owns. This would then allow the unpriv service manager to ask the priv
service manager to get rid of such a cgroup.

This commit only adds the method call, the next commit then adds the
code that makes use of this.

9 months agopid1: allow moving processes in a userns owned by the user, too
Lennart Poettering [Wed, 27 Nov 2024 09:19:21 +0000 (10:19 +0100)] 
pid1: allow moving processes in a userns owned by the user, too

Let's liberalize process migration a bit. Previously, PID 1 would only
allow you to move processes into your own cgroups, if those processes
are owned by you too. This is now slightly relaxed: it's now also OK if
the processes are in a userns owned by you.

This makes process migration more useful in context of unpriv userns.

9 months agoSimple pam_systemd clean-ups (#35919)
Lennart Poettering [Wed, 8 Jan 2025 14:03:36 +0000 (15:03 +0100)] 
Simple pam_systemd clean-ups (#35919)

9 months agofmf: Only mess with /etc/yum.repos.d when running within testing farm
Daan De Meyer [Wed, 8 Jan 2025 11:12:15 +0000 (12:12 +0100)] 
fmf: Only mess with /etc/yum.repos.d when running within testing farm

If running tmt locally to debug the test script, make sure we don't
mess with /etc/yum.repos.d.

9 months agoThree fmf fixes (#35917)
Daan De Meyer [Wed, 8 Jan 2025 11:29:10 +0000 (12:29 +0100)] 
Three fmf fixes (#35917)

9 months agologind: also potentially GC the session if we cannot send reply 35919/head
Lennart Poettering [Tue, 19 Nov 2024 22:23:21 +0000 (23:23 +0100)] 
logind: also potentially GC the session if we cannot send reply

9 months agologind: indicate that 'error' parameter is input by making it const
Lennart Poettering [Tue, 19 Nov 2024 21:42:26 +0000 (22:42 +0100)] 
logind: indicate that 'error' parameter is input by making it const

9 months agologind: split out logic that finds free session ID into helper call
Lennart Poettering [Tue, 19 Nov 2024 19:46:55 +0000 (20:46 +0100)] 
logind: split out logic that finds free session ID into helper call

Just some refactoring to make an overly large function a bit smaller.

9 months agologind: normalize parameter to create_session()
Lennart Poettering [Tue, 19 Nov 2024 14:55:03 +0000 (15:55 +0100)] 
logind: normalize parameter to create_session()

We can pass a properly typed Manager object here, no reason to pass it
as void*.

9 months agofmf: Fix glob 35917/head
Daan De Meyer [Wed, 8 Jan 2025 09:38:21 +0000 (10:38 +0100)] 
fmf: Fix glob

Globs inside quotes aren't expanded and we need the glob to be more
specific to avoid matching multiple entries inside the tmt source
directory.

9 months agofmf: Fix dist-git example
Daan De Meyer [Wed, 8 Jan 2025 09:25:50 +0000 (10:25 +0100)] 
fmf: Fix dist-git example

All that's needed is dist-git-source: true so remove the other settings
that aren't required.

9 months agofmf: Don't fail if we can't put selinux in permissive mode
Daan De Meyer [Wed, 8 Jan 2025 09:25:05 +0000 (10:25 +0100)] 
fmf: Don't fail if we can't put selinux in permissive mode

The tests might be running unprivileged or in an environment without
selinux so let's not fail if we can't put it in permissive mode.

9 months agoStop installing some markdown docs/ files
Luca Boccassi [Sat, 4 Jan 2025 14:33:03 +0000 (14:33 +0000)] 
Stop installing some markdown docs/ files

These files are rendered on systemd.io and targeted at contributors, not
users, so it's not really useful to install them on a running system.

9 months agonamespace-util: two new operations (#35833)
Lennart Poettering [Wed, 8 Jan 2025 08:35:21 +0000 (09:35 +0100)] 
namespace-util: two new operations (#35833)

(This is preparation for #35685, but since it comes with nice test cases
should be safe to add on their own)

9 months agonamespace-util: add process_is_owned_by_uid() helper 35833/head
Lennart Poettering [Wed, 27 Nov 2024 09:17:00 +0000 (10:17 +0100)] 
namespace-util: add process_is_owned_by_uid() helper

9 months agonamespace-util: add helper to get base UID from userns
Lennart Poettering [Thu, 14 Nov 2024 08:55:26 +0000 (09:55 +0100)] 
namespace-util: add helper to get base UID from userns

9 months agonamespace-util: slightly tweak proc_mounted() handling in namespace_is_init()
Lennart Poettering [Tue, 7 Jan 2025 09:55:29 +0000 (10:55 +0100)] 
namespace-util: slightly tweak proc_mounted() handling in namespace_is_init()

Let's not sloppily eat up errors here.

9 months agonamespace-util: return recognizable error if namespace_open_by_type() fails because...
Lennart Poettering [Tue, 7 Jan 2025 09:53:01 +0000 (10:53 +0100)] 
namespace-util: return recognizable error if namespace_open_by_type() fails because ns type not supported

This makes sure the the codepath that derives an nsfd from a pid works
the same for the pidfd case and the non-pidfd case: if we can verify
that /proc/ is mounted but the /proc/$PID/ns/ files are missing, we can
assume the ns type is not supported by the kernel. Hence return the same
ENOPKG error in this case as we already do in the pidfd ioctl based
codepath.

9 months agoBump minimum kernel baseline to 5.4, recommended version to 5.7
Mike Yuan [Tue, 7 Jan 2025 17:28:33 +0000 (18:28 +0100)] 
Bump minimum kernel baseline to 5.4, recommended version to 5.7

As requested, a list of kernel version to feature mapping
for kernels older than minimum baseline is also included,
in order to ease potential backport work.

10 months agoudev: introduce io.systemd.Udev varlink interface (#35721)
Lennart Poettering [Tue, 7 Jan 2025 15:49:37 +0000 (16:49 +0100)] 
udev: introduce io.systemd.Udev varlink interface (#35721)

Replaces #25523.

10 months agoresolve: fix typo in DNS_EDE_RCODE_PROHIBITIED constant name
Tobias Klauser [Tue, 7 Jan 2025 12:29:45 +0000 (13:29 +0100)] 
resolve: fix typo in DNS_EDE_RCODE_PROHIBITIED constant name

Drop the extra `I` and rename the constant to DNS_EDE_RCODE_PROHIBITED
in accordance with the error code string.

10 months agomkosi: Bump device timeout back to default value
Daan De Meyer [Wed, 18 Dec 2024 10:44:03 +0000 (11:44 +0100)] 
mkosi: Bump device timeout back to default value

Hopefully fixes #35302

10 months agostdio-bridge: fix polled fds
Jacob McNamee [Tue, 7 Jan 2025 11:29:31 +0000 (03:29 -0800)] 
stdio-bridge: fix polled fds

Poll fds associated with the bus instead of hardcoding stdin/stdout.

This is consequential under socket activation, when the provided fd
should be used instead of stdin/stdout.

10 months agofmf: Check out target branch in packit
Daan De Meyer [Tue, 7 Jan 2025 13:39:53 +0000 (14:39 +0100)] 
fmf: Check out target branch in packit

10 months agopackit: Simplify configuration
Daan De Meyer [Mon, 6 Jan 2025 12:44:03 +0000 (13:44 +0100)] 
packit: Simplify configuration

10 months agoobs: also trigger Fedora package builds
Luca Boccassi [Tue, 7 Jan 2025 00:40:02 +0000 (00:40 +0000)] 
obs: also trigger Fedora package builds

The package is logistically separated, as the rpm sources conflict from Fedora
conflict with the rpm sources from SUSE (some files have the same name and
location but different, incompatible content), so Fedora builds can't be
triggered from the same package. The result is the same.

10 months agoask-password: req must be non-NULL
Yu Watanabe [Tue, 7 Jan 2025 10:28:15 +0000 (19:28 +0900)] 
ask-password: req must be non-NULL

After #35074, the parameter 'req' must be non-NULL.

Fixes CID#1586101, CID#1586102, and CID#1586103.

10 months agomkosi: Install which in build image
Daan De Meyer [Tue, 7 Jan 2025 11:23:09 +0000 (12:23 +0100)] 
mkosi: Install which in build image

Required by gdb-add-index to find gdb and not declared as a dependency
of the package.

10 months agotest: add test case for AddDependencyUnitFiles assert
Luca Boccassi [Mon, 6 Jan 2025 23:47:45 +0000 (23:47 +0000)] 
test: add test case for AddDependencyUnitFiles assert

Follow-up for d87dc74e8f1a30d72a0f202e411400bab34ab55a

10 months agounits: introduce systemd-udevd-varlink.socket 35721/head
Yu Watanabe [Sat, 21 Dec 2024 22:07:50 +0000 (07:07 +0900)] 
units: introduce systemd-udevd-varlink.socket

Co-authored-by: David Tardon <dtardon@redhat.com>
10 months agoudevadm: use varlink connection to send ping
Yu Watanabe [Sat, 21 Dec 2024 21:53:43 +0000 (06:53 +0900)] 
udevadm: use varlink connection to send ping

10 months agoudevadm-control: use varlink to send commands
Yu Watanabe [Sat, 21 Dec 2024 21:03:52 +0000 (06:03 +0900)] 
udevadm-control: use varlink to send commands

10 months agoudev-varlink: introduce io.systemd.Udev varlink interface
Yu Watanabe [Sat, 21 Dec 2024 16:58:09 +0000 (01:58 +0900)] 
udev-varlink: introduce io.systemd.Udev varlink interface

Co-authored-by: David Tardon <dtardon@redhat.com>
10 months agoTEST-17-UDEV: wait for udevd being restarted after exit control command
Yu Watanabe [Tue, 7 Jan 2025 11:23:02 +0000 (20:23 +0900)] 
TEST-17-UDEV: wait for udevd being restarted after exit control command

Also wait for created devices being processed before running tests.

10 months agodocs: Remove VIRTUALIZED_TESTING.md
Daan De Meyer [Tue, 7 Jan 2025 09:36:25 +0000 (10:36 +0100)] 
docs: Remove VIRTUALIZED_TESTING.md

Let's nuke this out-of-date doc in favor of HACKING.md.

10 months agorepart: Use streq_ptr()
Daan De Meyer [Mon, 6 Jan 2025 22:02:30 +0000 (23:02 +0100)] 
repart: Use streq_ptr()

p->format is not guaranteed to be initialized.

10 months agomachine: update log message and comments
Yu Watanabe [Mon, 6 Jan 2025 23:30:37 +0000 (08:30 +0900)] 
machine: update log message and comments

Follow-up for 9af9d66184caf565805d0cabc1dd99de5469931e and
453f2359ffcafaafe10297319dd8f85a11a4e1c4.

10 months agoxopenat(): introduce new XO_REGULAR flag (#35834)
Lennart Poettering [Tue, 7 Jan 2025 07:55:56 +0000 (08:55 +0100)] 
xopenat(): introduce new XO_REGULAR flag (#35834)

This is something I think we should have added a long time ago: a
flavour of open() that safely ensures the inode we are opening is a
regular file, before we open it. It does this by means of pinning the
inode via O_PATH first, and after verification actually opening it.

This ports some code over to this, but sooner or later we should
probably use this a lot more, so that we don't accidentally open weird
stuff such as device nodes or pipes, where we should not.

10 months agopretty-print: drop extra ';' from progress reporting end sequence
Lennart Poettering [Mon, 6 Jan 2025 21:36:50 +0000 (22:36 +0100)] 
pretty-print: drop extra ';' from progress reporting end sequence

This corrects the closing sequence for the ConEmu progress reporting
final sequence. We by mistake sent two final ;;, where only one was
expected. The terminals I tested this with didn't care, but Ghostty
apparently does. Let's fix things and generate the closing sequence as
per doc:

https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC

10 months agoprocess-util: a process from a foreign pidns is definitely not our child
Lennart Poettering [Mon, 6 Jan 2025 16:19:34 +0000 (17:19 +0100)] 
process-util: a process from a foreign pidns is definitely not our child

Addresses: https://github.com/systemd/systemd/pull/35242#pullrequestreview-2531712318

10 months agobasic/linux: update kernel headers from v6.13-rc6
Yu Watanabe [Mon, 6 Jan 2025 14:10:22 +0000 (23:10 +0900)] 
basic/linux: update kernel headers from v6.13-rc6

This also removes README and moves the explanation about the header
modification to the script.

10 months agoupdate TODO 35834/head
Lennart Poettering [Sat, 21 Dec 2024 12:05:25 +0000 (13:05 +0100)] 
update TODO

10 months agocopy: port things over to XO_REGULAR
Lennart Poettering [Sat, 21 Dec 2024 12:04:48 +0000 (13:04 +0100)] 
copy: port things over to XO_REGULAR

10 months agomachine: switch to using cleanup handling for child process cleanup
Lennart Poettering [Mon, 6 Jan 2025 22:29:32 +0000 (23:29 +0100)] 
machine: switch to using cleanup handling for child process cleanup

10 months agomachine: transition back to host mount ns before copying files from/to container
Lennart Poettering [Mon, 6 Jan 2025 21:47:34 +0000 (22:47 +0100)] 
machine: transition back to host mount ns before copying files from/to container

When copying files from or to a container we so far opened the host side
fd first, then entered the container (specifically, joined it's mount
namespace) in a forked off child process, and opened the other side
there, followed by the (potentially slow) copying from inside the
container mount namespace.

This commit changes this so that we rejoin the host mount namespace
before doing the copying routine. This is relevant, so that we can rely
on /proc/self/fd/… to work, which is not the case otherwise, as we'll
see /proc/ from a pidns that is not our own, in wich case
/proc/self/fd/… is refused. By moving back to the host mount namespace
our own pidns and the pidns the /proc/ mount belongs to will be in sync
again, and all is good.

This is in particular preparation for the next commit, that makes the
copy routine strictly depending on /proc/ being accessible and working.

10 months agofs-util: add XO_REGULAR flag for xopenat()
Lennart Poettering [Sat, 21 Dec 2024 11:54:53 +0000 (12:54 +0100)] 
fs-util: add XO_REGULAR flag for xopenat()

If this flag is set we guarantee that the fd returned refers to a
regular file. If the file exists and is not one, fails.

10 months agomachine: introduce io.systemd.Machine.{CopyFrom, CopyTo} methods (#34913)
Daan De Meyer [Mon, 6 Jan 2025 22:16:33 +0000 (23:16 +0100)] 
machine: introduce io.systemd.Machine.{CopyFrom, CopyTo} methods (#34913)

This PR introduces io.systemd.Machine.CopyFrom and CopyTo method which
are DBus alternatives of:
- CopyFromMachine
- CopyToMachine
- CopyFromMachineWithFlags
- CopyToMachineWithFlags

The PR also contain tests

10 months agocore: fix assert when AddDependencyUnitFiles is called with invalid parameter
Luca Boccassi [Mon, 6 Jan 2025 18:16:29 +0000 (18:16 +0000)] 
core: fix assert when AddDependencyUnitFiles is called with invalid parameter

unit_file_add_dependency() asserts, so check before calling it that the
type is expected, or return EINVAL to the caller.

root@localhost:~# busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager AddDependencyUnitFiles "asssbb" 0 uwhatm8 After 1 1

Broadcast message from systemd-journald@localhost (Mon 2025-01-06 18:12:14 UTC):

systemd[1]: Caught <ABRT>, from our own process.

Fixes https://github.com/systemd/systemd/issues/35882

10 months agohwdb: WALTOP International Corp. Slim Tablet Stylus
Arnaudv6 [Mon, 6 Jan 2025 18:02:32 +0000 (19:02 +0100)] 
hwdb: WALTOP International Corp. Slim Tablet Stylus

10 months agotree-wide: drop references to CentoS/RHEL 7 and 8 (#35881)
Luca Boccassi [Mon, 6 Jan 2025 18:38:05 +0000 (18:38 +0000)] 
tree-wide: drop references to CentoS/RHEL 7 and 8 (#35881)

10 months agoTwo fmf fixes (#35879)
Luca Boccassi [Mon, 6 Jan 2025 18:05:44 +0000 (18:05 +0000)] 
Two fmf fixes (#35879)

10 months agotest-network: drop workaround for old CentOS release 35881/head
Yu Watanabe [Mon, 6 Jan 2025 16:55:55 +0000 (01:55 +0900)] 
test-network: drop workaround for old CentOS release

10 months agotest-network: nowadays it runs not only on CentOS
Yu Watanabe [Mon, 6 Jan 2025 16:55:18 +0000 (01:55 +0900)] 
test-network: nowadays it runs not only on CentOS

10 months agomeson: drop workaround for CentOS 8
Yu Watanabe [Mon, 6 Jan 2025 16:53:50 +0000 (01:53 +0900)] 
meson: drop workaround for CentOS 8

CentOS 8 and RHEL 8 reached EOL.

10 months agodocs: replace link to RHEL7 document with RHEL9 documents
Yu Watanabe [Mon, 6 Jan 2025 16:53:19 +0000 (01:53 +0900)] 
docs: replace link to RHEL7 document with RHEL9 documents

10 months agotools: drop workaround for CentOS 7
Yu Watanabe [Mon, 6 Jan 2025 17:04:34 +0000 (02:04 +0900)] 
tools: drop workaround for CentOS 7

10 months agoREADME: CentOS Stream 8 reached EOL
Yu Watanabe [Mon, 6 Jan 2025 16:21:13 +0000 (01:21 +0900)] 
README: CentOS Stream 8 reached EOL

10 months agofmf: Support being used downstream in dist-git tests 35879/head
Daan De Meyer [Mon, 6 Jan 2025 15:30:23 +0000 (16:30 +0100)] 
fmf: Support being used downstream in dist-git tests

We can use our upstream fmf definitions to run downstream tests in
the Fedora systemd dist-git repository
(https://src.fedoraproject.org/rpms/systemd). To have access to the
dist-git sources when running the tests, we enable dist-git-source: true
downstream which makes the sources available in $TMT_SOURCE_DIR so
let's make sure we use those sources if they're available.

10 months agofmf: Insist on mkosi sha being available
Daan De Meyer [Mon, 6 Jan 2025 15:28:39 +0000 (16:28 +0100)] 
fmf: Insist on mkosi sha being available

Let's assume the workflow file containing the mkosi always being
available.

Also fix the detection while we're at it by not leaving the systemd
directory.

10 months agomachine: move io.systemd.Machine.Map* tests into right position 34913/head
Ivan Kruglov [Tue, 17 Dec 2024 18:03:05 +0000 (19:03 +0100)] 
machine: move io.systemd.Machine.Map* tests into right position

10 months agomachine: tests for io.systemd.Machine.{CopyFrom, CopyTo} methods
Ivan Kruglov [Thu, 24 Oct 2024 10:32:08 +0000 (12:32 +0200)] 
machine: tests for io.systemd.Machine.{CopyFrom, CopyTo} methods

10 months agomachine: introduce io.system.Machine.{CopyFrom, CopyTo} methods
Ivan Kruglov [Thu, 24 Oct 2024 10:19:56 +0000 (12:19 +0200)] 
machine: introduce io.system.Machine.{CopyFrom, CopyTo} methods

10 months agomachine: use machine_copy_from_to() in dbus implementation
Ivan Kruglov [Tue, 17 Dec 2024 11:53:28 +0000 (12:53 +0100)] 
machine: use machine_copy_from_to() in dbus implementation

10 months agomachine: introduce machine_copy_from_to() helper
Ivan Kruglov [Tue, 17 Dec 2024 11:25:34 +0000 (12:25 +0100)] 
machine: introduce machine_copy_from_to() helper

10 months agomachine: split operation initialization into two steps
Ivan Kruglov [Tue, 17 Dec 2024 11:24:51 +0000 (12:24 +0100)] 
machine: split operation initialization into two steps

10 months agomachine: adjust operation callback logic for varlink
Ivan Kruglov [Wed, 6 Nov 2024 13:31:29 +0000 (14:31 +0100)] 
machine: adjust operation callback logic for varlink

This is to simplyfy varlink callback. There is no use of this logic atm.
So, no harm.

10 months agosd-varlink: add flag for sd_varlink_server for creating connections w… (#35841)
Yu Watanabe [Mon, 6 Jan 2025 13:13:50 +0000 (22:13 +0900)] 
sd-varlink: add flag for sd_varlink_server for creating connections w… (#35841)

…ith fd passing enabled

Let's add a simple flag that enables fd passing for all connections of a
server. It's much easier to use this than to install a connect handler
which manually enables this for each connection.

10 months ago mkosi: Migrate more deprecated options (#35873)
Daan De Meyer [Mon, 6 Jan 2025 12:42:21 +0000 (13:42 +0100)] 
 mkosi: Migrate more deprecated options  (#35873)

10 months agoCI: add OBS workflow integration to build packages on push to main
Luca Boccassi [Mon, 6 Jan 2025 10:45:21 +0000 (10:45 +0000)] 
CI: add OBS workflow integration to build packages on push to main

When main is updated, packages for Arch/Debian/Ubuntu/SUSE will be built and published
on OBS:

https://download.opensuse.org/repositories/home:/bluca:/systemd/
https://build.opensuse.org/project/show/home:bluca:systemd

10 months agoci: Rename qemu variable to vm 35873/head
Daan De Meyer [Mon, 6 Jan 2025 11:08:33 +0000 (12:08 +0100)] 
ci: Rename qemu variable to vm

10 months agomkosi: Migrate more deprecated options
Daan De Meyer [Mon, 6 Jan 2025 11:07:53 +0000 (12:07 +0100)] 
mkosi: Migrate more deprecated options

10 months agosd-device: fix validation for devices under /sys/firmware/ in sd_device_new_from_subs...
Luca Boccassi [Mon, 6 Jan 2025 11:06:23 +0000 (11:06 +0000)] 
sd-device: fix validation for devices under /sys/firmware/ in sd_device_new_from_subsystem_sysname() (#35863)

Devices under /sys/firmware/ do not have subsystems. Hence, the
validation in sd_device_new_from_subsystem_sysname() ->
device_new_from_path_join() always failed.

Fixes a bug introduced by cd7c71154cd62d3f50c07ce387edd9c20aebd7bc
(v257).
Fixes #35861.

10 months agomkosi: replace deprecated settings and command with new ones
Yu Watanabe [Mon, 6 Jan 2025 07:30:26 +0000 (16:30 +0900)] 
mkosi: replace deprecated settings and command with new ones

Follow-up for c008b703701e676a88e16de4c867b9fc4818070d.

These settings and command were deprecated by the following commit.
https://github.com/systemd/mkosi/commit/ebcd2efa03af5c04de91434634f2e4a956f7e53c

10 months agomachine: several follow-ups for #35066 (#35868)
Daan De Meyer [Mon, 6 Jan 2025 10:59:55 +0000 (11:59 +0100)] 
machine: several follow-ups for #35066 (#35868)

Addresses the post-merge review comments.

10 months agobasic: port various pidfd/pidref helpers to PIDFD_GET_INFO and PIDFD_GET_*_NAMESPACE...
Lennart Poettering [Mon, 6 Jan 2025 10:23:08 +0000 (11:23 +0100)] 
basic: port various pidfd/pidref helpers to PIDFD_GET_INFO and PIDFD_GET_*_NAMESPACE (#35242)

Supersedes #35308 (cherry-picked one commit and replaced the rest)

(I left a few comments that's folded by GitHub. Please make sure to
check them too.)

10 months agomore pidref'ification (#35839)
Lennart Poettering [Mon, 6 Jan 2025 10:21:43 +0000 (11:21 +0100)] 
more pidref'ification (#35839)

This is split out of #35264, but makes a ton of sense on its own.

10 months agomountfsd,networkd,nsresourced: port over to new fd passing varlink server flags 35841/head
Lennart Poettering [Mon, 6 Jan 2025 08:33:50 +0000 (09:33 +0100)] 
mountfsd,networkd,nsresourced: port over to new fd passing varlink server flags

10 months agotty-ask-password-agent: if we're spawning further agents, grant them notify access...
Daan De Meyer [Mon, 6 Jan 2025 09:05:29 +0000 (10:05 +0100)] 
tty-ask-password-agent: if we're spawning further agents, grant them notify access (#35855)

Alternative to #35853

10 months agocgroup-util: add remoteness checks to all cg_pidref_get_xyz() calls 35839/head
Lennart Poettering [Mon, 6 Jan 2025 08:54:13 +0000 (09:54 +0100)] 
cgroup-util: add remoteness checks to all cg_pidref_get_xyz() calls

10 months agosd-login: make use of getpeerpidref() and cg_pidref_get_*()
Lennart Poettering [Tue, 19 Nov 2024 15:37:10 +0000 (16:37 +0100)] 
sd-login: make use of getpeerpidref() and cg_pidref_get_*()

10 months agocgroup-util: add pidref counterparts for cg_pid_get_session() + cg_pid_get_owner_uid()
Lennart Poettering [Tue, 19 Nov 2024 15:35:26 +0000 (16:35 +0100)] 
cgroup-util: add pidref counterparts for cg_pid_get_session() + cg_pid_get_owner_uid()

10 months agosocket-util: introduce getpeerpidref()
Lennart Poettering [Tue, 19 Nov 2024 15:35:48 +0000 (16:35 +0100)] 
socket-util: introduce getpeerpidref()

This combines getpeercred() and getpeerpidfd() and returns a PidRef

10 months agosd-varlink: add flag for sd_varlink_server for creating connections with fd passing...
Lennart Poettering [Wed, 20 Nov 2024 11:57:33 +0000 (12:57 +0100)] 
sd-varlink: add flag for sd_varlink_server for creating connections with fd passing enabled

Let's add a simple flag that enables fd passing for all connections of a
server. It's much easier to use this than to install a connect handler
which manually enables this for each connection.

10 months agomachine: comment source and destination must be absolute 35868/head
Yu Watanabe [Mon, 6 Jan 2025 08:12:26 +0000 (17:12 +0900)] 
machine: comment source and destination must be absolute

Addresses the post-merge review comment:
https://github.com/systemd/systemd/pull/35066#discussion_r1901841247

10 months agomachine: use json_dispatch_const_path() where applicable
Yu Watanabe [Mon, 6 Jan 2025 08:09:18 +0000 (17:09 +0900)] 
machine: use json_dispatch_const_path() where applicable

Follow-up for #35066 and 3866e9ce9d34328460aee5ca01f6f1becfa200eb.

10 months agopackit: Move fmf metadata into upstream (#35700)
Yu Watanabe [Mon, 6 Jan 2025 01:37:56 +0000 (10:37 +0900)] 
packit: Move fmf metadata into upstream (#35700)

This moves https://src.fedoraproject.org/tests/systemd into upstream so
it's one less moving piece that we need to remember.

10 months agopackit: Move fmf metadata into upstream 35700/head
Daan De Meyer [Fri, 20 Dec 2024 14:34:13 +0000 (15:34 +0100)] 
packit: Move fmf metadata into upstream

This moves https://src.fedoraproject.org/tests/systemd into upstream
so it's one less moving piece that we need to remember. While we're at
it, do various cleanups as well:

- Remove non-packit logic
- Set NO_BUILD in mkosi.local.conf as it's not picked up from the
  process environment
- Don't set unused environment variables
- Remove workdir logic as we run in an ephemeral VM already
- Drop --verbose from meson test to reduce noise
  from passed tests
- Use mkosi sandbox and drop duplicated deps from metadata file
- Stop running the unit tests as they already run as part of the rpm
  build and as part of the integration tests.
- Various style fixes

10 months agomkosi: Make path exclude more generic
Daan De Meyer [Sun, 5 Jan 2025 22:19:44 +0000 (23:19 +0100)] 
mkosi: Make path exclude more generic

The systemd rpms we try to install in packit have /usr/bin/bash and
/usr/bin/python3 as dependencies which breaks dnf5 because mkosi
doesn't download filelists metadata and
https://bugzilla.redhat.com/show_bug.cgi?id=2263771 is still not fixed
almost a year after being reported.

10 months agomkosi: Update to latest
Daan De Meyer [Fri, 3 Jan 2025 22:25:23 +0000 (23:25 +0100)] 
mkosi: Update to latest

10 months agosd-device: fix validation for devices under /sys/firmware/ in sd_device_new_from_subs... 35863/head
Yu Watanabe [Sat, 4 Jan 2025 18:52:05 +0000 (03:52 +0900)] 
sd-device: fix validation for devices under /sys/firmware/ in sd_device_new_from_subsystem_sysname()

Devices under /sys/firmware/ do not have subsystems. Hence, the
validation in sd_device_new_from_subsystem_sysname() ->
device_new_from_path_join() always failed.

Fixes a bug introduced by cd7c71154cd62d3f50c07ce387edd9c20aebd7bc (v257).
Fixes #35861.

10 months agosd-device: add missing debugging log
Yu Watanabe [Sat, 4 Jan 2025 18:09:29 +0000 (03:09 +0900)] 
sd-device: add missing debugging log

It was unexpectedly dropped by 660087dc9c4a5c610da99e7b6b1772e371eb0a80.

10 months agomkosi: update debian commit reference
Luca Boccassi [Sat, 4 Jan 2025 15:24:57 +0000 (15:24 +0000)] 
mkosi: update debian commit reference

7dc7ee8007 d/rules: drop duplicated config flag
2f417d66d1 Install new files for upstream CI

10 months agoanalyze: fix URLs to DeviceAllow=, IPAddressDeny=
Chris Hofstaedtler [Sat, 4 Jan 2025 13:48:48 +0000 (14:48 +0100)] 
analyze: fix URLs to DeviceAllow=, IPAddressDeny=

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
10 months agofirewall-util: allow to override the table and map names through env var
Yu Watanabe [Fri, 20 Dec 2024 06:28:30 +0000 (15:28 +0900)] 
firewall-util: allow to override the table and map names through env var

Then, use test specific names to make the test not conflict with
networkd.

Hopefully fixes #35526.

10 months agocgroup-util: explain why cg_pidref_get_path() cannot be ported over to pidfd helpers... 35242/head
Mike Yuan [Fri, 29 Nov 2024 16:13:18 +0000 (17:13 +0100)] 
cgroup-util: explain why cg_pidref_get_path() cannot be ported over to pidfd helpers (yet)

See also: https://github.com/systemd/systemd/pull/35242#issuecomment-2506686806

10 months agocgroup-util: introduce generic cg_path_from_cgroupid() helper
Mike Yuan [Tue, 19 Nov 2024 20:13:05 +0000 (21:13 +0100)] 
cgroup-util: introduce generic cg_path_from_cgroupid() helper

Taken from nsresourced/userns-registry.c userns_destroy_cgroup()

10 months agoprocess-util: make pid_is_unwaited() wrapper around pidref version
Mike Yuan [Fri, 29 Nov 2024 15:54:29 +0000 (16:54 +0100)] 
process-util: make pid_is_unwaited() wrapper around pidref version

10 months agoprocess-util: port pidref_get_uid() and pidref_is_my_child() to pidfd helpers
Mike Yuan [Wed, 20 Nov 2024 14:17:30 +0000 (15:17 +0100)] 
process-util: port pidref_get_uid() and pidref_is_my_child() to pidfd helpers