diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-03-22 17:35:09 +0100 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-03-23 18:28:28 +0100 |
commit | ac97053618387ca1fa0d378cde7957aab8f0476c (patch) | |
tree | 6a0815ea4bb1a69deefe444fa884590800c05794 /src | |
parent | analyze-dot: also show BindsTo= in --require (diff) | |
download | systemd-ac97053618387ca1fa0d378cde7957aab8f0476c.tar.xz systemd-ac97053618387ca1fa0d378cde7957aab8f0476c.zip |
analyze: refuse --global dot/verify
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
Diffstat (limited to 'src')
-rw-r--r-- | src/analyze/analyze.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index b449e538f3..cf4894a9d3 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -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), |