]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/bus-unit-util: fix PrivateTmp=/PrivateUsers=/ProtectControlGroups= and Ex...
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Jul 2025 07:22:16 +0000 (09:22 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 6 Jul 2025 16:17:45 +0000 (18:17 +0200)
commit41288f2daf2c72d0a8614571cfc3de91ecdee372
treef082fe5bf168bbe63ba072a86aca53dfe69c4b93
parentfb98c75e0ea1c38dd8f47833e6dbd766f5d950ec
shared/bus-unit-util: fix PrivateTmp=/PrivateUsers=/ProtectControlGroups= and Ex variants

For some fields, we perform careful parsing and verification on the sender
side. For other fields, we accept any string or strv. I think that actually
this is fine: we should optimize for the correct case, i.e. the user runs a
command that is valid. The server must perform parsing in all cases, so doing
the verification on the sender side doesn't add value. When doing parsing
locally, in case of invalid or unsupported input, we would generate the error
message locally, so we would avoid the D-Bus call, but the message itself is
not better and from the user's point of view, the result is the same. And by
doing the parsing only on the server side, we deal better with the case where
the sender has an older version of the software. By not doing verification, we
implicitly "support" new values. And when the sender has a newer version that
supports additional fields, that does not help as long as the server uses an
older version. So in case of version mismatches, parsing on the server side is
as good or better.

Resolves https://github.com/systemd/systemd/issues/37174.
src/shared/bus-unit-util.c
src/test/test-bus-unit-util.c