summaryrefslogtreecommitdiff
path: root/Xtrans.c
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>
* 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>
* Fix spelling/wording issuesAlan Coopersmith2022-05-101-3/+3
| | | | | | | Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* TEST_t is never definedAdam Jackson2019-10-141-4/+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-301-4/+1
| | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Delete SCO supportAdam Jackson2019-09-301-6/+3
| | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* unifdef USG and NCRAdam Jackson2019-09-301-1/+1
| | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use strcasecmp if it's available, instead of lowercasing stringsAlan Coopersmith2018-08-251-0/+8
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove GetMyAddrAdam Jackson2016-05-191-21/+0
| | | | | | | Again, pre-xcb libX11 was the only consumer. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Remove CLTS codeAdam Jackson2016-05-191-146/+0
| | | | | | | Never been used, as far as I can tell. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Remove support for SysV on x86 platforms other than Solaris & SCOAlan Coopersmith2015-12-031-5/+2
| | | | | | | | | 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-281-6/+6
| | | | | | | | | 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>
* Add TRANS(Listen) function to re-enable specific listen socketsKeith Packard2014-09-131-0/+25
| | | | | | | | | | 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(MakeAll*ServerListeners) port argsAlan Coopersmith2014-08-241-5/+6
| | | | | | | 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-241-1/+1
| | | | | | | 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-231-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add const qualifiers to TRANS(Reopen...) port argsAlan Coopersmith2014-08-231-3/+3
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add const qualifiers to TRANS(Open...) address argsAlan Coopersmith2014-08-231-6/+7
| | | | | | | 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>
* 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>
* Add TransIsListening()Jon TURNEY2014-01-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
* Enable systemd socket activationŁukasz Stelmach2014-01-131-1/+82
| | | | | | | | | | | | | | | | | 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>
* Define TRANS_RECEIVED flag for transportsŁukasz Stelmach2014-01-131-0/+28
| | | | | | | | | 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>
* Actually disable all of the FD passing code unless XTRANS_SEND_FDS is setKeith Packard2013-11-071-0/+2
| | | | | | Stick all of the functions relating to FD passing inside Signed-off-by: Keith Packard <keithp@keithp.com>
* Revert "Remove 'Readv' interface"Keith Packard2013-11-021-0/+7
| | | | | | This reverts commit 9e8d99c2e27f2c8acbbfb5b760649aa1bfad665e. libFS still uses this API...
* Add APIs to send file descriptors through the networkKeith Packard2013-10-311-0/+12
| | | | | | Exposes new TRANS(SendFd)/TRANS(RecvFd) APIs. Signed-off-by: Keith Packard <keithp@keithp.com>
* Remove 'Readv' interfaceKeith Packard2013-10-311-7/+0
| | | | | | No-one uses this, so there's no reason for it to be in the library Signed-off-by: Keith Packard <keithp@keithp.com>
* Remove unused TLI ("STREAMSCONN") code from xtransAlan Coopersmith2012-12-261-5/+0
| | | | | | | | | 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>
* Remove unnecessary casts on malloc, calloc & free callsAlan Coopersmith2011-12-061-5/+5
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
* Replace malloc(strlen)+strcpy with strdupAlan Coopersmith2011-12-061-19/+7
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
* Finish conversion to standard C allocation functionsAlan Coopersmith2011-12-051-37/+37
| | | | | | | | | 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>
* Fix some resource & memory leaks in libxtrans.Alan Hourihane2011-12-051-0/+1
| | | | | | 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>
* Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith2011-10-011-3/+4
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
* Convert PRMSG macro to prmsg inline functionAlan Coopersmith2011-10-011-65/+63
| | | | | | | | | | Allows using varargs to have the correct number of arguments passed to get rid of the many gcc warnings about variable printf format strings, and to reduce the duplication from having 5 implementations of the PRMSG macro depending on the debug options defined & output method used. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
* Strip trailing whitespaceAlan Coopersmith2011-09-161-24/+24
| | | | | | | Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove a decnet leftoverAdam Jackson2011-03-161-16/+0
| | | | | | Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Remove ISCFuncs, fix SCOFuncs inclusion (bug 23324)Jesse Adkins2010-11-071-6/+4
| | | | | | | | | | | ISCFuncs was removed by commit 339ddc413559d4cb117a72f87b2a70dae6911c32. SCOFuncs should be for SCO only, instead of !sun. Also, remove comments that suggest ISC support. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix ifdef checks for SVR4 to do the right thing on SolarisAlan Coopersmith2009-07-301-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
* Remove DECNET support.Adam Jackson2008-10-071-4/+1
| | | | This hasn't been consumed in the server or libs since 7.0.
* Massive ifdef cleanup, dropping a ton of unsupported platform code.Adam Jackson2008-08-071-49/+5
|
* Apple: Allow Xquartz to provide an additional fd to xtrans since the dynamic ↵Jeremy Huddleston2008-07-151-0/+14
| | | | addition code in the server isn't bulletproof yet.
* Launchd: This functionality has been moved into xorg-serverJeremy Huddleston2008-05-231-62/+1
|
* Fixed #ifdef checks that were using i386 to use __i386__Jeremy Huddleston2008-02-101-4/+4
| | | | | | | | | | | | | | | """ It's simply obsolete, sloppy, compiler namespace pollution. The compiler is not allowed to predefine symbols that might conflict with ordinary identifiers. For backwards compatibility gcc currently predefines i386 when compiling for x86 32-bit (but not 64-bit), but that will go away. It is also not defined if you specify -ansi when invoking the compiler, because then it is seriously standards compliant. Other compilers shouldn't define it either. Correct code shouldn't rely on it being defined. However __i386__ is safe and proper. """
* make launchd error messages less scaryBen Byer2007-12-021-5/+7
|
* removed cvs tagsBen Byer2007-11-141-6/+1
|
* changes to support launchd on OS XBen Byer2007-09-051-1/+73
|
* Merge more fixes from Solaris xtransAlan Coopersmith2006-08-221-4/+6
| | | | | Convert sprintf -> snprintf Don't use fake readv/writev on Solaris x86.
* Merge Solaris named pipe transport support into LOCALCONNAlan Coopersmith2006-08-211-1/+4
| | | | | Also clean up #ifdefs in Xtranslcl for which transport types are supported Add "pipe" alias for named pipe transport on Solaris to match Solaris Xlib.
* See ChangeLog entry 2005-11-07 for details.XORG-6_8_99_903XORG-6_8_99_902Kean Johnson2005-11-081-5/+5
|