mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 18:24:49 +00:00
![Thomas Haller](/assets/img/avatar_default.png)
Note that the name "NMSecretAgentOld" comes from when libnm was forked from libnm-glib. There was a plan to rework the secret agent API and replace it by a better one. That didn't happen (yet), instead our one and only agent implementation is still lacking. Don't add a new API, instead try to improve the existing one, without breaking existing users. Just get over the fact that the name "NMSecretAgentOld" is ugly. Also note how nm-applet uses NMSecretAgentOld. It subtypes a class AppletAgent. The constructor applet_agent_new() is calling the synchronous g_initable_init() initialization with auto-register enabled. As it was, g_initable_init() would call nm_secret_agent_old_register(), and if the "Register" call failed, initialization failed for good. There are even unit tests that test this behavior. This is bad behavior. It means, when you start nm-applet without NetworkManager running, it will fail to create the AppletAgent instance. It would hence be the responsibility of the applet to recover from this situation (e.g. by retrying after timeout or watching the D-Bus name owner). Of course, nm-applet doesn't do that and won't recover from such a failure. NMSecretAgentOld must try hard not to fail and recover automatically. The user of the API is not interested in implementing the registration, unregistration and retry handling. Instead, it should just work best effort and transparently to the user of the API. Differences: - no longer use gdbus-codegen generate bindings. Use GDBusConnection directly instead. These generated proxies complicate the code by introducing an additional, stateful layer. - properly handle GMainContext and synchronous initialization by using an internal GMainContext. With this NMSecretAgentOld can be used in a multi threaded context with separate GMainContext. This does not mean that the object itself became thread safe, but that the GMainContext gives the means to coordinate multi-threaded access. - there are no more blocking calls except g_initiable_init() which iterates an internal GMainContext until initialization completes. - obtaining the Unix user ID with "GetConnectionUnixUser" to authenticate the server is now done asynchronously and only once per name-owner. - NMSecretAgentOld will now register/export the Agent D-Bus object already during initialization and stay registered as long as the instance is alive. This is because usually registering a D-Bus object would not fail, unless the D-Bus path is already taken. Such an error would mean that another agent is registered for the same GDBusConnection, that likely would be a bug in the caller. Hence, such an issue is truly non-recoverable and should be reported early to the user. There is a change in behavior compared to before, where previously the D-Bus object would only be registered while the instance is enabled. This makes a difference if the user intended to keep the NMSecretAgentOld instance around in an unregistered state. Note that nm_secret_agent_old_destroy() was added to really unregister the D-Bus object. A destroyed instance can no longer be registered. - the API no longer fully exposes the current registration state. The user either enables or disables the agent. Then, in the background NMSecretAgentOld will register, and serve requests as they come. It will also always automatically re-register and it can de-facto no longer fail. That is, there might be a failure to register, or the NetworkManager peer might not be authenticated (non-root) or there might be some other error, or NetworkManager might not be running. But such errors are not exposed to the user. The instance is just not able to provide the secrets in those cases, but it may recover if the problem can be resolved. - In particular, it makes no sense that nm_secret_agent_old_register*() fails, returns an error, or waits until registration is complete. This API is now only to enable/disable the agent. It is idempotent and won't fail (there is a catch, see next point). In particular, nm_secret_agent_old_unregister*() cannot fail anymore. - However, with the previous point there is a problem/race. When you create a NMSecretAgentOld instance and immediately afterwards activate a profile, then you want to be sure that the registration is complete first. Otherwise, NetworkManager might fail the activation because no secret agent registered yet. A partial solution for this is that g_initiable_init()/g_async_initable_init_async() will block until registration is complete (or with or without success). That means, if NetworkManager is running, initializing the NMSecretAgentOld will wait until registration is complete (or failed). However, that does not solve the race if NetworkManager was not running when creating the instance. To solve that race, the user may call nm_secret_agent_old_register_async() and wait for the command to finish before starting activating. While async registration no longer fails (in the sense of leaving the agent permanently disconnected), it will try to ensure that we are successfully registered and ready to serve requests. By using this API correctly, a race can be avoided and the user can know that the instance is now ready to serve request.
180 lines
5.2 KiB
Plaintext
180 lines
5.2 KiB
Plaintext
[encoding: UTF-8]
|
|
# List of source files containing translatable strings.
|
|
# Please keep this file sorted alphabetically.
|
|
clients/cli/agent.c
|
|
clients/cli/common.c
|
|
clients/cli/connections.c
|
|
clients/cli/devices.c
|
|
clients/cli/general.c
|
|
clients/cli/nmcli.c
|
|
clients/cli/polkit-agent.c
|
|
clients/cli/settings.c
|
|
clients/cli/utils.c
|
|
clients/cli/utils.h
|
|
clients/common/nm-client-utils.c
|
|
clients/common/nm-meta-setting-access.c
|
|
clients/common/nm-meta-setting-desc.c
|
|
clients/common/nm-polkit-listener.c
|
|
clients/common/nm-secret-agent-simple.c
|
|
clients/common/nm-vpn-helpers.c
|
|
clients/common/settings-docs.h.in
|
|
clients/nm-online.c
|
|
clients/tui/newt/nmt-newt-utils.c
|
|
clients/tui/nm-editor-utils.c
|
|
clients/tui/nmt-connect-connection-list.c
|
|
clients/tui/nmt-device-entry.c
|
|
clients/tui/nmt-edit-connection-list.c
|
|
clients/tui/nmt-editor-section.c
|
|
clients/tui/nmt-editor.c
|
|
clients/tui/nmt-mtu-entry.c
|
|
clients/tui/nmt-page-bond.c
|
|
clients/tui/nmt-page-bridge-port.c
|
|
clients/tui/nmt-page-bridge.c
|
|
clients/tui/nmt-page-dsl.c
|
|
clients/tui/nmt-page-ethernet.c
|
|
clients/tui/nmt-page-infiniband.c
|
|
clients/tui/nmt-page-ip4.c
|
|
clients/tui/nmt-page-ip6.c
|
|
clients/tui/nmt-page-ip-tunnel.c
|
|
clients/tui/nmt-page-ppp.c
|
|
clients/tui/nmt-page-team-port.c
|
|
clients/tui/nmt-page-team.c
|
|
clients/tui/nmt-page-vlan.c
|
|
clients/tui/nmt-page-wifi.c
|
|
clients/tui/nmt-password-dialog.c
|
|
clients/tui/nmt-password-fields.c
|
|
clients/tui/nmt-route-editor.c
|
|
clients/tui/nmt-route-table.c
|
|
clients/tui/nmt-slave-list.c
|
|
clients/tui/nmt-widget-list.c
|
|
clients/tui/nmtui-connect.c
|
|
clients/tui/nmtui-edit.c
|
|
clients/tui/nmtui-hostname.c
|
|
clients/tui/nmtui.c
|
|
libnm-core/nm-crypto.c
|
|
libnm-core/nm-crypto-gnutls.c
|
|
libnm-core/nm-crypto-nss.c
|
|
libnm-core/nm-connection.c
|
|
libnm-core/nm-dbus-utils.c
|
|
libnm-core/nm-setting-6lowpan.c
|
|
libnm-core/nm-setting-8021x.c
|
|
libnm-core/nm-setting-adsl.c
|
|
libnm-core/nm-setting-bluetooth.c
|
|
libnm-core/nm-setting-bond.c
|
|
libnm-core/nm-setting-bridge-port.c
|
|
libnm-core/nm-setting-bridge.c
|
|
libnm-core/nm-setting-cdma.c
|
|
libnm-core/nm-setting-connection.c
|
|
libnm-core/nm-setting-dcb.c
|
|
libnm-core/nm-setting-ethtool.c
|
|
libnm-core/nm-setting-gsm.c
|
|
libnm-core/nm-setting-infiniband.c
|
|
libnm-core/nm-setting-ip-config.c
|
|
libnm-core/nm-setting-ip-tunnel.c
|
|
libnm-core/nm-setting-ip4-config.c
|
|
libnm-core/nm-setting-ip6-config.c
|
|
libnm-core/nm-setting-macsec.c
|
|
libnm-core/nm-setting-macvlan.c
|
|
libnm-core/nm-setting-olpc-mesh.c
|
|
libnm-core/nm-setting-ovs-bridge.c
|
|
libnm-core/nm-setting-ovs-interface.c
|
|
libnm-core/nm-setting-ovs-patch.c
|
|
libnm-core/nm-setting-ovs-port.c
|
|
libnm-core/nm-setting-ppp.c
|
|
libnm-core/nm-setting-pppoe.c
|
|
libnm-core/nm-setting-proxy.c
|
|
libnm-core/nm-setting-sriov.c
|
|
libnm-core/nm-setting-tc-config.c
|
|
libnm-core/nm-setting-team-port.c
|
|
libnm-core/nm-setting-team.c
|
|
libnm-core/nm-setting-tun.c
|
|
libnm-core/nm-setting-user.c
|
|
libnm-core/nm-setting-vlan.c
|
|
libnm-core/nm-setting-vrf.c
|
|
libnm-core/nm-setting-vpn.c
|
|
libnm-core/nm-setting-vxlan.c
|
|
libnm-core/nm-setting-wifi-p2p.c
|
|
libnm-core/nm-setting-wimax.c
|
|
libnm-core/nm-setting-wired.c
|
|
libnm-core/nm-setting-wireguard.c
|
|
libnm-core/nm-setting-wireless-security.c
|
|
libnm-core/nm-setting-wireless.c
|
|
libnm-core/nm-setting-wpan.c
|
|
libnm-core/nm-setting.c
|
|
libnm-core/nm-team-utils.c
|
|
libnm-core/nm-utils.c
|
|
libnm-core/nm-vpn-editor-plugin.c
|
|
libnm-core/nm-vpn-plugin-info.c
|
|
libnm/nm-client.c
|
|
libnm/nm-device-6lowpan.c
|
|
libnm/nm-device-adsl.c
|
|
libnm/nm-device-bond.c
|
|
libnm/nm-device-bridge.c
|
|
libnm/nm-device-bt.c
|
|
libnm/nm-device-dummy.c
|
|
libnm/nm-device-ethernet.c
|
|
libnm/nm-device-generic.c
|
|
libnm/nm-device-infiniband.c
|
|
libnm/nm-device-ip-tunnel.c
|
|
libnm/nm-device-macvlan.c
|
|
libnm/nm-device-modem.c
|
|
libnm/nm-device-olpc-mesh.c
|
|
libnm/nm-device-ovs-bridge.c
|
|
libnm/nm-device-ovs-interface.c
|
|
libnm/nm-device-ovs-port.c
|
|
libnm/nm-device-team.c
|
|
libnm/nm-device-tun.c
|
|
libnm/nm-device-vlan.c
|
|
libnm/nm-device-vrf.c
|
|
libnm/nm-device-vxlan.c
|
|
libnm/nm-device-wifi-p2p.c
|
|
libnm/nm-device-wifi.c
|
|
libnm/nm-device-wimax.c
|
|
libnm/nm-device-wpan.c
|
|
libnm/nm-device.c
|
|
libnm/nm-object.c
|
|
libnm/nm-remote-connection.c
|
|
libnm/nm-secret-agent-old.c
|
|
libnm/nm-vpn-plugin-old.c
|
|
libnm/nm-vpn-service-plugin.c
|
|
data/org.freedesktop.NetworkManager.policy.in.in
|
|
shared/nm-glib-aux/nm-shared-utils.c
|
|
shared/nm-keyfile/nm-keyfile-utils.c
|
|
shared/nm-keyfile/nm-keyfile.c
|
|
shared/nm-libnm-core-aux/nm-libnm-core-aux.c
|
|
src/NetworkManagerUtils.c
|
|
src/main.c
|
|
src/main-utils.c
|
|
src/dhcp/nm-dhcp-dhclient.c
|
|
src/dhcp/nm-dhcp-dhclient-utils.c
|
|
src/dhcp/nm-dhcp-manager.c
|
|
src/dns/nm-dns-manager.c
|
|
src/devices/adsl/nm-device-adsl.c
|
|
src/devices/bluetooth/nm-bluez-manager.c
|
|
src/devices/bluetooth/nm-device-bt.c
|
|
src/devices/nm-device-6lowpan.c
|
|
src/devices/nm-device-bond.c
|
|
src/devices/nm-device-bridge.c
|
|
src/devices/nm-device-dummy.c
|
|
src/devices/nm-device-ethernet.c
|
|
src/devices/nm-device-ethernet-utils.c
|
|
src/devices/nm-device-infiniband.c
|
|
src/devices/nm-device-ip-tunnel.c
|
|
src/devices/nm-device-macvlan.c
|
|
src/devices/nm-device-tun.c
|
|
src/devices/nm-device-vlan.c
|
|
src/devices/nm-device-vrf.c
|
|
src/devices/nm-device-vxlan.c
|
|
src/devices/nm-device-wpan.c
|
|
src/devices/team/nm-device-team.c
|
|
src/devices/wifi/nm-device-olpc-mesh.c
|
|
src/devices/wifi/nm-device-wifi.c
|
|
src/devices/wifi/nm-wifi-utils.c
|
|
src/devices/wwan/nm-modem-broadband.c
|
|
src/nm-config.c
|
|
src/nm-iface-helper.c
|
|
src/nm-logging.c
|
|
src/nm-manager.c
|
|
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
|
|
src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
|