diff options
author | Thomas Haller <thaller@redhat.com> | 2019-08-03 18:56:54 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-08-08 10:07:55 +0200 |
commit | 0dbb870f8204cd2ee232321b6c9949cad4128e6f (patch) | |
tree | cd24874553fdc27c5ed312fb85b5cf96ef8f9388 | |
parent | 8a347dbd555bf20a8c49f79ec6b702e900bde203 (diff) | |
download | NetworkManager-0dbb870f8204cd2ee232321b6c9949cad4128e6f.tar.gz |
dbus-manager: drop unused private-socket functions from "nm-dbus-manager.c"
These functions are now unused. Drop them.
Also, if we ever reintroduce private unix socket, we sure won't use
GDBusProxy. Good riddance.
-rw-r--r-- | src/nm-dbus-manager.c | 80 | ||||
-rw-r--r-- | src/nm-dbus-manager.h | 10 |
2 files changed, 0 insertions, 90 deletions
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c index a14ea12018..138d24bcac 100644 --- a/src/nm-dbus-manager.c +++ b/src/nm-dbus-manager.c @@ -772,86 +772,6 @@ nm_dbus_manager_get_unix_user (NMDBusManager *self, /*****************************************************************************/ -const char * -nm_dbus_manager_connection_get_private_name (NMDBusManager *self, - GDBusConnection *connection) -{ - NMDBusManagerPrivate *priv; - PrivateServer *s; - const char *owner; - - g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), FALSE); - g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE); - - if (g_dbus_connection_get_unique_name (connection)) { - /* Shortcut. The connection is not a private connection. */ - return NULL; - } - - priv = NM_DBUS_MANAGER_GET_PRIVATE (self); - c_list_for_each_entry (s, &priv->private_servers_lst_head, private_servers_lst) { - if ((owner = private_server_get_connection_owner (s, connection))) - return owner; - } - g_return_val_if_reached (NULL); -} - -/** - * nm_dbus_manager_new_proxy: - * @self: the #NMDBusManager - * @connection: the GDBusConnection for which this connection should be created - * @proxy_type: the type of #GDBusProxy to create - * @name: any name on the message bus - * @path: name of the object instance to call methods on - * @iface: name of the interface to call methods on - * - * Creates a new proxy (of type @proxy_type) for a name on a given bus. Since - * the process which called the D-Bus method could be coming from a private - * connection or the system bus connection, different proxies must be created - * for each case. This function abstracts that. - * - * Returns: a #GDBusProxy capable of calling D-Bus methods of the calling process - */ -GDBusProxy * -nm_dbus_manager_new_proxy (NMDBusManager *self, - GDBusConnection *connection, - GType proxy_type, - const char *name, - const char *path, - const char *iface) -{ - const char *owner; - GDBusProxy *proxy; - GError *error = NULL; - - g_return_val_if_fail (g_type_is_a (proxy_type, G_TYPE_DBUS_PROXY), NULL); - g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); - - /* Might be a private connection, for which @name is fake */ - owner = nm_dbus_manager_connection_get_private_name (self, connection); - if (owner) { - g_return_val_if_fail (!g_strcmp0 (owner, name), NULL); - name = NULL; - } - - proxy = g_initable_new (proxy_type, NULL, &error, - "g-connection", connection, - "g-flags", (G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | - G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS), - "g-name", name, - "g-object-path", path, - "g-interface-name", iface, - NULL); - if (!proxy) { - _LOGW ("could not create proxy for %s on connection %s: %s", - iface, name, error->message); - g_error_free (error); - } - return proxy; -} - -/*****************************************************************************/ - static const NMDBusInterfaceInfoExtended * _reg_data_get_interface_info (RegistrationData *reg_data) { diff --git a/src/nm-dbus-manager.h b/src/nm-dbus-manager.h index c4a9956307..077a8d6b70 100644 --- a/src/nm-dbus-manager.h +++ b/src/nm-dbus-manager.h @@ -87,9 +87,6 @@ gboolean nm_dbus_manager_ensure_uid (NMDBusManager *self, GQuark error_domain, int error_code); -const char *nm_dbus_manager_connection_get_private_name (NMDBusManager *self, - GDBusConnection *connection); - gboolean nm_dbus_manager_get_unix_user (NMDBusManager *self, const char *sender, gulong *out_uid); @@ -105,11 +102,4 @@ void nm_dbus_manager_private_server_register (NMDBusManager *self, const char *path, const char *tag); -GDBusProxy *nm_dbus_manager_new_proxy (NMDBusManager *self, - GDBusConnection *connection, - GType proxy_type, - const char *name, - const char *path, - const char *iface); - #endif /* __NM_DBUS_MANAGER_H__ */ |