diff --git a/src/basic/efivars.c b/src/basic/efivars.c index f54c3d22e9..1d874a9172 100644 --- a/src/basic/efivars.c +++ b/src/basic/efivars.c @@ -68,6 +68,7 @@ int efi_get_variable( if (fstat(fd, &st) < 0) return log_debug_errno(errno, "fstat(\"%s\") failed: %m", p); + r = stat_verify_regular(&st); if (r < 0) return log_debug_errno(r, "EFI variable '%s' is not a regular file, refusing: %m", p); diff --git a/src/run/run.c b/src/run/run.c index 9c79f99d11..1286ae176e 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 '/'"); diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c index 441d8c655a..52c87559a4 100644 --- a/src/stdio-bridge/stdio-bridge.c +++ b/src/stdio-bridge/stdio-bridge.c @@ -114,8 +114,6 @@ static int bus_set_address( const char *bus_path, RuntimeScope runtime_scope) { - int r; - assert(bus); switch (transport) { @@ -143,8 +141,6 @@ static int bus_set_address( default: assert_not_reached(); } - - return r; } static int run(int argc, char *argv[]) {