analyze: don't open systemd-executor needlessly
authorMike Yuan <me@yhndnzj.com>
Thu, 23 Nov 2023 12:53:50 +0000 (20:53 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 23 Nov 2023 12:58:20 +0000 (20:58 +0800)
Fixes #30162

src/analyze/analyze-condition.c
src/analyze/analyze-security.c
src/analyze/analyze-verify-util.c

index f5d874b..3b290e0 100644 (file)
@@ -92,7 +92,7 @@ static int verify_conditions(char **lines, RuntimeScope scope, const char *unit,
                 assert_se(set_unit_path(var) >= 0);
         }
 
-        r = manager_new(scope, MANAGER_TEST_RUN_MINIMAL, &m);
+        r = manager_new(scope, MANAGER_TEST_RUN_MINIMAL|MANAGER_TEST_DONT_OPEN_EXECUTOR, &m);
         if (r < 0)
                 return log_error_errno(r, "Failed to initialize manager: %m");
 
index 2745100..b119ad7 100644 (file)
@@ -2690,6 +2690,7 @@ static int offline_security_checks(
                 MANAGER_TEST_RUN_MINIMAL |
                 MANAGER_TEST_RUN_ENV_GENERATORS |
                 MANAGER_TEST_RUN_IGNORE_DEPENDENCIES |
+                MANAGER_TEST_DONT_OPEN_EXECUTOR |
                 run_generators * MANAGER_TEST_RUN_GENERATORS;
 
         _cleanup_(manager_freep) Manager *m = NULL;
index 5bba388..622a10f 100644 (file)
@@ -242,6 +242,7 @@ int verify_units(
         const ManagerTestRunFlags flags =
                 MANAGER_TEST_RUN_MINIMAL |
                 MANAGER_TEST_RUN_ENV_GENERATORS |
+                MANAGER_TEST_DONT_OPEN_EXECUTOR |
                 (recursive_errors == RECURSIVE_ERRORS_NO) * MANAGER_TEST_RUN_IGNORE_DEPENDENCIES |
                 run_generators * MANAGER_TEST_RUN_GENERATORS;