[Pkg-telepathy-commits] [SCM] telepathy-gabble packaging branch, debian-experimental, updated. debian/0.8.11-2-26-g6eeb660
Simon McVittie
smcv at debian.org
Wed Feb 24 12:47:20 UTC 2010
The following commit has been merged in the debian-experimental branch:
commit 48fee1574fa82160ab5d168baf91ac77c9ce7b0c
Author: Simon McVittie <smcv at debian.org>
Date: Tue Feb 23 18:40:06 2010 +0000
Add three patches from upstream telepathy-gabble-0.8 branch to disable Linux-specific credentials-passing code on non-Linux, fixing compilation on kFreeBSD
diff --git a/debian/changelog b/debian/changelog
index b665119..90efd85 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+telepathy-gabble (0.8.11-2) UNRELEASED; urgency=low
+
+ * Add three patches from upstream telepathy-gabble-0.8 branch
+ to disable Linux-specific credentials-passing code on non-Linux,
+ fixing compilation on kFreeBSD
+
+ -- Simon McVittie <smcv at debian.org> Tue, 23 Feb 2010 18:17:13 +0000
+
telepathy-gabble (0.8.11-1) unstable; urgency=low
* New upstream release.
diff --git a/debian/patches/0001-Stream-tube-tests-don-t-assume-that-stream-tubes-alw.patch b/debian/patches/0001-Stream-tube-tests-don-t-assume-that-stream-tubes-alw.patch
new file mode 100644
index 0000000..64e7197
--- /dev/null
+++ b/debian/patches/0001-Stream-tube-tests-don-t-assume-that-stream-tubes-alw.patch
@@ -0,0 +1,99 @@
+From a528e43754ec40444026c27fe634fa22d28663a8 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <simon.mcvittie at collabora.co.uk>
+Date: Thu, 10 Sep 2009 12:11:42 +0100
+Subject: [PATCH 1/3] Stream tube tests: don't assume that stream tubes always support credentials-passing
+
+That assumption will now fail on non-Linux.
+---
+ tests/twisted/constants.py | 1 +
+ tests/twisted/tubes/accept-muc-stream-tube.py | 4 ++++
+ tests/twisted/tubes/test-get-available-tubes.py | 12 ++++++++++--
+ tests/twisted/tubes/tubetestutil.py | 5 ++++-
+ 4 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
+index b73d26c..cc0a637 100644
+--- a/tests/twisted/constants.py
++++ b/tests/twisted/constants.py
+@@ -80,6 +80,7 @@ STREAM_TUBE_SERVICE = CHANNEL_TYPE_STREAM_TUBE + '.Service'
+ DBUS_TUBE_SERVICE_NAME = CHANNEL_TYPE_DBUS_TUBE + '.ServiceName'
+ DBUS_TUBE_DBUS_NAMES = CHANNEL_TYPE_DBUS_TUBE + '.DBusNames'
+ DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS = CHANNEL_TYPE_DBUS_TUBE + '.SupportedAccessControls'
++STREAM_TUBE_SUPPORTED_SOCKET_TYPES = CHANNEL_TYPE_STREAM_TUBE + '.SupportedSocketTypes'
+
+ TUBE_CHANNEL_STATE_LOCAL_PENDING = 0
+ TUBE_CHANNEL_STATE_REMOTE_PENDING = 1
+diff --git a/tests/twisted/tubes/accept-muc-stream-tube.py b/tests/twisted/tubes/accept-muc-stream-tube.py
+index 45807f2..5f726c4 100644
+--- a/tests/twisted/tubes/accept-muc-stream-tube.py
++++ b/tests/twisted/tubes/accept-muc-stream-tube.py
+@@ -1,5 +1,7 @@
+ """Test IBB stream tube support in the context of a MUC."""
+
++import sys
++
+ import dbus
+
+ from servicetest import call_async, EventPattern, EventProtocolClientFactory, unwrap, assertEquals
+@@ -168,6 +170,8 @@ def test(q, bus, conn, stream, bytestream_cls,
+ assert props[cs.TARGET_ID] == 'chat at conf.localhost'
+ assert props[cs.STREAM_TUBE_SERVICE] == 'echo'
+ assert props[cs.TUBE_PARAMETERS] == {'s': 'hello', 'ay': 'hello', 'u': 123, 'i': -123}
++ assert access_control in \
++ props[cs.STREAM_TUBE_SUPPORTED_SOCKET_TYPES][address_type]
+
+ tube_chan = bus.get_object(conn.bus_name, path)
+ tube_props = tube_chan.GetAll(cs.CHANNEL_IFACE_TUBE, dbus_interface=cs.PROPERTIES_IFACE,
+diff --git a/tests/twisted/tubes/test-get-available-tubes.py b/tests/twisted/tubes/test-get-available-tubes.py
+index 547cafe..af13da4 100644
+--- a/tests/twisted/tubes/test-get-available-tubes.py
++++ b/tests/twisted/tubes/test-get-available-tubes.py
+@@ -1,5 +1,7 @@
+ """Test GetAvailableStreamTubeTypes and GetAvailableTubeTypes"""
+
++import sys
++
+ import dbus
+
+ from servicetest import call_async, EventPattern, tp_name_prefix,\
+@@ -75,8 +77,14 @@ def test(q, bus, conn, stream):
+ # test GetAvailableStreamTubeTypes (old API)
+ stream_tubes_types = tubes_iface_muc.GetAvailableStreamTubeTypes()
+ assertLength(3, stream_tubes_types)
+- assertEquals([cs.SOCKET_ACCESS_CONTROL_LOCALHOST, cs.SOCKET_ACCESS_CONTROL_CREDENTIALS],
+- stream_tubes_types[cs.SOCKET_ADDRESS_TYPE_UNIX])
++ assert cs.SOCKET_ACCESS_CONTROL_LOCALHOST in \
++ stream_tubes_types[cs.SOCKET_ADDRESS_TYPE_UNIX], \
++ stream_tubes_types[cs.SOCKET_ADDRESS_TYPE_UNIX]
++ # so far we only guarantee to support credentials-passing on Linux
++ if sys.platform == 'linux2':
++ assert cs.SOCKET_ACCESS_CONTROL_CREDENTIALS in \
++ stream_tubes_types[cs.SOCKET_ADDRESS_TYPE_UNIX], \
++ stream_tubes_types[cs.SOCKET_ADDRESS_TYPE_UNIX]
+ assertEquals([cs.SOCKET_ACCESS_CONTROL_LOCALHOST, cs.SOCKET_ACCESS_CONTROL_PORT],
+ stream_tubes_types[cs.SOCKET_ADDRESS_TYPE_IPV4])
+ assertEquals([cs.SOCKET_ACCESS_CONTROL_LOCALHOST, cs.SOCKET_ACCESS_CONTROL_PORT],
+diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
+index 123bf29..9a325be 100644
+--- a/tests/twisted/tubes/tubetestutil.py
++++ b/tests/twisted/tubes/tubetestutil.py
+@@ -5,6 +5,7 @@ Helper functions for writing tubes tests
+ import errno
+ import os
+ import socket
++import sys
+
+ import dbus
+
+@@ -360,8 +361,10 @@ def exec_tube_test(test, *args):
+ def exec_stream_tube_test(test):
+ exec_tube_test(test, cs.SOCKET_ADDRESS_TYPE_UNIX, cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "")
+ exec_tube_test(test, cs.SOCKET_ADDRESS_TYPE_IPV4, cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "")
+- exec_tube_test(test, cs.SOCKET_ADDRESS_TYPE_UNIX, cs.SOCKET_ACCESS_CONTROL_CREDENTIALS, dbus.Byte(77))
+ exec_tube_test(test, cs.SOCKET_ADDRESS_TYPE_IPV4, cs.SOCKET_ACCESS_CONTROL_PORT, ('127.0.0.1', dbus.UInt16(8631)))
++ # we only guarantee to support credentials-passing on Linux
++ if sys.platform == 'linux2':
++ exec_tube_test(test, cs.SOCKET_ADDRESS_TYPE_UNIX, cs.SOCKET_ACCESS_CONTROL_CREDENTIALS, dbus.Byte(77))
+
+ def exec_dbus_tube_test(test):
+ exec_tube_test(test, cs.SOCKET_ACCESS_CONTROL_CREDENTIALS)
diff --git a/debian/patches/0002-fd.o-22968-GibberUnixTransport-make-credential-passi.patch b/debian/patches/0002-fd.o-22968-GibberUnixTransport-make-credential-passi.patch
new file mode 100644
index 0000000..f65abc5
--- /dev/null
+++ b/debian/patches/0002-fd.o-22968-GibberUnixTransport-make-credential-passi.patch
@@ -0,0 +1,87 @@
+From a943882f3d92dfea1147d6618351dc5ec44136f1 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <simon.mcvittie at collabora.co.uk>
+Date: Mon, 27 Jul 2009 22:00:51 +0100
+Subject: [PATCH 2/3] fd.o#22968: GibberUnixTransport: make credential-passing support optional and detectable
+
+Our implementation only works for Linux so far, so we need to be able to
+avoid advertising credential-passing on e.g. Darwin.
+---
+ lib/gibber/gibber-unix-transport.c | 47 ++++++++++++++++++++++++++++++++++++
+ lib/gibber/gibber-unix-transport.h | 2 +
+ 2 files changed, 49 insertions(+), 0 deletions(-)
+
+diff --git a/lib/gibber/gibber-unix-transport.c b/lib/gibber/gibber-unix-transport.c
+index 244f468..7c800d8 100644
+--- a/lib/gibber/gibber-unix-transport.c
++++ b/lib/gibber/gibber-unix-transport.c
+@@ -194,6 +194,17 @@ gibber_unix_transport_new_from_fd (int fd)
+ return transport;
+ }
+
++/* Patches that reimplement these functions for non-Linux would be welcome
++ * (please file a bug) */
++
++#if defined(__linux__)
++
++gboolean
++gibber_unix_transport_supports_credentials (void)
++{
++ return TRUE;
++}
++
+ gboolean
+ gibber_unix_transport_send_credentials (GibberUnixTransport *transport,
+ const guint8 *data,
+@@ -356,3 +367,39 @@ gibber_unix_transport_recv_credentials (GibberUnixTransport *self,
+ priv->recv_creds_data = user_data;
+ return TRUE;
+ }
++
++#else /* OSs where we have no implementation */
++
++gboolean
++gibber_unix_transport_supports_credentials (void)
++{
++ return FALSE;
++}
++
++gboolean
++gibber_unix_transport_recv_credentials (GibberUnixTransport *self,
++ GibberUnixTransportRecvCredentialsCb callback,
++ gpointer user_data)
++{
++ DEBUG ("stub implementation, failing");
++ return FALSE;
++}
++
++gboolean
++gibber_unix_transport_send_credentials (GibberUnixTransport *transport,
++ const guint8 *data,
++ gsize size)
++{
++ DEBUG ("stub implementation, failing");
++ return FALSE;
++}
++
++static GibberFdIOResult
++gibber_unix_transport_read (GibberFdTransport *transport,
++ GIOChannel *channel,
++ GError **error)
++{
++ return gibber_fd_transport_read (transport, channel, error);
++}
++
++#endif
+diff --git a/lib/gibber/gibber-unix-transport.h b/lib/gibber/gibber-unix-transport.h
+index b89a0dd..3aad8d4 100644
+--- a/lib/gibber/gibber-unix-transport.h
++++ b/lib/gibber/gibber-unix-transport.h
+@@ -79,6 +79,8 @@ GType gibber_unix_transport_get_type (void);
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_UNIX_TRANSPORT, \
+ GibberUnixTransportClass))
+
++gboolean gibber_unix_transport_supports_credentials (void);
++
+ GibberUnixTransport * gibber_unix_transport_new (void);
+
+ GibberUnixTransport * gibber_unix_transport_new_from_fd (int fd);
diff --git a/debian/patches/0003-Don-t-advertise-support-for-credentials-passing-on-p.patch b/debian/patches/0003-Don-t-advertise-support-for-credentials-passing-on-p.patch
new file mode 100644
index 0000000..b673028
--- /dev/null
+++ b/debian/patches/0003-Don-t-advertise-support-for-credentials-passing-on-p.patch
@@ -0,0 +1,31 @@
+From 80519bf4d08250e6cdaa0deba518d5a9ffe4c184 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <simon.mcvittie at collabora.co.uk>
+Date: Mon, 27 Jul 2009 21:21:15 +0100
+Subject: [PATCH 3/3] Don't advertise support for credentials-passing on platforms where it won't work
+
+---
+ src/tube-stream.c | 11 +++++++++--
+ 1 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/tube-stream.c b/src/tube-stream.c
+index e71fe82..e39532f 100644
+--- a/src/tube-stream.c
++++ b/src/tube-stream.c
+@@ -2358,8 +2358,15 @@ gabble_tube_stream_get_supported_socket_types (void)
+ 1);
+ access_control = TP_SOCKET_ACCESS_CONTROL_LOCALHOST;
+ g_array_append_val (unix_tab, access_control);
+- access_control = TP_SOCKET_ACCESS_CONTROL_CREDENTIALS;
+- g_array_append_val (unix_tab, access_control);
++
++ /* Credentials-passing is non-portable, so only advertise it on platforms
++ * where we have an implementation (like Linux) */
++ if (gibber_unix_transport_supports_credentials ())
++ {
++ access_control = TP_SOCKET_ACCESS_CONTROL_CREDENTIALS;
++ g_array_append_val (unix_tab, access_control);
++ }
++
+ g_hash_table_insert (ret, GUINT_TO_POINTER (TP_SOCKET_ADDRESS_TYPE_UNIX),
+ unix_tab);
+
--
telepathy-gabble packaging
More information about the Pkg-telepathy-commits
mailing list