libnm: drop _nm_dbus_is_connection_private()

Currently, we don't use private sockets. We are always connected
to D-Bus.
This commit is contained in:
Thomas Haller 2019-09-02 10:27:31 +02:00
parent be3712f6fb
commit 0f9157f07b
3 changed files with 3 additions and 24 deletions

View file

@ -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.

View file

@ -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,

View file

@ -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);
priv->session_bus = _nm_dbus_bus_type () == G_BUS_TYPE_SESSION;
if (priv->private_bus == FALSE) {
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 {