summaryrefslogtreecommitdiff
path: root/src/tube-dbus.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-05-29 17:05:58 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-06-26 15:21:32 +0100
commit0c87a3419ce4492bb717f0b3fb5fcad255f00700 (patch)
tree0e52a2798ebd1b2c05089fe08541a31fa4cce7a7 /src/tube-dbus.c
parent61de06a19a1ff3cacd52fc30b7930240a60abc05 (diff)
downloadtelepathy-salut-0c87a3419ce4492bb717f0b3fb5fcad255f00700.tar.gz
tube-dbus: actually implement the LocalHost access control
Diffstat (limited to 'src/tube-dbus.c')
-rw-r--r--src/tube-dbus.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index 9862b447..bab0e96e 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -322,6 +322,14 @@ out:
return DBUS_HANDLER_RESULT_HANDLED;
}
+static dbus_bool_t
+allow_all_connections (DBusConnection *conn,
+ unsigned long uid,
+ void *data)
+{
+ return TRUE;
+}
+
static void
new_connection_cb (DBusServer *server,
DBusConnection *conn,
@@ -344,6 +352,14 @@ new_connection_cb (DBusServer *server,
dbus_connection_add_filter (conn, filter_cb, tube, NULL);
priv->dbus_conn = conn;
+ if (priv->access_control == TP_SOCKET_ACCESS_CONTROL_LOCALHOST)
+ {
+ /* By default libdbus use Credentials access control. If user wants
+ * to use the Localhost access control, we need to bypass this check. */
+ dbus_connection_set_unix_user_function (conn, allow_all_connections,
+ NULL, NULL);
+ }
+
/* We may have received messages to deliver before the local connection is
* established. Theses messages are kept in the dbus_msg_queue list and are
* delivered as soon as we get the connection. */