From 0f9157f07b93e51dd6d71d99817b668494996944 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 2 Sep 2019 10:27:31 +0200 Subject: libnm: drop _nm_dbus_is_connection_private() Currently, we don't use private sockets. We are always connected to D-Bus. --- libnm/nm-dbus-helpers.c | 6 ------ libnm/nm-dbus-helpers.h | 2 -- libnm/nm-secret-agent-old.c | 19 +++---------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c index 834deebd6f..978d5e2a82 100644 --- a/libnm/nm-dbus-helpers.c +++ b/libnm/nm-dbus-helpers.c @@ -26,12 +26,6 @@ _nm_dbus_bus_type (void) return nm_bus; } -gboolean -_nm_dbus_is_connection_private (GDBusConnection *connection) -{ - return g_dbus_connection_get_unique_name (connection) == NULL; -} - /* D-Bus has an upper limit on number of Match rules and it's rather easy * to hit as the proxy likes to add one for each object. Let's remove the Match * rule the proxy added and ensure a less granular rule is present instead. diff --git a/libnm/nm-dbus-helpers.h b/libnm/nm-dbus-helpers.h index afc0493308..42e67e1c65 100644 --- a/libnm/nm-dbus-helpers.h +++ b/libnm/nm-dbus-helpers.h @@ -14,8 +14,6 @@ GBusType _nm_dbus_bus_type (void); -gboolean _nm_dbus_is_connection_private (GDBusConnection *connection); - void _nm_dbus_proxy_replace_match (GDBusProxy *proxy); void _nm_dbus_bind_properties (gpointer object, diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c index b77bd443cc..3c08987a97 100644 --- a/libnm/nm-secret-agent-old.c +++ b/libnm/nm-secret-agent-old.c @@ -47,7 +47,6 @@ typedef struct { bool registered:1; bool registering:1; - bool private_bus:1; bool session_bus:1; bool auto_register:1; bool suppress_auto:1; @@ -141,12 +140,6 @@ verify_sender (NMSecretAgentOld *self, g_return_val_if_fail (context != NULL, FALSE); - /* Private bus connection is always to NetworkManager, which is always - * UID 0. - */ - if (priv->private_bus) - return TRUE; - /* Verify that the sender is the same as NetworkManager's bus name owner. */ owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (priv->manager_proxy)); @@ -451,8 +444,6 @@ check_nm_running (NMSecretAgentOld *self, GError **error) NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self); gs_free char *owner = NULL; - if (priv->private_bus) - return TRUE; owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (priv->manager_proxy)); if (owner) return TRUE; @@ -981,14 +972,10 @@ init_common (NMSecretAgentOld *self) { NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self); - priv->private_bus = _nm_dbus_is_connection_private (priv->bus); - - if (priv->private_bus == FALSE) { - priv->session_bus = _nm_dbus_bus_type () == G_BUS_TYPE_SESSION; + priv->session_bus = _nm_dbus_bus_type () == G_BUS_TYPE_SESSION; - g_signal_connect (priv->manager_proxy, "notify::g-name-owner", - G_CALLBACK (name_owner_changed), self); - } + g_signal_connect (priv->manager_proxy, "notify::g-name-owner", + G_CALLBACK (name_owner_changed), self); } typedef struct { -- cgit v1.2.1