Commit Graph

242 Commits

Author SHA1 Message Date
1bee760ceb 编译配置 2024-12-25 00:09:19 +08:00
826d8b6ef6 patch xtrans.diff 2024-12-21 22:07:04 +08:00
Keith Packard
7cbad9fe2e xtrans 1.3.5
Signed-off-by: Keith Packard <keithp@keithp.com>
xtrans-1.3.5
2014-09-20 10:02:05 -07:00
Keith Packard
fb7f198c88 Add TRANS(Listen) function to re-enable specific listen sockets
This will allow a server to disable listeners by default and then
let later configuration re-enable them. In particular, this lets the X
server disable inet and unix listen sockets by default while still
providing a '-listen' command line option to re-enable them later on.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-13 10:58:20 -07:00
Alan Coopersmith
17491de45c Add const qualifiers to TRANS(OpenC{L,O}TS{Server,Client}) args
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-24 09:32:26 -07:00
Alan Coopersmith
305d20f2ee Add const qualifiers to TRANS(MakeAll*ServerListeners) port args
Required also changing receive_listening_fds to specify port as const,
which we can do now that TRANS(ReopenCOTSServer) takes it as const.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-24 09:28:11 -07:00
Alan Coopersmith
ba70d48951 Add const qualifiers to TRANS(Connect) args
Also required constifying UnixHostReallyLocal, since SocketUNIXConnect
passes the host arg through to it.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-24 09:27:04 -07:00
Alan Coopersmith
63b65a2070 Add const qualifiers to TRANS(CreateListener) port args
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-23 12:47:32 -07:00
Alan Coopersmith
fd90a4e003 Add const qualifiers to TRANS(Reopen...) port args
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-23 12:47:32 -07:00
Alan Coopersmith
a56ec9d720 Add const qualifiers to TRANS(Open...) address args
Required also adding const to static TRANS(ParseAddress) function which
they pass the address arg to for parsing.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-23 12:47:32 -07:00
Alan Coopersmith
30b3fd74a2 Update docs to note that TransName is now const char *
Missed when the code was updated in commit eb9a8904fb.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-23 12:47:32 -07:00
Hans de Goede
a57a7f6224 xtrans 1.3.4
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
xtrans-1.3.4
2014-03-31 12:37:53 +02:00
Mark Kettenis
1cd9cbe9b4 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 <hdegoede@redhat.com>
2014-03-31 11:45:04 +02:00
Thomas Klausner
68f60238c4 Add missing headers for free() and strlen().
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-03-26 13:21:49 +01:00
Thomas Klausner
34463baacb Cast ctype(3) function arguments to unsigned char.
Fixes warnings on at least NetBSD.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-03-26 13:21:23 +01:00
Hans de Goede
f20a9bb2ea 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 <hdegoede@redhat.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-26 12:05:58 +01:00
Hans de Goede
3f0de269ab xtrans 1.3.3
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
xtrans-1.3.3
2014-01-27 12:10:24 +01:00
Jon TURNEY
8f3bbed42c 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.turney@dronecode.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-01-27 12:10:08 +01:00
Łukasz Stelmach
e1e6121a16 Enable systemd socket activation
Receive file descriptors of open sockets from systemd instead of
creating them.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Piort Bereza <p.bereza@samsung.com>
Cc: Karol Lewandowski <k.lewandowsk@samsung.com>
Cc: Lennart Poettering <lennart@poettering.net>
Cc: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: walter harms <wharms@bfs.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-13 11:52:02 +01:00
Łukasz Stelmach
b895d45e22 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.stelmach@samsung.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-13 11:52:02 +01:00
Gaetan Nadon
2c0a7840a2 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 <memsize@videotron.ca>
2013-12-16 09:41:52 -05:00
Gaetan Nadon
87547e4318 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 <memsize@videotron.ca>
2013-12-16 09:39:31 -05:00
Gaetan Nadon
88433eb1ab xtrans.m4: fix warning by replacing obsolete AC_HELP_STRING
with AS_HELP_STRING

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-16 09:39:31 -05:00
Mark Kettenis
9487701904 Don't restrict FD passing to Linux & Solaris
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-14 09:40:46 -08:00
Mark Kettenis
8b2c8aabe2 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 <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2013-11-21 11:35:07 +01:00
Mark Kettenis
81662d2018 Remove unused static inlines
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2013-11-21 11:33:37 +01:00
Alan Coopersmith
0153d1670e xtrans 1.3.2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xtrans-1.3.2
2013-11-07 20:16:53 -08:00
Alan Coopersmith
426049c301 Allow XTRANS_SEND_FDS on Solaris as well
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-07 20:16:20 -08:00
Alan Coopersmith
76b4f4430f Check if we need to define _XOPEN_SOURCE for struct msghdr.msg_control
Required to expose the structure members in Solaris headers, since it
was an XPG4/UNIX95 addition to the Solaris ABI.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-07 20:16:20 -08:00
Alan Coopersmith
32070a64ba Add stubs for send/recv fd functions in local transports
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-07 20:16:20 -08:00
Keith Packard
08bf85958f Switch to CMSG_* macros for FD passing
This should be portable to non-Linux systems

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-07 20:16:20 -08:00
Keith Packard
6b54b5cf80 Actually disable all of the FD passing code unless XTRANS_SEND_FDS is set
Stick all of the functions relating to FD passing inside

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-07 03:49:05 -08:00
Keith Packard
f3709f3e0b Update to version 1.3.1
Signed-off-by: Keith Packard <keithp@keithp.com>
xtrans-1.3.1
2013-11-06 23:16:11 -08:00
Mark Kettenis
074614940c Don't include file descriptor passing code by default
Leave it up to the consumer to request this functionality by defining
XTRANS_SEND_FDS.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>

v2 - make sure this is only defined on systems where the code actually
works (Linux for now)
2013-11-06 23:15:40 -08:00
Keith Packard
a7094c389a Add SEND_FDS version of Readv
Now that we've found that libFS uses readv, we can test whether this
readv implementation works correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-02 19:23:41 -07:00
Keith Packard
58151f6355 Revert "Remove 'Readv' interface"
This reverts commit 9e8d99c2e2.

libFS still uses this API...
2013-11-02 19:10:11 -07:00
Keith Packard
1fb0fd555a Update to version 1.3.0
Adds FD passing interfaces and pulls in current patches past 1.2.7

Signed-off-by: Keith Packard <keithp@keithp.com>
xtrans-1.3.0
2013-10-31 17:21:53 -07:00
Keith Packard
adf920aa25 Add APIs to send file descriptors through the network
Exposes new TRANS(SendFd)/TRANS(RecvFd) APIs.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 13:07:46 -07:00
Keith Packard
9e8d99c2e2 Remove 'Readv' interface
No-one uses this, so there's no reason for it to be in the library

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 13:07:46 -07:00
Łukasz Stelmach
f6a161f2a0 Add const qualifier to unix_nolisten
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-09 23:42:39 -07:00
Alan Coopersmith
bd53f4c854 Docs: Drop pre-C89 TRANS() from docs since it's no longer in the headers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-27 22:11:40 -08:00
Alan Coopersmith
3c4e045542 Docs: convert function synopses to docbook funcsynopsis markup
Also add some cross-reference links and various other markup improvements.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-27 22:09:46 -08:00
Colin Walters
d9f3728ff7 autogen.sh: Implement GNOME Build API
http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-15 14:32:14 -05:00
Adam Jackson
575e1e901c configure: Remove AM_MAINTAINER_MODE
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-15 14:28:48 -05:00
Alan Coopersmith
ec3136232f Remove unused TLI ("STREAMSCONN") code from xtrans
Has never been converted to build in modular builds, so has been unusable
since X11R7.0 release in 2005.  All known platforms with TLI/XTI support
that X11R7 & later releases run on also have (and mostly prefer) BSD
socket support for their networking API.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-12-26 20:33:57 -08:00
Alan Coopersmith
8ce5ecd33b xtrans 1.2.7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xtrans-1.2.7
2012-03-22 20:04:16 -07:00
Matt Dew
f8eea0bf25 informaltable cleanup
On certain tables, add top and bottom borders to table
header and a bottom border to the table. This matches
what those tables in the old pdfs looked like.

the <?dbfo keep-together='always'> prevents tables from
splitting across pages. Useful for tiny tables.

Converting the colwidth to a floating point,
IE, 1* -> 1.0* cleans up these build errors:
WARNING: table-layout="fixed" and column-width unspecified
=> falling back to proportional-column-width(1)

Signed-off-by: Matt Dew <marcoz@osource.org>
2012-01-11 22:23:32 -07:00
Robert Bragg
6086f6c1d0 Xtranssock.c: avoid buffer overrun in SocketReopen
This function was constructing an address from a port string allocating
a buffer according to the size of the string but then later copying
the address according to sizeof(struct sockaddr).

This patch ensures that we allocate a struct sockaddr buffer with enough
space for the port string to be copied into sa_data[] and uses that
combined length to determine how much should be copied at the end of the
function.

This fixes a crash when using xwayland which uses ListenOnOpenFD() that
will call _XSERVTransReopenCOTSServer() with a short port string like
":1".

Signed-off-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-13 18:54:30 -08:00
Alan Coopersmith
a04a45cb94 Remove unnecessary casts on malloc, calloc & free calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-12-06 11:18:07 -08:00
Alan Coopersmith
a0bfb4fefd Replace malloc(strlen)+strcpy with strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-12-06 11:18:00 -08:00