1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-18 06:03:42 +03:00

analyze: do not connect to DBUS with --offline

Co-authored-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
This commit is contained in:
Luca Boccassi 2021-12-22 18:31:15 +00:00 committed by Yu Watanabe
parent 743814d7a2
commit 741c4c8da9
2 changed files with 6 additions and 4 deletions

View File

@ -2770,7 +2770,7 @@ int analyze_security(sd_bus *bus,
_cleanup_(table_unrefp) Table *overview_table = NULL;
int ret = 0, r;
assert(bus);
assert(!!bus != offline);
if (offline)
return offline_security_checks(units, policy, scope, check_man, run_generators, threshold, root, profile, pager_flags, json_format_flags);

View File

@ -2392,9 +2392,11 @@ static int do_security(int argc, char *argv[], void *userdata) {
int r;
unsigned line, column;
if (!arg_offline) {
r = acquire_bus(&bus, NULL);
if (r < 0)
return bus_log_connect_error(r, arg_transport);
}
pager_open(arg_pager_flags);