ChangeLog | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Xtrans.c | 132 ++++++++++++++++++++++++++++++++++- Xtrans.h | 8 ++ Xtransint.h | 5 - Xtranssock.c | 53 +++++++------- Xtransutil.c | 14 --- configure.ac | 2 debian/changelog | 6 + xtrans.m4 | 13 +-- xtrans.pc.in | 2 10 files changed, 386 insertions(+), 53 deletions(-)
New commits: commit f3005f4977aa5cc979522f31f01668e3ccacbb17 Author: Julien Cristau <jcris...@debian.org> Date: Sun Apr 13 19:07:45 2014 +0200 Upload to unstable diff --git a/debian/changelog b/debian/changelog index 26e1db6..8da2fd4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -xtrans (1.3.4-1) UNRELEASED; urgency=medium +xtrans (1.3.4-1) unstable; urgency=medium * New upstream release. - -- Julien Cristau <jcris...@debian.org> Sun, 13 Apr 2014 18:56:51 +0200 + -- Julien Cristau <jcris...@debian.org> Sun, 13 Apr 2014 18:58:37 +0200 xtrans (1.3.2-1) unstable; urgency=low commit 7fc7729d2bc1f77abc7a6b9906625e73bb935b63 Author: Julien Cristau <jcris...@debian.org> Date: Sun Apr 13 18:56:59 2014 +0200 Bump changelogs for 1.3.4 diff --git a/ChangeLog b/ChangeLog index f9402da..99098f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,69 @@ +commit a57a7f62242e1ea972b81414741729bf3dbae0a4 +Author: Hans de Goede <hdego...@redhat.com> +Date: Mon Mar 31 12:37:43 2014 +0200 + + xtrans 1.3.4 + + Signed-off-by: Hans de Goede <hdego...@redhat.com> + +commit 1cd9cbe9b404e6c3e73dc0239d11547a5e2c02c4 +Author: Mark Kettenis <kette...@openbsd.org> +Date: Sat Mar 29 23:51:49 2014 +0100 + + Increase UNIX socket buffer size + + Some systems provide a really small default buffer size for UNIX sockets. + Bump it up to 64k if necessary such that large transfers (such as + XGetImage() on a 8-megapixel image) don't take tens of seconds. + + Signed-off-by: Hans de Goede <hdego...@redhat.com> + +commit 68f60238c4224f954ff6556ae778c72e420175f0 +Author: Thomas Klausner <w...@netbsd.org> +Date: Wed Mar 26 13:21:49 2014 +0100 + + Add missing headers for free() and strlen(). + + Reviewed-by: Mark Kettenis <kette...@openbsd.org> + Signed-off-by: Thomas Klausner <w...@netbsd.org> + +commit 34463baacb3cafc096e0e0859bc10d6868cb2299 +Author: Thomas Klausner <w...@netbsd.org> +Date: Wed Mar 26 13:21:23 2014 +0100 + + Cast ctype(3) function arguments to unsigned char. + + Fixes warnings on at least NetBSD. + + Reviewed-by: Mark Kettenis <kette...@openbsd.org> + Signed-off-by: Thomas Klausner <w...@netbsd.org> + +commit f20a9bb2ea25408ce9f1166b3b6e48759960fe86 +Author: Hans de Goede <hdego...@redhat.com> +Date: Mon Mar 3 08:42:45 2014 +0100 + + configure: Also add -D_DEFAULT_SOURCE to .pc cflags to shut up glibc warnings + + The latest glibc considers _BSD_SOURCE deprecated, leading to the following + warning being issued for pretty much every C-file in the xserver: + + In file included from /usr/include/stdint.h:25:0, + from /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdint.h:9, + from ../include/misc.h:81, + from miexpose.c:82: + /usr/include/features.h:145:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + ^ + + I've discussed this with the glibc developers and the prefered way of fixing + this is by also defining _DEFAULT_SOURCE which is the new way of stating + _BSD_SOURCE / _SVID_SOURCE . + + Signed-off-by: Hans de Goede <hdego...@redhat.com> + Reviewed-by: Mark Kettenis <kette...@openbsd.org> + Tested-by: Kristian Høgsberg <k...@bitplanet.net> + Reviewed-by: Kristian Høgsberg <k...@bitplanet.net> + commit 3f0de269abe59353acbd7a5587d68ce0da91db67 Author: Hans de Goede <hdego...@redhat.com> Date: Thu Jan 23 11:47:25 2014 +0100 diff --git a/debian/changelog b/debian/changelog index 70e1ed3..26e1db6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -xtrans (1.3.3-1) UNRELEASED; urgency=medium +xtrans (1.3.4-1) UNRELEASED; urgency=medium * New upstream release. - -- Julien Cristau <jcris...@debian.org> Wed, 26 Mar 2014 23:26:23 +0100 + -- Julien Cristau <jcris...@debian.org> Sun, 13 Apr 2014 18:56:51 +0200 xtrans (1.3.2-1) unstable; urgency=low commit 38652dd47d578204c771f63fc4592fd5949a067b Author: Julien Cristau <jcris...@debian.org> Date: Sun Apr 13 18:55:49 2014 +0200 Bump changelogs diff --git a/ChangeLog b/ChangeLog index 67db0de..f9402da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,141 @@ +commit 3f0de269abe59353acbd7a5587d68ce0da91db67 +Author: Hans de Goede <hdego...@redhat.com> +Date: Thu Jan 23 11:47:25 2014 +0100 + + xtrans 1.3.3 + + Signed-off-by: Hans de Goede <hdego...@redhat.com> + +commit 8f3bbed42c308f9c90293f23b7eaceff006aa232 +Author: Jon TURNEY <jon.tur...@dronecode.org.uk> +Date: Wed Jul 10 16:29:12 2013 +0100 + + Add TransIsListening() + + libxtrans provides TransNoListen() to set the 'don't listen' flag for a + particular transport, but there is no interface to query the state of that flag + + This is a bit of a problem for the XWin server, as it wants to start some helper + clients (for clipboard integration and integrated window management), so needs + to know what transports the server is listening on to construct appropriate + display names for those clients. + + Add TransIsListening() to discover if TransNoListen() has been called for a + particular protocol or not + + HdG: + -Invert the final check so that TransIsListening returns True when + TRANS_NOLISTEN is not set, as one would expect of it. + -Make the protocol argument a const char * as similar functions do + -Fix "warning: too many arguments for format" warning + + Signed-off-by: Jon TURNEY <jon.tur...@dronecode.org.uk> + Signed-off-by: Hans de Goede <hdego...@redhat.com> + +commit e1e6121a1638d43d9929589b4723da2b38cb6b44 +Author: Łukasz Stelmach <l.stelm...@samsung.com> +Date: Mon Nov 25 11:11:54 2013 +0100 + + Enable systemd socket activation + + Receive file descriptors of open sockets from systemd instead of + creating them. + + Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> + Cc: Kyungmin Park <kyungmin.p...@samsung.com> + Cc: MyungJoo Ham <myungjoo....@samsung.com> + Cc: Piort Bereza <p.ber...@samsung.com> + Cc: Karol Lewandowski <k.lewando...@samsung.com> + Cc: Lennart Poettering <lenn...@poettering.net> + Cc: Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl> + Cc: Peter Hutterer <peter.hutte...@who-t.net> + Cc: walter harms <wha...@bfs.de> + Signed-off-by: Hans de Goede <hdego...@redhat.com> + Acked-by: Peter Hutterer <peter.hutte...@who-t.net> + +commit b895d45e225dd3d1bf9d598774d3ae4f29fcbc25 +Author: Łukasz Stelmach <l.stelm...@samsung.com> +Date: Thu Nov 28 12:57:21 2013 +0100 + + Define TRANS_RECEIVED flag for transports + + The flag is to be used to mark transports related to sockets + received from systemd. + + Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> + Signed-off-by: Hans de Goede <hdego...@redhat.com> + Acked-by: Peter Hutterer <peter.hutte...@who-t.net> + +commit 2c0a7840a28ae696e80e73157856d7a049fdf6c7 +Author: Gaetan Nadon <mems...@videotron.ca> +Date: Sun Dec 15 19:49:59 2013 -0500 + + xtrans.m4: remove AC_TYPE_SIGNAL and Imake SIGNALRETURNSINT + + Assume signal handlers return void, as C89 requires + + Drops use of autoconf's obsolete AC_TYPE_SIGNAL and Imake's even more + obsolete SIGNALRETURNSINT. + + None of the modules including xtrans.m4 uses RETSIGTYPE from autoconf. + + Signed-off-by: Gaetan Nadon <mems...@videotron.ca> + +commit 87547e43189301e3dd42feb9d7ff32a75d0e727f +Author: Gaetan Nadon <mems...@videotron.ca> +Date: Sun Dec 15 16:11:00 2013 -0500 + + xtrans.m4: replace deprecated AC_HAVE_LIBRARY with AC_CHECK_LIB + + The #define HAVE_LIBWS2_32 is still done and the lib ws2_32 is + prepended to LIBS if found. + + Signed-off-by: Gaetan Nadon <mems...@videotron.ca> + +commit 88433eb1abe887000d34315c2f55aa42fcddfdee +Author: Gaetan Nadon <mems...@videotron.ca> +Date: Sun Dec 15 15:36:48 2013 -0500 + + xtrans.m4: fix warning by replacing obsolete AC_HELP_STRING + + with AS_HELP_STRING + + Signed-off-by: Gaetan Nadon <mems...@videotron.ca> + +commit 9487701904b71985549f60c9d8bc5df48682b55a +Author: Mark Kettenis <kette...@openbsd.org> +Date: Thu Nov 21 11:55:17 2013 +0100 + + Don't restrict FD passing to Linux & Solaris + + Signed-off-by: Mark Kettenis <kette...@openbsd.org> + Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com> + Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> + +commit 8b2c8aabe27bcaa4de6432b53c4a1296010ea823 +Author: Mark Kettenis <kette...@openbsd.org> +Date: Mon Nov 11 23:18:01 2013 +0100 + + Fix alignment issues in FD passing code + + A char array on the stack is not guaranteed to have more than byte + alignment. This means that casting it to a 'struct cmsghdr' and + accessing its members may result in unaligned access. This will + generate SIGBUS on strict alignment architectures like OpenBSD/sparc64. + The solution is to use a union to force proper alignment. + + Signed-off-by: Mark Kettenis <kette...@openbsd.org> + Reviewed-by: Matthieu Herrb <matth...@herrb.eu> + +commit 81662d2018a35a161a5e9707563ee7f503f8d3e0 +Author: Mark Kettenis <kette...@openbsd.org> +Date: Mon Nov 11 23:16:15 2013 +0100 + + Remove unused static inlines + + Signed-off-by: Mark Kettenis <kette...@openbsd.org> + Reviewed-by: Matthieu Herrb <matth...@herrb.eu> + commit 0153d1670e4a1883e1bb6dd971435d6268eac5ba Author: Alan Coopersmith <alan.coopersm...@oracle.com> Date: Thu Nov 7 20:16:53 2013 -0800 diff --git a/debian/changelog b/debian/changelog index 8fcc213..70e1ed3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xtrans (1.3.3-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Julien Cristau <jcris...@debian.org> Wed, 26 Mar 2014 23:26:23 +0100 + xtrans (1.3.2-1) unstable; urgency=low [ Michele Cane ] commit a57a7f62242e1ea972b81414741729bf3dbae0a4 Author: Hans de Goede <hdego...@redhat.com> Date: Mon Mar 31 12:37:43 2014 +0200 xtrans 1.3.4 Signed-off-by: Hans de Goede <hdego...@redhat.com> diff --git a/configure.ac b/configure.ac index 6898c6d..bb8a34c 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xtrans], [1.3.3], +AC_INIT([xtrans], [1.3.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xtrans]) AC_CONFIG_SRCDIR([Makefile.am]) commit 1cd9cbe9b404e6c3e73dc0239d11547a5e2c02c4 Author: Mark Kettenis <kette...@openbsd.org> Date: Sat Mar 29 23:51:49 2014 +0100 Increase UNIX socket buffer size Some systems provide a really small default buffer size for UNIX sockets. Bump it up to 64k if necessary such that large transfers (such as XGetImage() on a 8-megapixel image) don't take tens of seconds. Signed-off-by: Hans de Goede <hdego...@redhat.com> diff --git a/Xtranssock.c b/Xtranssock.c index fdf1dd7..6cde146 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -445,6 +445,27 @@ TRANS(SocketOpen) (int i, int type) } #endif + /* + * Some systems provide a really small default buffer size for + * UNIX sockets. Bump it up a bit such that large transfers don't + * proceed at glacial speed. + */ +#ifdef SO_SNDBUF + if (Sockettrans2devtab[i].family == AF_UNIX) + { + SOCKLEN_T len = sizeof (int); + int val; + + if (getsockopt (ciptr->fd, SOL_SOCKET, SO_SNDBUF, + (char *) &val, &len) == 0 && val < 64 * 1024) + { + val = 64 * 1024; + setsockopt (ciptr->fd, SOL_SOCKET, SO_SNDBUF, + (char *) &val, sizeof (int)); + } + } +#endif + return ciptr; } commit 68f60238c4224f954ff6556ae778c72e420175f0 Author: Thomas Klausner <w...@netbsd.org> Date: Wed Mar 26 13:21:49 2014 +0100 Add missing headers for free() and strlen(). Reviewed-by: Mark Kettenis <kette...@openbsd.org> Signed-off-by: Thomas Klausner <w...@netbsd.org> diff --git a/Xtrans.c b/Xtrans.c index 11f6161..ae8ffad 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -48,8 +48,9 @@ from The Open Group. */ #include <ctype.h> -#ifdef HAVE_SYSTEMD_DAEMON +#include <stdlib.h> #include <string.h> +#ifdef HAVE_SYSTEMD_DAEMON #include <systemd/sd-daemon.h> #endif commit 34463baacb3cafc096e0e0859bc10d6868cb2299 Author: Thomas Klausner <w...@netbsd.org> Date: Wed Mar 26 13:21:23 2014 +0100 Cast ctype(3) function arguments to unsigned char. Fixes warnings on at least NetBSD. Reviewed-by: Mark Kettenis <kette...@openbsd.org> Signed-off-by: Thomas Klausner <w...@netbsd.org> diff --git a/Xtrans.c b/Xtrans.c index d9e32d0..11f6161 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -166,8 +166,8 @@ TRANS(SelectTransport) (const char *protocol) protobuf[PROTOBUFSIZE-1] = '\0'; for (i = 0; i < PROTOBUFSIZE && protobuf[i] != '\0'; i++) - if (isupper (protobuf[i])) - protobuf[i] = tolower (protobuf[i]); + if (isupper ((unsigned char)protobuf[i])) + protobuf[i] = tolower ((unsigned char)protobuf[i]); /* Look at all of the configured protocols */ commit f20a9bb2ea25408ce9f1166b3b6e48759960fe86 Author: Hans de Goede <hdego...@redhat.com> Date: Mon Mar 3 08:42:45 2014 +0100 configure: Also add -D_DEFAULT_SOURCE to .pc cflags to shut up glibc warnings The latest glibc considers _BSD_SOURCE deprecated, leading to the following warning being issued for pretty much every C-file in the xserver: In file included from /usr/include/stdint.h:25:0, from /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdint.h:9, from ../include/misc.h:81, from miexpose.c:82: /usr/include/features.h:145:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" ^ I've discussed this with the glibc developers and the prefered way of fixing this is by also defining _DEFAULT_SOURCE which is the new way of stating _BSD_SOURCE / _SVID_SOURCE . Signed-off-by: Hans de Goede <hdego...@redhat.com> Reviewed-by: Mark Kettenis <kette...@openbsd.org> Tested-by: Kristian Høgsberg <k...@bitplanet.net> Reviewed-by: Kristian Høgsberg <k...@bitplanet.net> diff --git a/xtrans.pc.in b/xtrans.pc.in index 90d19b1..b8d135b 100644 --- a/xtrans.pc.in +++ b/xtrans.pc.in @@ -6,4 +6,4 @@ includedir=@includedir@ Name: XTrans Description: Abstract network code for X Version: @PACKAGE_VERSION@ -Cflags: -I${includedir} -D_BSD_SOURCE @fchown_define@ @sticky_bit_define@ +Cflags: -I${includedir} -D_DEFAULT_SOURCE -D_BSD_SOURCE @fchown_define@ @sticky_bit_define@ commit 3f0de269abe59353acbd7a5587d68ce0da91db67 Author: Hans de Goede <hdego...@redhat.com> Date: Thu Jan 23 11:47:25 2014 +0100 xtrans 1.3.3 Signed-off-by: Hans de Goede <hdego...@redhat.com> diff --git a/configure.ac b/configure.ac index 998fb06..6898c6d 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xtrans], [1.3.2], +AC_INIT([xtrans], [1.3.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xtrans]) AC_CONFIG_SRCDIR([Makefile.am]) commit 8f3bbed42c308f9c90293f23b7eaceff006aa232 Author: Jon TURNEY <jon.tur...@dronecode.org.uk> Date: Wed Jul 10 16:29:12 2013 +0100 Add TransIsListening() libxtrans provides TransNoListen() to set the 'don't listen' flag for a particular transport, but there is no interface to query the state of that flag This is a bit of a problem for the XWin server, as it wants to start some helper clients (for clipboard integration and integrated window management), so needs to know what transports the server is listening on to construct appropriate display names for those clients. Add TransIsListening() to discover if TransNoListen() has been called for a particular protocol or not HdG: -Invert the final check so that TransIsListening returns True when TRANS_NOLISTEN is not set, as one would expect of it. -Make the protocol argument a const char * as similar functions do -Fix "warning: too many arguments for format" warning Signed-off-by: Jon TURNEY <jon.tur...@dronecode.org.uk> Signed-off-by: Hans de Goede <hdego...@redhat.com> diff --git a/Xtrans.c b/Xtrans.c index 225f4c8..d9e32d0 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -802,6 +802,22 @@ TRANS(NoListen) (const char * protocol) } int +TRANS(IsListening) (const char * protocol) +{ + Xtransport *trans; + + if ((trans = TRANS(SelectTransport)(protocol)) == NULL) + { + prmsg (1,"TransIsListening: unable to find transport: %s\n", + protocol); + + return 0; + } + + return !(trans->flags & TRANS_NOLISTEN); +} + +int TRANS(ResetListener) (XtransConnInfo ciptr) { diff --git a/Xtrans.h b/Xtrans.h index 1754720..5807b67 100644 --- a/Xtrans.h +++ b/Xtrans.h @@ -311,6 +311,10 @@ int TRANS(NoListen) ( const char* /* protocol*/ ); +int TRANS(IsListening) ( + const char* /* protocol*/ +); + int TRANS(ResetListener)( XtransConnInfo /* ciptr */ ); commit e1e6121a1638d43d9929589b4723da2b38cb6b44 Author: Łukasz Stelmach <l.stelm...@samsung.com> Date: Mon Nov 25 11:11:54 2013 +0100 Enable systemd socket activation Receive file descriptors of open sockets from systemd instead of creating them. Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> Cc: Kyungmin Park <kyungmin.p...@samsung.com> Cc: MyungJoo Ham <myungjoo....@samsung.com> Cc: Piort Bereza <p.ber...@samsung.com> Cc: Karol Lewandowski <k.lewando...@samsung.com> Cc: Lennart Poettering <lenn...@poettering.net> Cc: Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl> Cc: Peter Hutterer <peter.hutte...@who-t.net> Cc: walter harms <wha...@bfs.de> Signed-off-by: Hans de Goede <hdego...@redhat.com> Acked-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/Xtrans.c b/Xtrans.c index e478422..225f4c8 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -48,6 +48,10 @@ from The Open Group. */ #include <ctype.h> +#ifdef HAVE_SYSTEMD_DAEMON +#include <string.h> +#include <systemd/sd-daemon.h> +#endif /* * The transport table contains a definition for every transport (protocol) @@ -1051,6 +1055,79 @@ complete_network_count (void) } +static int +receive_listening_fds(char* port, XtransConnInfo* temp_ciptrs, int* count_ret) + +{ +#ifdef HAVE_SYSTEMD_DAEMON + XtransConnInfo ciptr; + int i, systemd_listen_fds; + + systemd_listen_fds = sd_listen_fds(1); + if (systemd_listen_fds < 0) + { + prmsg (1, "receive_listening_fds: sd_listen_fds error: %s\n", + strerror(-systemd_listen_fds)); + return -1; + } + + for (i = 0; i < systemd_listen_fds && *count_ret < NUMTRANS; i++) + { + struct sockaddr_storage a; + int ti; + const char* tn; + socklen_t al; + + al = sizeof(a); + if (getsockname(i + SD_LISTEN_FDS_START, (struct sockaddr*)&a, &al) < 0) { + prmsg (1, "receive_listening_fds: getsockname error: %s\n", + strerror(errno)); + return -1; + } + + switch (a.ss_family) + { + case AF_UNIX: + ti = TRANS_SOCKET_UNIX_INDEX; + if (*((struct sockaddr_un*)&a)->sun_path == '\0' && + al > sizeof(sa_family_t)) + tn = "local"; + else + tn = "unix"; + break; + case AF_INET: + ti = TRANS_SOCKET_INET_INDEX; + tn = "inet"; + break; +#if defined(IPv6) && defined(AF_INET6) + case AF_INET6: + ti = TRANS_SOCKET_INET6_INDEX; + tn = "inet6"; + break; +#endif /* IPv6 */ + default: + prmsg (1, "receive_listening_fds:" + "Got unknown socket address family\n"); + return -1; + } + + ciptr = TRANS(ReopenCOTSServer)(ti, i + SD_LISTEN_FDS_START, port); + if (!ciptr) + { + prmsg (1, "receive_listening_fds:" + "Got NULL while trying to reopen socket received from systemd.\n"); + return -1; + } + + prmsg (5, "receive_listening_fds: received listener for %s, %d\n", + tn, ciptr->fd); + temp_ciptrs[(*count_ret)++] = ciptr; + TRANS(Received)(tn); + } +#endif /* HAVE_SYSTEMD_DAEMON */ + return 0; +} + #ifdef XQUARTZ_EXPORTS_LAUNCHD_FD extern int xquartz_launchd_fd; #endif @@ -1083,12 +1160,16 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, } #endif + if (receive_listening_fds(port, temp_ciptrs, count_ret) < 0) + return -1; + for (i = 0; i < NUMTRANS; i++) { Xtransport *trans = Xtransports[i].transport; unsigned int flags = 0; - if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN) + if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN || + trans->flags&TRANS_RECEIVED) continue; snprintf(buffer, sizeof(buffer), "%s/:%s", commit b895d45e225dd3d1bf9d598774d3ae4f29fcbc25 Author: Łukasz Stelmach <l.stelm...@samsung.com> Date: Thu Nov 28 12:57:21 2013 +0100 Define TRANS_RECEIVED flag for transports The flag is to be used to mark transports related to sockets received from systemd. Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> Signed-off-by: Hans de Goede <hdego...@redhat.com> Acked-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/Xtrans.c b/Xtrans.c index 735d7b8..e478422 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -744,6 +744,34 @@ TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags) } int +TRANS(Received) (const char * protocol) + +{ + Xtransport *trans; + int i = 0, ret = 0; + + prmsg (5, "Received(%s)\n", protocol); + + if ((trans = TRANS(SelectTransport)(protocol)) == NULL) + { + prmsg (1,"Received: unable to find transport: %s\n", + protocol); + + return -1; + } + if (trans->flags & TRANS_ALIAS) { + if (trans->nolisten) + while (trans->nolisten[i]) { + ret |= TRANS(Received)(trans->nolisten[i]); + i++; + } + } + + trans->flags |= TRANS_RECEIVED; + return ret; +} + +int TRANS(NoListen) (const char * protocol) { diff --git a/Xtrans.h b/Xtrans.h index 69accd7..1754720 100644 --- a/Xtrans.h +++ b/Xtrans.h @@ -303,6 +303,10 @@ int TRANS(CreateListener)( unsigned int /* flags */ ); +int TRANS(Received) ( + const char* /* protocol*/ +); + int TRANS(NoListen) ( const char* /* protocol*/ ); diff --git a/Xtransint.h b/Xtransint.h index ec5a772..4c670b8 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -331,6 +331,7 @@ typedef struct _Xtransport_table { #define TRANS_NOUNLINK (1<<4) /* Don't unlink transport endpoints */ #define TRANS_ABSTRACT (1<<5) /* Use abstract sockets if available */ #define TRANS_NOXAUTH (1<<6) /* Don't verify authentication (because it's secure some other way at the OS layer) */ +#define TRANS_RECEIVED (1<<7) /* The fd for this has already been opened by someone else. */ /* Flags to preserve when setting others */ #define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT) commit 2c0a7840a28ae696e80e73157856d7a049fdf6c7 Author: Gaetan Nadon <mems...@videotron.ca> Date: Sun Dec 15 19:49:59 2013 -0500 xtrans.m4: remove AC_TYPE_SIGNAL and Imake SIGNALRETURNSINT Assume signal handlers return void, as C89 requires Drops use of autoconf's obsolete AC_TYPE_SIGNAL and Imake's even more obsolete SIGNALRETURNSINT. None of the modules including xtrans.m4 uses RETSIGTYPE from autoconf. Signed-off-by: Gaetan Nadon <mems...@videotron.ca> diff --git a/Xtransutil.c b/Xtransutil.c index a6928bb..63f0fc3 100644 --- a/Xtransutil.c +++ b/Xtransutil.c @@ -306,24 +306,12 @@ static jmp_buf env; #ifdef SIGALRM static volatile int nameserver_timedout = 0; -static -#ifdef RETSIGTYPE /* set by autoconf AC_TYPE_SIGNAL */ -RETSIGTYPE -#else /* Imake */ -#ifdef SIGNALRETURNSINT -int -#else -void -#endif -#endif +static void nameserver_lost(int sig _X_UNUSED) { nameserver_timedout = 1; longjmp (env, -1); /* NOTREACHED */ -#ifdef SIGNALRETURNSINT - return -1; /* for picky compilers */ -#endif } #endif /* SIGALARM */ diff --git a/xtrans.m4 b/xtrans.m4 index f578b3f..fe128b4 100644 --- a/xtrans.m4 +++ b/xtrans.m4 @@ -100,7 +100,6 @@ AC_INCLUDES_DEFAULT # that use Xtrans functions AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_TYPE_SIGNAL]) [case $host_os in mingw*) unixdef="no" ;; *) unixdef="yes" ;; commit 87547e43189301e3dd42feb9d7ff32a75d0e727f Author: Gaetan Nadon <mems...@videotron.ca> Date: Sun Dec 15 16:11:00 2013 -0500 xtrans.m4: replace deprecated AC_HAVE_LIBRARY with AC_CHECK_LIB The #define HAVE_LIBWS2_32 is still done and the lib ws2_32 is prepended to LIBS if found. Signed-off-by: Gaetan Nadon <mems...@videotron.ca> diff --git a/xtrans.m4 b/xtrans.m4 index 352e654..f578b3f 100644 --- a/xtrans.m4 +++ b/xtrans.m4 @@ -29,7 +29,7 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ AC_SEARCH_LIBS(socket, [socket]) AC_SEARCH_LIBS(gethostbyname, [nsl]) if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then - AC_HAVE_LIBRARY([ws2_32]) + AC_CHECK_LIB([ws2_32],[main]) fi # Needs to come after above checks for libsocket & libnsl for SVR4 systems commit 88433eb1abe887000d34315c2f55aa42fcddfdee Author: Gaetan Nadon <mems...@videotron.ca> Date: Sun Dec 15 15:36:48 2013 -0500 xtrans.m4: fix warning by replacing obsolete AC_HELP_STRING with AS_HELP_STRING Signed-off-by: Gaetan Nadon <mems...@videotron.ca> diff --git a/xtrans.m4 b/xtrans.m4 index d84442e..352e654 100644 --- a/xtrans.m4 +++ b/xtrans.m4 @@ -34,7 +34,7 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ # Needs to come after above checks for libsocket & libnsl for SVR4 systems AC_ARG_ENABLE(ipv6, - AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), + AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), [IPV6CONN=$enableval], [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])]) AC_MSG_CHECKING([if IPv6 support should be built]) @@ -106,7 +106,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ *) unixdef="yes" ;; esac] AC_ARG_ENABLE(unix-transport, - AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), + AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), [UNIXCONN=$enableval], [UNIXCONN=$unixdef]) AC_MSG_CHECKING([if Xtrans should support UNIX socket connections]) if test "$UNIXCONN" = "yes"; then @@ -114,7 +114,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ fi AC_MSG_RESULT($UNIXCONN) AC_ARG_ENABLE(tcp-transport, - AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), + AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), [TCPCONN=$enableval], [TCPCONN=yes]) AC_MSG_CHECKING([if Xtrans should support TCP socket connections]) AC_MSG_RESULT($TCPCONN) @@ -127,7 +127,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ *) localdef="no" ;; esac] AC_ARG_ENABLE(local-transport, - AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), + AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), [LOCALCONN=$enableval], [LOCALCONN=$localdef]) AC_MSG_CHECKING([if Xtrans should support os-specific local connections]) AC_MSG_RESULT($LOCALCONN) @@ -145,7 +145,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_DEFUN([XTRANS_SECURE_RPC_FLAGS], [AC_REQUIRE([XTRANS_TCP_FLAGS]) AC_ARG_ENABLE(secure-rpc, - AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), + AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), [SECURE_RPC=$enableval], [SECURE_RPC="try"]) if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then commit 9487701904b71985549f60c9d8bc5df48682b55a Author: Mark Kettenis <kette...@openbsd.org> Date: Thu Nov 21 11:55:17 2013 +0100 Don't restrict FD passing to Linux & Solaris Signed-off-by: Mark Kettenis <kette...@openbsd.org> Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> diff --git a/Xtransint.h b/Xtransint.h index 1f32f0c..ec5a772 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -72,10 +72,6 @@ from The Open Group. # define XTRANSDEBUG 1 #endif -#if XTRANS_SEND_FDS && !(defined(linux) || defined(__sun)) -#error "FD passing support only on Linux & Solaris" -#endif - #ifdef WIN32 # define _WILLWINSOCK_ #endif commit 8b2c8aabe27bcaa4de6432b53c4a1296010ea823 Author: Mark Kettenis <kette...@openbsd.org> Date: Mon Nov 11 23:18:01 2013 +0100 Fix alignment issues in FD passing code A char array on the stack is not guaranteed to have more than byte alignment. This means that casting it to a 'struct cmsghdr' and accessing its members may result in unaligned access. This will generate SIGBUS on strict alignment architectures like OpenBSD/sparc64. The solution is to use a union to force proper alignment. Signed-off-by: Mark Kettenis <kette...@openbsd.org> Reviewed-by: Matthieu Herrb <matth...@herrb.eu> diff --git a/Xtranssock.c b/Xtranssock.c index 0370119..fdf1dd7 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -2197,9 +2197,9 @@ TRANS(SocketSendFdInvalid)(XtransConnInfo ciptr, int fd, int do_close) #define MAX_FDS 128 -struct fd_pass { +union fd_pass { struct cmsghdr cmsghdr; - int fd[MAX_FDS]; + char buf[CMSG_SPACE(MAX_FDS * sizeof(int))]; }; #endif /* XTRANS_SEND_FDS */ @@ -2225,13 +2225,13 @@ TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size) .iov_base = buf, .iov_len = size }; - char cmsgbuf[CMSG_SPACE(sizeof(int) * MAX_FDS)]; + union fd_pass cmsgbuf; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_iov = &iov, .msg_iovlen = 1, - .msg_control = cmsgbuf, + .msg_control = cmsgbuf.buf, .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int)) }; @@ -2266,13 +2266,13 @@ TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size) #if XTRANS_SEND_FDS { - char cmsgbuf[CMSG_SPACE(sizeof(int) * MAX_FDS)]; + union fd_pass cmsgbuf; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_iov = buf, .msg_iovlen = size, - .msg_control = cmsgbuf, + .msg_control = cmsgbuf.buf, .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int)) }; @@ -2308,7 +2308,7 @@ TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size) #if XTRANS_SEND_FDS if (ciptr->send_fds) { - char cmsgbuf[CMSG_SPACE(sizeof(int) * MAX_FDS)]; + union fd_pass cmsgbuf; int nfd = nFd(&ciptr->send_fds); struct _XtransConnFd *cf = ciptr->send_fds; -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/e1wznu6-0006sh...@moszumanska.debian.org