]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: accept "|" ExecStart= prefix to spawn target user's shell
authorMike Yuan <me@yhndnzj.com>
Wed, 9 Apr 2025 13:22:11 +0000 (15:22 +0200)
committerMike Yuan <me@yhndnzj.com>
Wed, 7 May 2025 16:32:19 +0000 (18:32 +0200)
commit5b8bcbcf0032ed8b4b0161be842012b33d327b5b
tree4dbbee86043da0be581466015d526c77cf241f1d
parent398b3e44722e5a3a7a78ce16aa6ece3dc80e72a6
core: accept "|" ExecStart= prefix to spawn target user's shell

When switching to another user it's oftentimes desirable to also spawn
the target user's shell. sudo supports this via -i flag, run0 currently
doesn't. We don't want to proactively query NSS ourselves, since
that would fall short when operating remotely. Let's instead teach
the service manager to spawn the command using the user's default shell.

I opted for "|" instead of "." in the end because the latter seems
a bit obscure. But happy to change it to something else if a better option
comes up.
TODO
man/systemd.service.xml
src/core/dbus-execute.c
src/core/exec-invoke.c
src/core/load-fragment.c
src/shared/bus-unit-util.c
src/shared/exec-util.c
src/shared/exec-util.h