From: Mike Yuan Date: Thu, 13 Nov 2025 20:09:52 +0000 (+0100) Subject: run: refuse --root-directory= in --scope mode X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=045b8d761e7d9c06781c44cc91977046616241ab;p=thirdparty%2Fsystemd.git run: refuse --root-directory= in --scope mode As discussed in #39669, let's reject this for now. --- diff --git a/src/run/run.c b/src/run/run.c index 9c79f99d117..1286ae176ef 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -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 '/'");