Age | Commit message (Collapse) | Author |
|
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>
|
|
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
|
|
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>
|
|
Stick all of the functions relating to FD passing inside
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
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>
|
|
Exposes new TRANS(SendFd)/TRANS(RecvFd) APIs.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Now that prmsg lets arguments types actually be checked, fix
the warnings found.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
|
|
If IPv6 is enabled at build time, assume that the C library will have
getaddrinfo at runtime.
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
|
|
Compiler warnings are spread on other packages, with a
warning in the format:
/usr/include/X11/Xtrans/Xtranssock.c:548: warning: 'ciptr' may be used uninitialized in this function
so the code was slightly changed so that the compiler
would not "think" it could be used without initialization.
|
|
If your OS doesn't have sysconf(3), then life is already hard for you.
|
|
|
|
|
|
Apropos of bug #15884.
|
|
Red Hat bug #445303.
|
|
Since the struct has a fixed-lenght char[] its sizeof() contains
trailing NUL octets which results in corrupt abstract sockets.
Instead, take the strlen(3) of the path, plus the single NUL octet
(which identifies the path as an abstract path rather than a file-
system path) plus the offset from the start of the struct to the
start of the char array.
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=15677
|
|
error condition.
|
|
Check for socklen_t definition and if found use it instead of size_t or
int for the length argument to getpeername/getsockname/etc.
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6688467>
|
|
If the socket isn't there, it's not gonna magically appear. Either it's
a server socket and you should have just waited for the SIGUSR1 from the
server, or it's a stale reference to an ICE socket.
However, do retry once, so fallback from abstract to filesystem namespace
works.
Originally Debian bug #385976.
|
|
GNU/kFreeBSD defines BSD44SOCKETS, but doesn't have SOCK_MAXADDRLEN.
Check for the latter directly.
|
|
Unlike normal unix sockets, the abstract namespace is not bound to the
filesystem. This has some notable advantages; /tmp need not exist, the
socket directory need not have magic permissions, etc. xtrans servers
will listen on both the normal and abstract socket endpoints; clients
will attempt to connect to the abstract socket before connecting to the
corresponding filesystem socket.
Based on a patch by Bill Crawford.
|
|
"""
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.
"""
|
|
|
|
|
|
* Xtranssock.c: (SocketReopen): oops fix a typo in my last commit.
|
|
* Xtranssock.c:
(SocketReopen): protect use of BSD4.4 socket with BSD44SOCKETS macro.
protect use of strlcnpy with HAVE_STRLCPY macro.
That one is defined (or not) by the xserver configure.
|
|
|
|
Bug #728: <https://bugs.freedesktop.org/show_bug.cgi?id=728>
Patch #3527: <https://bugs.freedesktop.org/attachment.cgi?id=3527>
bzero sockaddr structures before passing to kernel to convince memory
checkers that they are initialized before use
|
|
|
|
X.Org Bugzilla #4982 <https://bugs.freedesktop.org/show_bug.cgi?id=4982>
Patch #5424 <https://bugs.freedesktop.org/attachment.cgi?id=5424>
|
|
|
|
(This dates back to 1994 or before.)
|
|
|
|
fix for xtrans (Robert Millan)
|
|
<https://bugs.freedesktop.org/attachment.cgi?id=3046> Define
MAXHOSTNAMELEN if platform doesn't (Michael Banck)
|