]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: we don't support the combination of --root and --user, hence refuse it
authorLennart Poettering <lennart@poettering.net>
Tue, 28 Jul 2020 15:52:48 +0000 (17:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 5 Aug 2020 18:26:25 +0000 (20:26 +0200)
--user only really works with certain env vars such as XDG_RUNTIME_DIR
set, but that's just weird if --root= is used.

src/tmpfiles/tmpfiles.c

index 3c800d5fa8e3db79e2e11c4c2e00711a1162a3f0..6dad483d8c5ff44547eecbce1dea2bf8b2c818b9 100644 (file)
@@ -3065,6 +3065,10 @@ static int parse_argv(int argc, char *argv[]) {
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "When --replace= is given, some configuration items must be specified");
 
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "When --replace= is given, some configuration items must be specified");
 
+        if (arg_root && arg_user)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "Combination of --user and --root= is not supported.");
+
         return 1;
 }
 
         return 1;
 }