]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: refuse --root-directory= in --scope mode
authorMike Yuan <me@yhndnzj.com>
Thu, 13 Nov 2025 20:09:52 +0000 (21:09 +0100)
committerMike Yuan <me@yhndnzj.com>
Thu, 13 Nov 2025 20:17:32 +0000 (21:17 +0100)
As discussed in #39669, let's reject this for now.

src/run/run.c

index 9c79f99d1171c4b353bb33f4e2b32d1f388eca9b..1286ae176ef7253876d60f8529d71eb05fa7b579 100644 (file)
@@ -866,6 +866,10 @@ static int parse_argv(int argc, char *argv[]) {
                                                "--wait may not be combined with --scope.");
         }
 
+        if (arg_scope && arg_root_directory)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "--root-directory= is not supported in --scope mode.");
+
         if (same_dir && arg_root_directory && !path_equal(arg_root_directory, "/"))
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "--same-dir cannot be used with a root directory other than '/'");