]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: refuse --global dot/verify 31919/head
authorMike Yuan <me@yhndnzj.com>
Fri, 22 Mar 2024 16:35:09 +0000 (00:35 +0800)
committerMike Yuan <me@yhndnzj.com>
Sat, 23 Mar 2024 17:28:28 +0000 (01:28 +0800)
I don't quite understand the rationale of making these
verbs work with --global back in the day. But realistically
they interact with/spawn manager, while there's no
--global runtime scope manager. And to verify/inspect user
units it's sufficient to just use --user.

Fixes #31911

src/analyze/analyze.c

index b449e538f31e33b82d4e4763075353c10b8b68bc..cf4894a9d3bef362978b20afb06f195f94512015 100644 (file)
@@ -572,10 +572,9 @@ static int parse_argv(int argc, char *argv[]) {
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "Option --threshold= is only supported for security right now.");
 
-        if (arg_runtime_scope == RUNTIME_SCOPE_GLOBAL &&
-            !STR_IN_SET(argv[optind] ?: "time", "dot", "unit-paths", "verify"))
+        if (arg_runtime_scope == RUNTIME_SCOPE_GLOBAL && !streq_ptr(argv[optind], "unit-paths"))
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "Option --global only makes sense with verbs dot, unit-paths, verify.");
+                                       "Option --global only makes sense with verb unit-paths.");
 
         if (streq_ptr(argv[optind], "cat-config") && arg_runtime_scope == RUNTIME_SCOPE_USER)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),