there are six places that call ListConnections and then GetSettings on each profile:
core/connection_settings.rs (find_saved_connection_by_name)
core/connection.rs:428
core/vpn.rs:462, :755, :820, :910
all of them need to skip profiles that fail GetSettings (Settings.PermissionDenied for profiles restricted to other users via connection.permissions). five did, one didn't, and that one was the cause of pop-os/cosmic-settings#2184 (#545).
the skip-on-error behaviour should live in one helper in util/utils.rs (e.g. for_each_readable_profile) that hands each call site the parsed settings map, so a seventh scan can't reintroduce the bug by hand-rolling the loop.
no behaviour change; refactor only. a unit test isn't practical here since there's no d-bus mock and the integration harness runs as root, which bypasses profile acls.
there are six places that call
ListConnectionsand thenGetSettingson each profile:core/connection_settings.rs(find_saved_connection_by_name)core/connection.rs:428core/vpn.rs:462,:755,:820,:910all of them need to skip profiles that fail
GetSettings(Settings.PermissionDeniedfor profiles restricted to other users viaconnection.permissions). five did, one didn't, and that one was the cause of pop-os/cosmic-settings#2184 (#545).the skip-on-error behaviour should live in one helper in
util/utils.rs(e.g.for_each_readable_profile) that hands each call site the parsed settings map, so a seventh scan can't reintroduce the bug by hand-rolling the loop.no behaviour change; refactor only. a unit test isn't practical here since there's no d-bus mock and the integration harness runs as root, which bypasses profile acls.