]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: don't bother with chowning StateDirectory= and friends in user mode
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Jun 2023 09:19:47 +0000 (11:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 Jun 2023 20:08:35 +0000 (22:08 +0200)
src/core/execute.c

index 652ff444221ba55ab48f8e68a93baea55a8ef698..d850a68022156935d2c602896fc8783bbfeaafb4 100644 (file)
@@ -2738,6 +2738,11 @@ static int setup_exec_directory(
                 if (r < 0)
                         goto fail;
 
+                /* Skip the rest (which deals with ownership) in user mode, since ownership changes are not
+                 * available to user code anyway */
+                if (params->runtime_scope != RUNTIME_SCOPE_SYSTEM)
+                        continue;
+
                 /* Then, change the ownership of the whole tree, if necessary. When dynamic users are used we
                  * drop the suid/sgid bits, since we really don't want SUID/SGID files for dynamic UID/GID
                  * assignments to exist. */