summaryrefslogtreecommitdiff
path: root/Xtrans.c
AgeCommit message (Collapse)Author
2024-04-03TRANS(GetHostname): Fix "‘strncpy’ output truncated.." warningKim Woelders
Occurs when compiling xserver master with gcc 13.2.1. In file included from /local/stuff/xorg/include/X11/Xtrans/transport.c:69: In function ‘_XSERVTransGetHostname’, inlined from ‘_XSERVTransConvertAddress’ at /local/stuff/xorg/include/X11/Xtrans/Xtransutil.c:188:12: /local/stuff/xorg/include/X11/Xtrans/Xtrans.c:1352:5: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 1352 | strncpy (buf, name.nodename, len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /local/stuff/xorg/include/X11/Xtrans/Xtrans.c:1350:11: note: length computed here 1350 | len = strlen (name.nodename); | ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kim Woelders <kim@woelders.dk> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxtrans/-/merge_requests/16>
2024-04-03TRANS(ParseAddress): Fix "assignment discards ‘const’ qualifier" warningsKim Woelders
Occurs when compiling xserver master with gcc 13.2.1. In file included from /local/stuff/xorg/include/X11/Xtrans/transport.c:69, from ../os/xstrans.c:17: /local/stuff/xorg/include/X11/Xtrans/Xtrans.c: In function ‘_XSERVTransParseAddress’: /local/stuff/xorg/include/X11/Xtrans/Xtrans.c:216:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 216 | _host = ""; | ^ /local/stuff/xorg/include/X11/Xtrans/Xtrans.c:217:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 217 | _port = address; | ^ /local/stuff/xorg/include/X11/Xtrans/Xtrans.c:229:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 229 | _host = ""; | ^ /local/stuff/xorg/include/X11/Xtrans/Xtrans.c:230:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 230 | _port = address + 5; | ^ Signed-off-by: Kim Woelders <kim@woelders.dk> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxtrans/-/merge_requests/16>
2023-03-19DISPLAY starting with unix: or / is always a socket pathDemi Marie Obenour
Do not consider anything else in this case. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-03-19Allow full paths to sockets on non-macOSDemi Marie Obenour
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>
2023-03-19Allow partial connection to succeedOlivier Fourdan
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>
2022-05-10Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-10-14TEST_t is never definedAdam Jackson
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>
2019-09-30Remove non-Solaris SysV supportAdam Jackson
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
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-08-25Use strcasecmp if it's available, instead of lowercasing stringsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-05-19Remove GetMyAddrAdam Jackson
Again, pre-xcb libX11 was the only consumer. 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>
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>
2014-09-13Add TRANS(Listen) function to re-enable specific listen socketsKeith Packard
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-08-24Add const qualifiers to TRANS(MakeAll*ServerListeners) port argsAlan Coopersmith
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-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-08-23Add const qualifiers to TRANS(Open...) address argsAlan Coopersmith
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-03-26Add missing headers for free() and strlen().Thomas Klausner
Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-03-26Cast ctype(3) function arguments to unsigned char.Thomas Klausner
Fixes warnings on at least NetBSD. Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-01-27Add TransIsListening()Jon TURNEY
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-13Enable systemd socket activationŁukasz Stelmach
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-13Define TRANS_RECEIVED flag for transportsŁukasz Stelmach
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>
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-02Revert "Remove 'Readv' interface"Keith Packard
This reverts commit 9e8d99c2e27f2c8acbbfb5b760649aa1bfad665e. libFS still uses this API...
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-10-31Remove 'Readv' interfaceKeith Packard
No-one uses this, so there's no reason for it to be in the library Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-26Remove unused TLI ("STREAMSCONN") code from xtransAlan Coopersmith
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>
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-06Replace malloc(strlen)+strcpy with strdupAlan 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-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-01Convert PRMSG macro to prmsg inline functionAlan Coopersmith
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>
2011-09-16Strip trailing whitespaceAlan Coopersmith
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>
2011-03-16Remove a decnet leftoverAdam Jackson
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-07Remove ISCFuncs, fix SCOFuncs inclusion (bug 23324)Jesse Adkins
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>
2009-07-30Fix ifdef checks for SVR4 to do the right thing on SolarisAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2008-10-07Remove DECNET support.Adam Jackson
This hasn't been consumed in the server or libs since 7.0.
2008-08-07Massive ifdef cleanup, dropping a ton of unsupported platform code.Adam Jackson
2008-07-15Apple: Allow Xquartz to provide an additional fd to xtrans since the dynamic ↵Jeremy Huddleston
addition code in the server isn't bulletproof yet.
2008-05-23Launchd: This functionality has been moved into xorg-serverJeremy Huddleston
2008-02-10Fixed #ifdef checks that were using i386 to use __i386__Jeremy Huddleston
""" 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. """
2007-12-02make launchd error messages less scaryBen Byer
2007-11-14removed cvs tagsBen Byer
2007-09-05changes to support launchd on OS XBen Byer
2006-08-22Merge more fixes from Solaris xtransAlan Coopersmith
Convert sprintf -> snprintf Don't use fake readv/writev on Solaris x86.