summaryrefslogtreecommitdiff
path: root/Xtranssock.c
AgeCommit message (Collapse)Author
2024-08-02Merge remote-tracking branch 'origin/master' into obsdobsdMatthieu Herrb
2024-07-21Fix string length checkHEADmasterRobert Royals
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxtrans/-/merge_requests/19>
2023-06-15Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2023-03-19Remove client-side abstract socket supportDemi Marie Obenour
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>
2023-03-19Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-08-20move is_numeric to Xtranssock.c and only define for TCPCONN or TRANS_REOPENKeith Packard
Don't define this function unless it is actually going to be used. Signed-off-by: Keith Packard <keithp@keithp.com>
2022-07-01Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2022-05-10Automatically disable inet6 transport if ipv6 is disabled on machineRay Strode
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.
2020-04-25Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2019-09-30Delete SCO supportAdam Jackson
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-09-30unifdef USG and NCRAdam Jackson
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2018-03-24avoid -Wformat errors from clangRin Okuyama
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>
2016-11-03Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2016-09-10Update strlcpy macro check to also check HAVE_STRLCPYJeremy Huddleston Sequoia
xorg-server moved from HAS_STRLCPY to HAVE_STRLCPY in 2011 cf-xserver: d829a7c5cb42c979b58f3547136df5b05d906423 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-08-13Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2016-05-19unifdef LBXPROXY_t and TEST_tAdam Jackson
LBX is dead, and TEST_t is unused. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-19Remove CLTS codeAdam Jackson
Never been used, as far as I can tell. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-02Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2015-12-03Remove support for SysV on x86 platforms other than Solaris & SCOAlan Coopersmith
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>
2015-11-28Replace 'sun' with '__sun'Richard PALO
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>
2015-11-07Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2014-08-24Add const qualifiers to TRANS(OpenC{L,O}TS{Server,Client}) argsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-24Add const qualifiers to TRANS(Connect) argsAlan Coopersmith
Also required constifying UnixHostReallyLocal, since SocketUNIXConnect passes the host arg through to it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-23Add const qualifiers to TRANS(CreateListener) port argsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-23Add const qualifiers to TRANS(Reopen...) port argsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-04-08Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2014-03-31Increase UNIX socket buffer sizeMark Kettenis
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>
2013-12-08Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2013-11-21Fix alignment issues in FD passing codeMark Kettenis
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-21Remove unused static inlinesMark Kettenis
Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2013-11-12Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2013-11-07Switch to CMSG_* macros for FD passingKeith Packard
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-07Actually disable all of the FD passing code unless XTRANS_SEND_FDS is setKeith Packard
Stick all of the functions relating to FD passing inside Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-02Add SEND_FDS version of ReadvKeith Packard
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-02Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2013-10-31Add APIs to send file descriptors through the networkKeith Packard
Exposes new TRANS(SendFd)/TRANS(RecvFd) APIs. Signed-off-by: Keith Packard <keithp@keithp.com>
2013-08-04Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
2013-07-09Add const qualifier to unix_nolistenŁukasz Stelmach
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>
2012-01-01Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
Conflicts: Xtrans.c Xtransutil.c
2011-12-13Xtranssock.c: avoid buffer overrun in SocketReopenRobert Bragg
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-06Remove unnecessary casts on malloc, calloc & free callsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-12-05Finish conversion to standard C allocation functionsAlan Coopersmith
Commit 4ac40cd5451 started this, by no longer special casing the xserver to include it's former custom allocation functions, this just takes the remaining #defines and pre-substitutes them into the code. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-05Fix some resource & memory leaks in libxtrans.Alan Hourihane
Signed-off-by: Alan Hourihane <alanh@vmware.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-01Merge remote-tracking branch 'origin/master' into obsdMatthieu Herrb
Conflicts: Xtranssock.c Xtransutil.c
2011-10-01Convert a bunch of sprintf calls to snprintfAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-01Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-01Fix warning: unused variable 'tmpport' with various configurationsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-01Add _X_UNUSED attributes to silence unused parameter warningsAlan Coopersmith
Not all the transport variants use all the arguments to every function, but as long as one transport type needs it, they all get the args passed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-01Fix unused variable warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>