mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-31 01:47:15 +03:00
analyze: do not connect to DBUS with --offline
Co-authored-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
This commit is contained in:
parent
743814d7a2
commit
741c4c8da9
@ -2770,7 +2770,7 @@ int analyze_security(sd_bus *bus,
|
|||||||
_cleanup_(table_unrefp) Table *overview_table = NULL;
|
_cleanup_(table_unrefp) Table *overview_table = NULL;
|
||||||
int ret = 0, r;
|
int ret = 0, r;
|
||||||
|
|
||||||
assert(bus);
|
assert(!!bus != offline);
|
||||||
|
|
||||||
if (offline)
|
if (offline)
|
||||||
return offline_security_checks(units, policy, scope, check_man, run_generators, threshold, root, profile, pager_flags, json_format_flags);
|
return offline_security_checks(units, policy, scope, check_man, run_generators, threshold, root, profile, pager_flags, json_format_flags);
|
||||||
|
@ -2392,9 +2392,11 @@ static int do_security(int argc, char *argv[], void *userdata) {
|
|||||||
int r;
|
int r;
|
||||||
unsigned line, column;
|
unsigned line, column;
|
||||||
|
|
||||||
r = acquire_bus(&bus, NULL);
|
if (!arg_offline) {
|
||||||
if (r < 0)
|
r = acquire_bus(&bus, NULL);
|
||||||
return bus_log_connect_error(r, arg_transport);
|
if (r < 0)
|
||||||
|
return bus_log_connect_error(r, arg_transport);
|
||||||
|
}
|
||||||
|
|
||||||
pager_open(arg_pager_flags);
|
pager_open(arg_pager_flags);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user