From: Yu Watanabe Date: Tue, 11 Nov 2025 23:59:06 +0000 (+0900) Subject: systemctl: fix edit and cat verbs with --global flag (#39606) X-Git-Tag: v259-rc1~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19db9a99e68f221bb40467255aea8514e82ba65d;p=thirdparty%2Fsystemd.git systemctl: fix edit and cat verbs with --global flag (#39606) The --global flag has been broken since commit d77d42ed3ae95ee035dce4707777b077d1a9bf8b, which added a blanket restriction on acquiring D-Bus connections when arg_runtime_scope is RUNTIME_SCOPE_GLOBAL. This was done to prevent crashes, but inadvertently broke legitimate use cases like 'systemctl edit --global' and 'systemctl cat --global'. The issue is that verb_edit() and verb_cat() were unconditionally calling acquire_bus(), which triggers the restriction and fails with "--global is not supported for this operation." This commit fixes the issue by making bus acquisition conditional, following the same pattern used in verb_enable(): - Only acquire the bus when install_client_side() returns NO (i.e., for system and user scopes) - For client-side operations (--global, --root, etc.), skip bus acquisition and use mangle_names() instead of expand_unit_names() - Update find_paths_to_edit() and verb_cat() to handle NULL bus by forcing client-side path lookups - Skip bus-dependent checks (unit_is_masked, need_daemon_reload) when bus is NULL This allows both 'systemctl edit --global' and 'systemctl cat --global' to work correctly by performing all operations client-side without requiring a connection to the system or user manager. Fixes #31272 --- 19db9a99e68f221bb40467255aea8514e82ba65d