summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* DISPLAY starting with unix: or / is always a socket pathHEADmasterDemi Marie Obenour2023-03-191-23/+25
| | | | | | Do not consider anything else in this case. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
* Allow full paths to sockets on non-macOSDemi Marie Obenour2023-03-191-6/+18
| | | | | | | This adds explicit checks for addresses that start with / or unix: and uses full paths in this case. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
* Remove client-side abstract socket supportDemi Marie Obenour2023-03-192-31/+6
| | | | | | | | | | CVE-2020-25697 and the Flatpak documentation show that clients using abstract sockets without mutual authentication is unsafe. TRANS_ABSTRACT remains supported, but it is now a no-op on the client side. Abstract sockets are still supported for servers, as the X server authenticates the client via other methods. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
* Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith2023-03-193-3/+3
| | | | | | Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Allow partial connection to succeedOlivier Fourdan2023-03-191-0/+3
| | | | | | | | | | | | | | | | | | | | Xwayland can optionally be socket-activated by the Wayland compositor, in which case it would use only the sockets provided by the compositor. However, that prevents other transport protocols from working, because when it's given a socket from the Wayland compositor, it would disable all other connections and rely solely on the given socket. Change `MakeAllCOTSServerListeners` to allow for partial connections so that if `partial` is set to a non-zero value by the caller, we do not bail out in the address is already in use. That allows to continue trying with other protocols even if the local connection fails (as this is already handled by the socket from the Wayland compositor). Related: https://gitlab.freedesktop.org/xorg/xserver/issues/817 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* Use font server ErrorF/VErrorF instead of private versionsKeith Packard2022-08-201-3/+4
| | | | | | | | | | | | | | | | | | | XTrans creates custom ErrorF/VErrorF functions when the including project doesn't provide them, however the test for that is weak and xtrans ends up using the private versions for the font server as well. This means that all xtrans error messages will not be included in the font server log. It also causes redefinition warnings when building the font server (which is how this problem was identified). However, the font server doesn't currently provide a VErrorF function, so instead of just always relying on the font server to provide these functions, this patch uses a new TRANS_HAS_ERRORF define to select whether the project-provided or internal versions will be used. A patch to the font server that adds VErrorF and defines TRANS_HAS_ERRORF will be required to fix this bug. Signed-off-by: Keith Packard <keithp@keithp.com>
* move is_numeric to Xtranssock.c and only define for TCPCONN or TRANS_REOPENKeith Packard2022-08-203-19/+14
| | | | | | Don't define this function unless it is actually going to be used. Signed-off-by: Keith Packard <keithp@keithp.com>
* gitlab CI: add a basic build testAlan Coopersmith2022-05-101-0/+99
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix spelling/wording issuesAlan Coopersmith2022-05-105-7/+7
| | | | | | | Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Build xz tarballs instead of bzip2Alan Coopersmith2022-05-101-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Automatically disable inet6 transport if ipv6 is disabled on machineRay Strode2022-05-101-4/+11
| | | | | | | | | | | | | | | | | | | | | If a machine is booted with ipv6.disable=1, trying to bind to an AF_INET6 socket will fail with AFNOSUPPORT. The tcp transport automatically falls back to ipv4 in this case, but the more specific inet6 transport just fails. This failure leads to MakeAllCOTSServerListeners returning a partial success. Unfortunately, the X server can't really contiue with partial successes from this function if -displayfd is in use, since that would, in other cases, potentially lead to the -displayfd electing a display number that is potentially partially in use by a rogue program. This commit addresses the issue by automatically disabling transports when they fail with AFNOSUPPORT, leading them to get ignored, rather than proceeding and ultimately returning from MakeAllCOTSServerListerns with partial=TRUE.
* TEST_t is never definedAdam Jackson2019-10-142-8/+1
| | | | | | | | | | This didn't even correspond to any of the testing protocol extensions! Apparently there used to be some test programs in xtrans itself, and they've not been a thing since 1994: https://cgit.freedesktop.org/~alanc/xc-historical/commit/?id=73bf4832c427855b2ce111d47dd1f181564b8d06 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove non-Solaris SysV supportAdam Jackson2019-09-303-582/+2
| | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Delete SCO supportAdam Jackson2019-09-306-477/+12
| | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* unifdef USG and NCRAdam Jackson2019-09-304-4/+4
| | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* xtrans 1.4.0xtrans-1.4.0Alan Coopersmith2019-03-161-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Update configure.ac bug URL for gitlab migrationAlan Coopersmith2018-12-071-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Update README for gitlab migrationAlan Coopersmith2018-11-192-11/+10
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use fchmod() instead of chmod() when creating named pipesAlan Coopersmith2018-09-301-3/+4
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use strcasecmp if it's available, instead of lowercasing stringsAlan Coopersmith2018-08-253-3/+25
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Set freeXLOCAL to NULL after freeing it to prevent double freesAlan Coopersmith2018-08-251-0/+1
| | | | | | | We shouldn't be calling the LocalEndTransports routine twice, but just make sure if we do, we don't call free twice on the same pointer. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* avoid -Wformat errors from clangRin Okuyama2018-03-241-1/+1
| | | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=99882 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* autogen.sh: use quoted string variablesEmil Velikov2017-01-261-4/+4
| | | | | | | | | Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer2017-01-261-1/+1
| | | | | | | Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* Update strlcpy macro check to also check HAVE_STRLCPYJeremy Huddleston Sequoia2016-09-101-1/+1
| | | | | | | | xorg-server moved from HAS_STRLCPY to HAVE_STRLCPY in 2011 cf-xserver: d829a7c5cb42c979b58f3547136df5b05d906423 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* Revert "Make FreeConnInfo static"Adam Jackson2016-09-012-4/+4
| | | | | | | | | | | | | <anholt> ajax: 75419e6b6d985ea8796f05d1acb5e154b065c9b9 of xtrans also seems to have broken xtest. And indeed it does, xts5 knows a fair amount about xlib internals for some reason. Whether that's cromulent or not, we want to be able to run automatic tests from top-of-tree, so we can't leave this broken. This reverts commit 75419e6b6d985ea8796f05d1acb5e154b065c9b9. Signed-off-by: Adam Jackson <ajax@redhat.com>
* Remove GetMyAddrAdam Jackson2016-05-192-28/+0
| | | | | | | Again, pre-xcb libX11 was the only consumer. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Make FreeConnInfo staticAdam Jackson2016-05-192-4/+4
| | | | | | | | libX11 used to need this in the XOpenDisplay code, but hasn't since xcb became mandatory. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* unifdef LBXPROXY_t and TEST_tAdam Jackson2016-05-192-23/+0
| | | | | | | LBX is dead, and TEST_t is unused. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Remove CLTS codeAdam Jackson2016-05-196-576/+3
| | | | | | | Never been used, as far as I can tell. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* autogen: Add a default patch prefixAdam Jackson2016-05-181-0/+3
| | | | Signed-off-by: Adam Jackson <ajax@redhat.com>
* Remove support for SysV on x86 platforms other than Solaris & SCOAlan Coopersmith2015-12-033-21/+6
| | | | | | | | | No other x86 SysV platforms have ever been supported in the modular build systems, so we don't need to keep carrying around a bunch of ifdef's for them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
* Replace 'sun' with '__sun'Richard PALO2015-11-284-25/+25
| | | | | | | | | Globally replace #ifdef and #if defined usage of 'sun' with '__sun' such that strict ISO compiler modes such as -ansi or -std=c99 can be used. Signed-off-by: Richard PALO <richard@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Make sure LONG64 is defined in Xtrans.hJulien Cristau2015-09-251-0/+1
| | | | | | | | | | | | Xtrans.h defines BytesReadable_t as int or long depending on whether LONG64 is defined. We need to make sure Xmd.h is included so our idea of BytesReadable_t is consistent across compilation units. Debian bug#749120 Reported-by: Michael Tautschnig <mt@debian.org> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* xtrans 1.3.5xtrans-1.3.5Keith Packard2014-09-201-1/+1
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Add TRANS(Listen) function to re-enable specific listen socketsKeith Packard2014-09-132-0/+29
| | | | | | | | | | 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>
* Add const qualifiers to TRANS(OpenC{L,O}TS{Server,Client}) argsAlan Coopersmith2014-08-244-71/+74
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add const qualifiers to TRANS(MakeAll*ServerListeners) port argsAlan Coopersmith2014-08-243-9/+10
| | | | | | | 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>
* Add const qualifiers to TRANS(Connect) argsAlan Coopersmith2014-08-246-13/+16
| | | | | | | Also required constifying UnixHostReallyLocal, since SocketUNIXConnect passes the host arg through to it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add const qualifiers to TRANS(CreateListener) port argsAlan Coopersmith2014-08-236-10/+12
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add const qualifiers to TRANS(Reopen...) port argsAlan Coopersmith2014-08-235-19/+20
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add const qualifiers to TRANS(Open...) address argsAlan Coopersmith2014-08-233-14/+15
| | | | | | | 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>
* Update docs to note that TransName is now const char *Alan Coopersmith2014-08-231-1/+1
| | | | | | Missed when the code was updated in commit eb9a8904fbef61a57ff0. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* xtrans 1.3.4xtrans-1.3.4Hans de Goede2014-03-311-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Increase UNIX socket buffer sizeMark Kettenis2014-03-311-0/+21
| | | | | | | | 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>
* Add missing headers for free() and strlen().Thomas Klausner2014-03-261-1/+2
| | | | | Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
* Cast ctype(3) function arguments to unsigned char.Thomas Klausner2014-03-261-2/+2
| | | | | | | Fixes warnings on at least NetBSD. Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
* configure: Also add -D_DEFAULT_SOURCE to .pc cflags to shut up glibc warningsHans de Goede2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* xtrans 1.3.3xtrans-1.3.3Hans de Goede2014-01-271-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add TransIsListening()Jon TURNEY2014-01-272-0/+20
| | | | | | | | | | | | | | | | | | | | | | 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>