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:
parent
743814d7a2
commit
741c4c8da9
@ -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);
|
||||
|
@ -2392,9 +2392,11 @@ static int do_security(int argc, char *argv[], void *userdata) {
|
||||
int r;
|
||||
unsigned line, column;
|
||||
|
||||
r = acquire_bus(&bus, NULL);
|
||||
if (r < 0)
|
||||
return bus_log_connect_error(r, arg_transport);
|
||||
if (!arg_offline) {
|
||||
r = acquire_bus(&bus, NULL);
|
||||
if (r < 0)
|
||||
return bus_log_connect_error(r, arg_transport);
|
||||
}
|
||||
|
||||
pager_open(arg_pager_flags);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user