aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/include/os.h
Commit message (Collapse)AuthorAgeFilesLines
* Add asprintf() implementation for platforms without itAlan Coopersmith2017-12-101-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported from X.org: commit c95c1d338fdb62dbe3dba934b97324fa778b7fce Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sat Nov 27 18:43:12 2010 -0800 Add asprintf() implementation for platforms without it Provides a portable implementation of this common allocating sprintf() API found in many, but not yet all, of the platforms we support. If the platform provides vasprintf() we simply wrap it, otherwise we implement it - either way callers can use it regardless of platform. Since not all platforms guarantee to NULL out the return pointer on failure, we don't either, and require callers to check the return value for -1. The old Xprintf() API is deprecated, but left for compatibility for now. The new API is added in a new header so that it can be used in parts of the server such as hw/xfree86/parser that don't include all the server headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Includes re-indentation changes from 9838b7032ea9792bec21af424c53c07078636d21. Backported-to-NX-by: Mihai Moldovan <ionic@ionic.de>
* Use unique logfile names when starting server with -displayfdAlan Coopersmith2017-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | commit edcb6426f20c3be5dd5f50b76a686754aef2f64e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Jan 1 18:11:14 2016 -0800 Use unique logfile names when starting server with -displayfd Fixes https://bugs.freedesktop.org/show_bug.cgi?id=93212 Previously all X servers started with -displayfd would overwrite Xorg.0.log - now a temporary name of Xorg.pid-<pid>.log is used until after -displayfd finds an open display - then it is renamed to the traditional Xorg.<display>.log name. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* os: Use NotifyFd interface for listen descriptorsKeith Packard2017-03-211-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bundle X.org backport of these commits: commit 7ea64fb4374504bd3d524fc08c90efdab9f253ea Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Mar 9 09:55:57 2015 -0700 Clear ListenTransConns entries in CloseWellKnownConnections Since _XSERVTransClose frees the connection pointer passed to it, remove that pointer from the array, so we don't try to double free it if we come back into CloseWellKnownConnections again. Should fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=6665 in which the shutdown section of the main() loop called CloseWellKnownConnections() and then moved on to ddxGiveUp(), which failed to release the VT and thus called AbortServer(), which called CloseWellKnownConnections() again. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> commit 7b02f0b87ec2fa0cc5a65307a1fd55c671cec884 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 11 22:02:17 2015 -0800 os: Use NotifyFd interface for listen descriptors Replace the custom path for dealing with new incoming connections with the general-purpose NotifyFd API. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> commit ba71b69f94f00a6f6910597185610668e79c10be Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Jan 1 17:34:41 2016 -0800 Avoid segfault in CloseWellKnownConnections when using -displayfd When -displayfd is looping through the possible display ids to use, if it can't open all the listening sockets for one (say when :0 is already in use), it calls CloseWellKnownConnections to close all the ListenTransConns entries before the point that ListenTransFds was allocated & initialized, so CloseWellKnownConnections would segfault trying to read entries from a NULL ListenTransFds pointer. Introduced by commit 7b02f0b8 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* Move SIGUSR1 notification as late as possible.Adam Jackson2017-03-211-0/+2
| | | | | | | | | | | | | | | | | | commit f01e149d1af14ef9ee0e8a6743ab6a08f3bb677c Author: Adam Jackson <ajax@redhat.com> Date: Thu Nov 1 15:41:11 2007 -0400 Move SIGUSR1 notification as late as possible. If we inherited a signal mask from the parent process that ignores SIGUSR1, then we will send SIGUSR1 to the parent to indicate when we're ready to accept connections. Unfortunately, we send this notification way too early, right after creating the sockets rather than just before entering the main loop. Move it to just before Dispatch() so we're not lying quite so much. Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* dix: Pull client-is-local flag up to the ClientRecAdam Jackson2017-03-211-2/+0
| | | | | | | | | | | | | | | Backported from X.org commit ff8e3ad8074cd2c8bed49b39c40c2b4892118270 Author: Adam Jackson <ajax@redhat.com> Date: Thu Sep 20 13:16:59 2012 -0400 dix: Pull client-is-local flag up to the ClientRec Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* Rework local client id finding code to be more uniformAlan Coopersmith2017-03-211-0/+18
| | | | | | | | | | | | | | | | | | | | | Backport of X.org commit: commit 2d93e69690d2c5d4a89a795ede6423796528e5df Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Thu Sep 27 16:47:06 2007 -0700 Rework local client id finding code to be more uniform Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Note: This commit also switches client_uid_string's size from 32 to 64 chars, as found in this X.org commit (spotted by Mihai Moldovan during code review): commit a7b944f0d96c3e0e15e75378a04def1ac96089fb Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Nov 1 16:17:49 2006 -0800 If getpeerucred() is available, include pid & zoneid in audit messages too
* os: Implement support for NotifyFd X_NOTIFY_WRITE and removal of ↵Keith Packard2017-03-171-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AddEnabledDevices/RemoveEnabledDevices Backported from X.org: commit be5a513fee6cbf29ef7570e57eb0436d70fbd88c Author: Keith Packard <keithp@keithp.com> Date: Mon Dec 7 15:12:14 2015 -0800 Remove AddEnabledDevice and AddGeneralSocket APIs All uses of these interfaces should instead be using the NotifyFd API instead. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> commit 4020aacd1fc5b9c63369f011aeb9120af9c55218 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 11 22:02:03 2015 -0800 os: Implement support for NotifyFd X_NOTIFY_WRITE This adds the ability to be notified when a file descriptor is available for writing. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* os: Add NotifyFd interfacesKeith Packard2017-03-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported from X.org: commit 0c41b7af4ab0c8d22b88f201293f59524d1e7317 Author: Keith Packard <keithp@keithp.com> Date: Wed Nov 11 22:02:02 2015 -0800 os: Add NotifyFd interfaces This provides a callback-based interface to monitor file descriptors beyond the usual client and device interfaces. Modules within the server using file descriptors for reading and/or writing can call Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); mask can be any combination of X_NOTIFY_READ and X_NOTIFY_WRITE. When 'fd' becomes readable or writable, the notify_fd function will be called with the 'fd', the ready conditions and 'data' values as arguments, When the module no longer needs to monitor the fd, it will call void RemoveNotifyFd(int fd); RemoveNotifyFd may be called from the notify function. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* Backport CVE-2017-2624 (timingsafe_memcmp)Ulrich Sibiller2017-03-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes ArcticaProject/nx-libs#365 These two commits: commit 5c44169caed811e59a65ba346de1cadb46d266ec Author: Adam Jackson <ajax@redhat.com> Date: Thu Mar 2 17:20:30 2017 -0500 os: Squash missing declaration warning for timingsafe_memcmp timingsafe_memcmp.c:21:1: warning: no previous prototype for ‘timingsafe_memcmp’ [-Wmissing-prototypes] timingsafe_memcmp(const void *b1, const void *b2, size_t len) Signed-off-by: Adam Jackson <ajax@redhat.com> commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c Author: Matthieu Herrb <matthieu@herrb.eu> Date: Tue Feb 28 19:18:25 2017 +0100 Use timingsafe_memcmp() to compare MIT-MAGIC-COOKIES CVE-2017-2624 Provide the function definition for systems that don't have it. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
* replace (DE)ALLOCATE_LOCAL by malloc/freeUlrich Sibiller2017-03-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | This is basically a backport of the following commits + replacing xalloc/xfree by malloc/free. Fixes ArcticaProject/nx-libs#358. commit 2761c103311a1160bc483fd0367d654733df8598 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:03:26 2007 +0000 OS: Remove usage of alloca Replace with heap allocations. commit 5e363500c86042c394595e1a6633581eb8fcd1bb Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:38:28 2007 +0000 OS: Remove ALLOCATE_LOCAL from os.h Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and remove the include of Xalloca.h as well.
* nx-X11/programs/Xserver/include/os.h: backport xallocarray().Mihai Moldovan2017-03-031-0/+2
|
* nx-X11/{config/cf/{{Imake,X11}.tmpl,linux.cf},programs/Xserver/{include/os.h ↵Mihai Moldovan2017-03-031-0/+6
| | | | ,os/{Imakefile,reallocarray.c}}: backport reallocarray() implementation.
* Xserver/os/oscolor.c: Follow X.org in dropping the rgb.txt file entirely. ↵Mike Gabriel2017-02-261-1/+0
| | | | | | | | | | | | | | | | | | | Content of that file is now hard-coded. Adopting an exact copy of os/oscolor.c from X.org leads to this compiler warning: ``` oscolor.c:844:1: warning: string length ‘7614’ is greater than the length ‘4095’ ISO C99 compilers are required to support [-Woverlength-strings] }; ^ ``` This will be address later in coordination with X.org. Note: there is a tiny change in oscolor.c as we ship it. The original X.org file includes <X11/keysym.h> which seems unneeded. We drop that one line from oscolor.c. Fixes ArcticaProject/nx-libs#259.
* drop platform support: unifdef __UNIXOS2__.Mike Gabriel2017-02-081-1/+1
| | | | Fixes ArcticaProject/nx-libs#271.
* Remove libcwrapper usage from xorg server modules. The libcwrapper is not ↵Eric Anholt2016-12-041-7/+1
| | | | | | | | | | | | | | | used in nxagent. From c3d14036729fd186d4ec7ca1de603e1f2d174e2f Mon Sep 17 00:00:00 2001 From: Eric Anholt <anholt@freebsd.org> Date: Fri, 10 Feb 2006 22:00:30 +0000 Subject: Remove libcwrapper usage from xorg server modules. The libcwrapper is only of (marginal) use in the drivers, and that usage remains. Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Fixes ArcticaProject/nx-libs#246 (together with merge commit ecd335fa61551d0b86d3f075469a7743ab899d95).
* VCS info lines: Remove ancient X.org / XFree86 VCS info line from code files.Mike Gabriel2016-07-061-2/+0
| | | | | This has already been started while replacing copyright info in file headers and has now been completed with this commit.
* Make WriteToClient take a const void * like any decent IO write function.Kristian Høgsberg2016-07-051-2/+2
| | | | | Enough with the casting. Doesn't break API or even ABI, but does make a lot of silly casts superfluos.
* Xserver/os/log.c: Make sure strlcpy is defined in log.c. Immitate what is ↵Mike Gabriel2016-07-051-0/+7
| | | | done in X.org.
* os: Remove deprecated malloc/free wrappers, clean ↵Mike Gabriel2016-07-021-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage Backported from X.org: commit cad9b053d52f62432dfd70e42e0240de77027cae Author: Adam Jackson <ajax@redhat.com> Date: Tue Jul 8 13:24:25 2014 -0400 os: Remove deprecated malloc/free wrappers Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com> commit e983848ab44b0769f97f6207f1aa8b4f127be6a9 Author: Mikhail Gusarov <dottedmag@dottedmag.net> Date: Thu May 6 00:16:24 2010 +0700 Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so stop fiddling with alignment manually and just pass the arguments to library functions. Also convert silent error when negative size is passed into function into warning in log file. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead.Mike Gabriel2016-07-021-1/+1
|
* nx-X11/programs/Xserver: Drop {X,x}free() macros, use free() instead.Mike Gabriel2016-07-021-1/+1
| | | | Fixes ArcticaProject/nx-libs#105
* LBX: Drop all Xserver code blocks that relate to removed LBX extension.Mike Gabriel2016-06-011-11/+0
|
* Clear header file namespace separation (<X11/...> vs. <nx-X11/...>).Mike Gabriel2015-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | In the process of building nxagent against more and more system-wide installed X.org libraries, we come to the limit of including structs from this (bundled nx-X11) and that (system-wide X.Org) library. This commit introduces a clear namespace separation of headers provided by nx-X11 and headers provided by X.Org. This approach is only temporary as we want to drop all nx-X11 bundled libraries from nx-libs. However, for a while we need to make this separation clear and also ship some reduced fake X.Org headers that avoid pulling in libX* and libNX_X* symbols at the same time. This patch has been tested on Debian jessie and unstable and requires no overall testing on various distros and distro versions, as we finally will drop all libNX_X* libraries and build against X.org's client libs. For now, this hack eases our development / cleanup process.
* Replace 'pointer' type with 'void *'Keith Packard2015-12-281-28/+28
| | | | | | | | | | This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net> Rebased against NX: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
* Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1Reinhard Tartler2011-10-101-0/+546
Summary: Imported nx-X11-3.1.0-1.tar.gz Keywords: Imported nx-X11-3.1.0-1.tar.gz into Git repository