From ff6126f44005388bbb2fc2fc2946891162abb3c0 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 4 Feb 2017 15:22:20 +0100 Subject: Xserver/randr: Regression fix introduced by c2b1f48. Re-introduce RegisterResourceName() calls after each CreateNewResourceType() call. Fixes ArcticaProject/nx-libs#309. --- nx-X11/programs/Xserver/randr/randr.c | 10 ++++++++++ nx-X11/programs/Xserver/randr/rrcrtc.c | 4 ++++ nx-X11/programs/Xserver/randr/rrmode.c | 3 +++ nx-X11/programs/Xserver/randr/rroutput.c | 4 ++++ nx-X11/programs/Xserver/randr/rrprovider.c | 4 ++++ 5 files changed, 25 insertions(+) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c index b29c3c888..e991af340 100644 --- a/nx-X11/programs/Xserver/randr/randr.c +++ b/nx-X11/programs/Xserver/randr/randr.c @@ -461,6 +461,11 @@ RRExtensionInit(void) ); if (!RRClientType) return; + +#ifdef NXAGENT_SERVER + RegisterResourceName(RRClientType, "RandRClient"); +#endif + RREventType = CreateNewResourceType(RRFreeEvents #ifndef NXAGENT_SERVER , "RandREvent" @@ -468,6 +473,11 @@ RRExtensionInit(void) ); if (!RREventType) return; + +#ifdef NXAGENT_SERVER + RegisterResourceName(RREventType, "RandREvent"); +#endif + extEntry = AddExtension(RANDR_NAME, RRNumberEvents, RRNumberErrors, ProcRRDispatch, SProcRRDispatch, NULL, StandardMinorOpcode); diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index 5ba66d5a6..59a3f446a 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -972,6 +972,10 @@ RRCrtcInit(void) if (!RRCrtcType) return FALSE; +#ifdef NXAGENT_SERVER + RegisterResourceName(RRCrtcType, "CRTC"); +#endif + return TRUE; } diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index a2bbec7d9..8f8d2d0aa 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -326,6 +326,9 @@ RRModeInit(void) if (!RRModeType) return FALSE; +#ifdef NXAGENT_SERVER + RegisterResourceName(RRModeType, "MODE"); +#endif return TRUE; } diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 07fda36b5..e5f69e010 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -429,6 +429,10 @@ RROutputInit(void) if (!RROutputType) return FALSE; +#ifdef NXAGENT_SERVER + RegisterResourceName(RROutputType, "OUTPUT"); +#endif + return TRUE; } diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c index fe99fa04d..ed2b1baca 100644 --- a/nx-X11/programs/Xserver/randr/rrprovider.c +++ b/nx-X11/programs/Xserver/randr/rrprovider.c @@ -440,6 +440,10 @@ RRProviderInit(void) if (!RRProviderType) return FALSE; +#ifdef NXAGENT_SERVER + RegisterResourceName(RRProviderType, "Provider"); +#endif + return TRUE; } -- cgit v1.2.3 From baf7a926716192cdaea7a52b76bb61decf5cda0d Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 8 Feb 2017 21:13:38 +0100 Subject: Screen.c: Ensure that an output is unused before destroying it Fixes ArcticaProject/nx-libs#293 --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 42 +++++++++++++++++++---------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 0e0cd0b21..2f6381696 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -3741,6 +3741,27 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in return r; } +/* + Destroy an output after removing it from any crtc that might reference it + */ +void nxagentDropOutput(RROutputPtr o) { + RRCrtcPtr c = o->crtc; + if (c) { + for (int i = 0; i < c->numOutputs; i++) { + if (c->outputs[i] == o) { +#ifdef DEBUG + fprintf(stderr, "nxagentDropOutput: output [%s] is in use by crtc [%p], removing it from there\n", o->name, c); +#endif + RRCrtcSet(c, NULL, 0, 0, RR_Rotate_0, 0, NULL); + } + } + } +#ifdef DEBUG + fprintf(stderr, "nxagentDropOutput: destroying output [%s]\n", o->name); +#endif + RROutputDestroy(o); +} + int nxagentAdjustRandRXinerama(ScreenPtr pScreen) { rrScrPrivPtr pScrPriv; @@ -3858,6 +3879,8 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) #ifdef DEBUG fprintf(stderr, "nxagentAdjustRandRXinerama: destroying crtc\n"); #endif + /* first reset the crtc to free possible outputs, then destroy the crtc */ + RRCrtcSet(pScrPriv->crtcs[pScrPriv->numCrtcs - 1], NULL, 0, 0, RR_Rotate_0, 0, NULL); RRCrtcDestroy(pScrPriv->crtcs[pScrPriv->numCrtcs - 1]); } else @@ -3886,22 +3909,13 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) } /* delete superfluous non-NX outputs */ - for (i = pScrPriv->numOutputs - 1; i >= 0; i--) { - if (strncmp(pScrPriv->outputs[i]->name, "NX", 2)) { - #ifdef DEBUG - fprintf(stderr, "nxagentAdjustRandRXinerama: destroying output [%s]\n", pScrPriv->outputs[i]->name); - #endif - RROutputDestroy(pScrPriv->outputs[i]); - } - } + for (i = pScrPriv->numOutputs - 1; i >= 0; i--) + if (strncmp(pScrPriv->outputs[i]->name, "NX", 2)) + nxagentDropOutput(pScrPriv->outputs[i]); /* at this stage only NX outputs are left - we delete the superfluous ones */ - for (i = pScrPriv->numOutputs - 1; i >= number; i--) { - #ifdef DEBUG - fprintf(stderr, "nxagentAdjustRandRXinerama: destroying nx output [%s]\n", pScrPriv->outputs[i]->name); - #endif - RROutputDestroy(pScrPriv->outputs[i]); - } + for (i = pScrPriv->numOutputs - 1; i >= number; i--) + nxagentDropOutput(pScrPriv->outputs[i]); /* add and init outputs */ for (i = 0; i < number; i++) { -- cgit v1.2.3 From f22e873e6f141b98bfc57a5443c11a9d6b8645c3 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 8 Feb 2017 21:43:45 +0100 Subject: Screen.c: clean up superfluous whitespace --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 2f6381696..3039f4139 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -3812,7 +3812,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) */ if (number == 0) { #ifdef DEBUG - fprintf(stderr, "nxagentAdjustRandRXinerama: faking xinerama\n" ); + fprintf(stderr, "nxagentAdjustRandRXinerama: faking xinerama\n"); #endif number = 1; @@ -3934,7 +3934,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) output = pScrPriv->outputs[i]; } #ifdef DEBUG - fprintf(stderr, "nxagentAdjustRandRXinerama: adjusting output [%s]\n", pScrPriv->outputs[i]->name); + fprintf(stderr, "nxagentAdjustRandRXinerama: adjusting output [%s]\n", pScrPriv->outputs[i]->name); #endif RROutputSetCrtcs(output, &(pScrPriv->crtcs[i]), 1); /* FIXME: Isn't there a function for setting this? */ @@ -3945,7 +3945,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) RROutputSetPhysicalSize(output, 0, 0); } - for (i = 0; i < pScrPriv->numOutputs; i++ ) { + for (i = 0; i < pScrPriv->numOutputs; i++) { Bool disable_output = FALSE; RRModePtr mymode, prevmode; int new_x, new_y; @@ -4089,7 +4089,6 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) /* throw away the mode if otherwise unused. We do not need it anymore. We call FreeResource() to ensure the system will not try to free it again on shutdown */ - if (prevmode && prevmode->refcnt == 1) { #ifdef DEBUG fprintf(stderr, "nxagentAdjustRandRXinerama: destroying prevmode [%s]\n", prevmode->name); -- cgit v1.2.3 From 0f9a11a94b5fb52b5f1f9c79a93c54fc6396cab8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 18:41:52 +0100 Subject: drop platform support: unifdef __UNIXOS2__. Fixes ArcticaProject/nx-libs#271. --- nx-X11/programs/Xserver/Imakefile | 2 +- nx-X11/programs/Xserver/Xext/security.c | 20 -- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 7 - nx-X11/programs/Xserver/hw/nxagent/os2Stub.c | 410 --------------------------- nx-X11/programs/Xserver/include/os.h | 2 +- nx-X11/programs/Xserver/include/servermd.h | 2 - nx-X11/programs/Xserver/os/WaitFor.c | 3 - nx-X11/programs/Xserver/os/access.c | 7 - nx-X11/programs/Xserver/os/connection.c | 29 +- nx-X11/programs/Xserver/os/io.c | 6 +- nx-X11/programs/Xserver/os/log.c | 3 - nx-X11/programs/Xserver/os/oscolor.c | 11 - nx-X11/programs/Xserver/os/osdep.h | 2 +- nx-X11/programs/Xserver/os/osinit.c | 2 +- nx-X11/programs/Xserver/os/utils.c | 26 +- nx-X11/programs/Xserver/xkb/ddxConfig.c | 3 - nx-X11/programs/Xserver/xkb/ddxLoad.c | 36 +-- nx-X11/programs/Xserver/xkb/xkbInit.c | 2 +- 18 files changed, 12 insertions(+), 561 deletions(-) delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/os2Stub.c (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 8efbcf14a..9a7462c7a 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -523,7 +523,7 @@ SUBDIRS = $(STDDIRS) \ $(IPLANDIRS) $(ILBMDIR) \ $(DDXDIRS) $(FBSUBDIR) $(KDRIVEDIRS) $(MIEXTDIRS) -#if defined(ServerToInstall) && !defined(OS2Architecture) +#if defined(ServerToInstall) install:: -(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) ServerToInstall X) #endif diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 6883db5f8..3a638460e 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -1481,11 +1481,7 @@ SecurityFreePropertyAccessList(void) } } /* SecurityFreePropertyAccessList */ -#ifndef __UNIXOS2__ #define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') ) -#else -#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') ) -#endif static char * SecuritySkipWhitespace( @@ -1774,8 +1770,6 @@ SecurityLoadPropertyAccessList(void) #endif -#ifndef __UNIXOS2__ - #ifdef NXAGENT_SERVER f = Fopen(_NXGetPolicyFilePath(SecurityPolicyFile), "r"); @@ -1786,20 +1780,6 @@ SecurityLoadPropertyAccessList(void) #endif -#else - -#ifdef NXAGENT_SERVER - - f = Fopen((char*)__XOS2RedirRoot( _NXGetPolicyFilePath(SecurityPolicyFile)), "r"); - -#else - - f = Fopen((char*)__XOS2RedirRoot(SecurityPolicyFile), "r"); - -#endif - -#endif - if (!f) { #ifdef NXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 7dbcce896..f849c3e5a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -6,11 +6,6 @@ NULL = SUBDIRS = compext \ $(NULL) -#ifdef OS2Architecture -SRCS1 = os2Stub.c -OBJS1 = os2Stub.o -#endif - SRCS = \ NXwindow.c \ NXevents.c \ @@ -71,7 +66,6 @@ SRCS = \ stubs.c \ xpstubs.c \ miinitext.c \ - $(SRCS1) \ $(NULL) OBJS = \ @@ -134,7 +128,6 @@ OBJS = \ stubs.o \ xpstubs.o \ miinitext.o \ - $(OBJS1) \ $(NULL) VFBINCLUDES = \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c b/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c deleted file mode 100644 index 226140dc5..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c +++ /dev/null @@ -1,410 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -/* - * (c) Copyright 1996 by Sebastien Marineau - * - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the name of Sebastien Marineau shall not be - * used in advertising or otherwise to promote the sale, use or other dealings - * in this Software without prior written authorization from Sebastien Marineau. - * - */ - -/* This below implements select() for calls in nxagent. It has been */ -/* somewhat optimized for improved performance, but assumes a few */ -/* things so it cannot be used as a general select. */ - -#define I_NEED_OS2_H -#include "Xpoll.h" -#include -#include -#include -#include -#define INCL_DOSSEMAPHORES -#define INCL_DOSNPIPES -#define INCL_DOSMISC -#define INCL_DOSMODULEMGR -#undef BOOL -#undef BYTE -#include - -HEV hPipeSem; -HMODULE hmod_so32dll; -static int (*os2_tcp_select)(int*,int,int,int,long); -ULONG os2_get_sys_millis(); -extern int _files[]; - -#define MAX_TCP 256 -/* These lifted from sys/emx.h. Change if that changes there! */ -#define F_SOCKET 0x10000000 -#define F_PIPE 0x20000000 - -struct select_data -{ - fd_set read_copy; - fd_set write_copy; - BOOL have_read; - BOOL have_write; - int tcp_select_mask[MAX_TCP]; - int tcp_emx_handles[MAX_TCP]; - int tcp_select_copy[MAX_TCP]; - int socket_nread; - int socket_nwrite; - int socket_ntotal; - int pipe_ntotal; - int pipe_have_write; - int max_fds; -}; - -int os2PseudoSelect(int nfds, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout) -{ -static BOOL FirstTime=TRUE; -static haveTCPIP=TRUE; -ULONG timeout_ms; -ULONG postCount, start_millis,now_millis; -char faildata[16]; -struct select_data sd; -BOOL any_ready; -int np,ns, i,ready_handles,n; -APIRET rc; - -sd.have_read=FALSE; sd.have_write=FALSE; -sd.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0; -sd.max_fds=31; ready_handles=0; any_ready=FALSE; -sd.pipe_ntotal=0; sd.pipe_have_write=FALSE; - -if(FirstTime){ - /* First load the so32dll.dll module and get a pointer to the SELECT function */ - - if((rc=DosLoadModule(faildata,sizeof(faildata),"SO32DLL",&hmod_so32dll))!=0){ - fprintf(stderr, "Could not load module so32dll.dll, rc = %d. Error note %s\n",rc,faildata); - haveTCPIP=FALSE; - } - if((rc = DosQueryProcAddr(hmod_so32dll, 0, "SELECT", (PPFN)&os2_tcp_select))!=0){ - fprintf(stderr, "Could not query address of SELECT, rc = %d.\n",rc); - haveTCPIP=FALSE; - } - /* Call these a first time to set the semaphore */ - /* rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE); - if(rc) { - fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc); - return(-1); - } - rc = DosResetEventSem(hPipeSem, &postCount); */ /* Done in xtrans code for servers*/ - -fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem); - - FirstTime = FALSE; -} - -/* Set up the time delay structs */ - - if(timeout!=NULL) { - timeout_ms=timeout->tv_sec*1000+timeout->tv_usec/1000; - } - else { timeout_ms=1000000; } /* This should be large enough... */ - if(timeout_ms>0) start_millis=os2_get_sys_millis(); - -/* Copy the masks */ - {FD_ZERO(&sd.read_copy);} - {FD_ZERO(&sd.write_copy);} - if(readfds!=NULL){ XFD_COPYSET(readfds,&sd.read_copy); sd.have_read=TRUE;} - if(writefds!=NULL) {XFD_COPYSET(writefds,&sd.write_copy);sd.have_write=TRUE;} - -/* And zero the original masks */ - if(sd.have_read){ FD_ZERO(readfds);} - if(sd.have_write) {FD_ZERO(writefds);} - if(exceptfds != NULL) {FD_ZERO(exceptfds);} - -/* Now we parse the fd_sets passed to select and separate pipe/sockets */ - n = os2_parse_select(&sd,nfds); - if(n == -1) { - errno = EBADF; - return (-1); - } - -/* Now we have three cases: either we have sockets, pipes, or both */ -/* We handle all three cases differently to optimize things */ - -/* Case 1: only pipes! */ - if((sd.pipe_ntotal >0) && (!sd.socket_ntotal)){ - np = os2_check_pipes(&sd,readfds,writefds); - if(np > 0){ - return (np); - } - else if (np == -1) { return(-1); } - while(!any_ready){ - rc = DosWaitEventSem(hPipeSem, timeout_ms); - /* if(rc) fprintf(stderr,"Sem-wait timeout, rc = %d\n",rc); */ - if(rc == 640) { - return(0); - } - if((rc != 0) && (rc != 95)) {errno= EBADF; return(-1);} - np = os2_check_pipes(&sd,readfds,writefds); - if (np > 0){ - return(np); - } - else if (np < 0){ return(-1); } - } - } - -/* Case 2: only sockets. Just let the os/2 tcp select do the work */ - if((sd.socket_ntotal > 0) && (!sd.pipe_ntotal)){ - ns = os2_check_sockets(&sd, readfds, writefds, timeout_ms); - return (ns); - } - -/* Case 3: combination of both */ - if((sd.socket_ntotal > 0) && (sd.pipe_ntotal)){ - np = os2_check_pipes(&sd,readfds,writefds); - if(np > 0){ - any_ready=TRUE; - ready_handles += np; - } - else if (np == -1) { return(-1); } - - ns = os2_check_sockets(&sd,readfds,writefds, 0); - if(ns>0){ - ready_handles+=ns; - any_ready = TRUE; - } - else if (ns == -1) {return(-1);} - - while (!any_ready && timeout_ms){ - - rc = DosWaitEventSem(hPipeSem, 10L); - if(rc == 0){ - np = os2_check_pipes(&sd,readfds,writefds); - if(np > 0){ - ready_handles+=np; - any_ready = TRUE; - } - else if (np == -1) { - return(-1); } - } - - ns = os2_check_sockets(&sd,readfds,writefds,exceptfds, 0); - if(ns>0){ - ready_handles+=ns; - any_ready = TRUE; - } - else if (ns == -1) {return(-1);} - - if (i%8 == 0) { - now_millis = os2_get_sys_millis(); - if((now_millis-start_millis) > timeout_ms) timeout_ms = 0; - } - i++; - } - } - -return(ready_handles); -} - - -ULONG os2_get_sys_millis() -{ - APIRET rc; - ULONG milli; - - rc = DosQuerySysInfo(14, 14, &milli, sizeof(milli)); - if(rc) { - fprintf(stderr,"Bad return code querying the millisecond counter! rc=%d\n",rc); - return(0); - } - return(milli); -} - -int os2_parse_select(sd,nfds) -struct select_data *sd; -int nfds; -{ - int i; - APIRET rc; -/* First we determine up to which descriptor we need to check. */ -/* No need to check up to 256 if we don't have to (and usually we dont...)*/ -/* Note: stuff here is hardcoded for fd_sets which are int[8] as in EMX! */ - - if(nfds > sd->max_fds){ - for(i=0;i<((FD_SETSIZE+31)/32);i++){ - if(sd->read_copy.fds_bits[i] || - sd->write_copy.fds_bits[i]) - sd->max_fds=(i*32) +32; - } - } - else { sd->max_fds = nfds; } -/* Check if result is greater than specified in select() call */ - if(sd->max_fds > nfds) sd->max_fds = nfds; - - if (sd->have_read) - { - for (i = 0; i < sd->max_fds; ++i) { - if (FD_ISSET (i, &sd->read_copy)){ - if(_files[i] & F_SOCKET) - { - sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i); - sd->tcp_emx_handles[sd->socket_ntotal]=i; - sd->socket_ntotal++; sd->socket_nread++; - } - else if (_files[i] & F_PIPE) - { - sd -> pipe_ntotal++; - /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i); - if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */ - } - } - } - } - - if (sd->have_write) - { - for (i = 0; i < sd->max_fds; ++i) { - if (FD_ISSET (i, &sd->write_copy)){ - if(_files[i] & F_SOCKET) - { - sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i); - sd->tcp_emx_handles[sd->socket_ntotal]=i; - sd->socket_ntotal++; sd->socket_nwrite++; - } - else if (_files[i] & F_PIPE) - { - sd -> pipe_ntotal++; - /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i); - if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */ - sd -> pipe_have_write=TRUE; - } - } - } - } - - -return(sd->socket_ntotal); -} - - -int os2_check_sockets(sd,readfds,writefds) -struct select_data *sd; -fd_set *readfds,*writefds; -{ - int e,i; - int j,n; - memcpy(sd->tcp_select_copy,sd->tcp_select_mask, - sd->socket_ntotal*sizeof(int)); - - e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread, - sd->socket_nwrite, 0, 0); - - if(e == 0) return(e); -/* We have something ready? */ - if(e>0){ - j = 0; n = 0; - for (i = 0; i < sd->socket_nread; ++i, ++j) - if (sd->tcp_select_copy[j] != -1) - { - FD_SET (sd->tcp_emx_handles[j], readfds); - n ++; - } - for (i = 0; i < sd->socket_nwrite; ++i, ++j) - if (sd->tcp_select_copy[j] != -1) - { - FD_SET (sd->tcp_emx_handles[j], writefds); - n ++; - } - errno = 0; - - return n; - } - if(e<0){ - /*Error -- TODO. EBADF is a good choice for now. */ - fprintf(stderr,"Error in server select! e=%d\n",e); - errno = EBADF; - return (-1); - } - } - -/* Check to see if anything is ready on pipes */ - -int os2_check_pipes(sd,readfds,writefds) -struct select_data *sd; -fd_set *readfds,*writefds; -{ -int i,e; -ULONG ulPostCount; -PIPESEMSTATE pipeSemState[128]; -APIRET rc; - e = 0; - rc = DosResetEventSem(hPipeSem,&ulPostCount); - rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState, - sizeof(pipeSemState)); - if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc); - i=0; - while (pipeSemState[i].fStatus != 0) { - /*fprintf(stderr,"SELECT: sem entry, stat=%d, flag=%d, key=%d,avail=%d\n", - pipeSemState[i].fStatus,pipeSemState[i].fFlag,pipeSemState[i].usKey, - pipeSemState[i].usAvail); */ - if((pipeSemState[i].fStatus == 1) && - (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy))){ - FD_SET(pipeSemState[i].usKey,readfds); - e++; - } - else if((pipeSemState[i].fStatus == 2) && - (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy))){ - FD_SET(pipeSemState[i].usKey,writefds); - e++; - } - else if( (pipeSemState[i].fStatus == 3) && - ( (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy)) || - (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy)) )){ - errno = EBADF; - /* fprintf(stderr,"Pipe has closed down, fd=%d\n",pipeSemState[i].usKey); */ - return (-1); - } - i++; - } /* endwhile */ - /*fprintf(stderr,"Done listing pipe sem entries, total %d entries, total ready entries %d\n" i,e);*/ -errno = 0; -return(e); -} - diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 268513bfd..881abfccb 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -263,7 +263,7 @@ void OsBlockSignals (void); void OsReleaseSignals (void); -#if !defined(WIN32) && !defined(__UNIXOS2__) +#if !defined(WIN32) extern int System(char *); extern void * Popen(char *, char *); extern int Pclose(void *); diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index 27b5a8fb9..76f28e9ed 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -327,8 +327,6 @@ SOFTWARE. #if (defined(SVR4) && defined(i386)) || \ defined(__alpha__) || defined(__alpha) || \ defined(__i386__) || defined(__i386) || \ - defined(__UNIXOS2__) || \ - defined(__OS2ELF__) || \ defined(__QNX__) || \ defined(__s390x__) || defined(__s390__) diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 2858637fa..899b1de0b 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -91,9 +91,6 @@ SOFTWARE. #include #include "misc.h" -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -#endif #include "osdep.h" #include #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 5735fd556..c775952e2 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -1139,9 +1139,6 @@ ResetHosts (char *display) if (fnamelen > sizeof(fname)) FatalError("Display name `%s' is too long\n", display); sprintf(fname, ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, display); -#ifdef __UNIXOS2__ - strcpy(fname, (char*)__XOS2RedirRoot(fname)); -#endif /* __UNIXOS2__ */ if ((fd = fopen (fname, "r")) != 0) { @@ -1152,10 +1149,6 @@ ResetHosts (char *display) continue; if ((ptr = strchr(ohostname, '\n')) != 0) *ptr = 0; -#ifdef __UNIXOS2__ - if ((ptr = strchr(ohostname, '\r')) != 0) - *ptr = 0; -#endif hostlen = strlen(ohostname) + 1; for (i = 0; i < hostlen; i++) lhostname[i] = tolower(ohostname[i]); diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 9681ced38..e38e94c67 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -107,11 +107,6 @@ SOFTWARE. #include #endif -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -extern __const__ int _nfiles; -#endif - #if defined(TCPCONN) # include # include @@ -124,21 +119,17 @@ extern __const__ int _nfiles; # ifdef CSRG_BASED # include # endif -# ifndef __UNIXOS2__ -# include -# endif +# include # endif # endif # include #endif -#if !defined(__UNIXOS2__) #ifndef Lynx #include #else #include #endif -#endif #endif /* WIN32 */ #include "misc.h" #include "osdep.h" @@ -173,9 +164,6 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; -#ifdef __UNIXOS2__ -Pid_t GetPPID(Pid_t pid); -#endif static Bool debug_conns = FALSE; @@ -314,8 +302,6 @@ InitConnectionLimits(void) #ifndef __CYGWIN__ -#ifndef __UNIXOS2__ - #if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) lastfdesc = sysconf(_SC_OPEN_MAX) - 1; #endif @@ -330,10 +316,6 @@ InitConnectionLimits(void) lastfdesc = _NFILE - 1; #endif -#else /* __UNIXOS2__ */ - lastfdesc = _nfiles - 1; -#endif - #endif /* __CYGWIN__ */ /* This is the fallback */ @@ -449,15 +431,6 @@ CreateWellKnownSockets(void) RunFromSmartParent = TRUE; OsSignal(SIGUSR1, handler); ParentProcess = getppid (); -#ifdef __UNIXOS2__ - /* - * fg030505: under OS/2, xinit is not the parent process but - * the "grant parent" process of the server because execvpe() - * presents us an additional process number; - * GetPPID(pid) is part of libemxfix - */ - ParentProcess = GetPPID (ParentProcess); -#endif /* __UNIXOS2__ */ if (RunFromSmartParent) { if (ParentProcess > 1) { kill (ParentProcess, SIGUSR1); diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index d184a981c..8439a3edd 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -70,7 +70,7 @@ SOFTWARE. #include #include #include -#if !defined(__UNIXOS2__) && !defined(WIN32) +#if !defined(WIN32) #ifndef Lynx #include #else @@ -92,7 +92,6 @@ CallbackListPtr FlushCallback; /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ -#ifndef __UNIXOS2__ #ifndef WIN32 #if defined(EAGAIN) && defined(EWOULDBLOCK) #define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) @@ -106,9 +105,6 @@ CallbackListPtr FlushCallback; #else /* WIN32 The socket errorcodes differ from the normal errors*/ #define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) #endif -#else /* __UNIXOS2__ Writing to full pipes may return ENOSPC */ -#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK || err == ENOSPC) -#endif Bool CriticalOutputPending; int timesThisConnection = 0; diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index e964896d7..d82f545a0 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -214,9 +214,6 @@ LogInit(const char *fname, const char *backup) sprintf(suffix, backup, display); sprintf(oldLog, "%s%s", logFileName, suffix); free(suffix); -#ifdef __UNIXOS2__ - remove(oldLog); -#endif if (rename(logFileName, oldLog) == -1) { FatalError("Cannot move old log file (\"%s\" to \"%s\"\n", logFileName, oldLog); diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c index 32f8a4b23..88b243d65 100644 --- a/nx-X11/programs/Xserver/os/oscolor.c +++ b/nx-X11/programs/Xserver/os/oscolor.c @@ -397,7 +397,6 @@ OsInitColors(void) if (!was_here) { -#ifndef __UNIXOS2__ #ifdef NX_TRANS_SOCKET /* * Add the trailing '.txt' if a @@ -417,12 +416,6 @@ OsInitColors(void) path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); strcpy(path, rgbPath); strcat(path, ".txt"); -#endif -#else - char *tmp = (char*)__XOS2RedirRoot(rgbPath); - path = (char*)ALLOCATE_LOCAL(strlen(tmp) +5); - strcpy(path, tmp); - strcat(path, ".txt"); #endif if (!(rgb = fopen(path, "r"))) { @@ -438,11 +431,7 @@ OsInitColors(void) while(fgets(line, sizeof(line), rgb)) { lineno++; -#ifndef __UNIXOS2__ if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) -#else - if (sscanf(line,"%d %d %d %[^\n\r]\n", &red, &green, &blue, name) == 4) -#endif { if (red >= 0 && red <= 0xff && green >= 0 && green <= 0xff && diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index 9ad267a36..3215b017e 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -91,7 +91,7 @@ SOFTWARE. #if defined(NOFILE) && !defined(NOFILES_MAX) #define OPEN_MAX NOFILE #else -#if !defined(__UNIXOS2__) && !defined(WIN32) +#if !defined(WIN32) #define OPEN_MAX NOFILES_MAX #else #define OPEN_MAX 256 diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 5f097f89a..81429a462 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -133,7 +133,7 @@ OsInit(void) dup2 (fileno (err), 2); fclose (err); } -#if defined(SYSV) || defined(SVR4) || defined(__UNIXOS2__) || defined(WIN32) || defined(__CYGWIN__) +#if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__) { static char buf[BUFSIZ]; setvbuf (stderr, buf, _IOLBF, BUFSIZ); diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 9584dadd3..fca5ae2fd 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -318,9 +318,7 @@ OsSignal(sig, handler) * server at a time. This keeps the servers from stomping on each other * if the user forgets to give them different display numbers. */ -#ifndef __UNIXOS2__ #define LOCK_DIR "/tmp" -#endif #define LOCK_TMP_PREFIX "/.tX" #define LOCK_PREFIX "/.X" #define LOCK_SUFFIX "-lock" @@ -330,10 +328,6 @@ OsSignal(sig, handler) #include #endif -#ifdef __UNIXOS2__ -#define link rename -#endif - #ifndef PATH_MAX #ifndef Lynx #include @@ -372,14 +366,7 @@ LockServer(void) /* * Path names */ -#ifndef __UNIXOS2__ tmppath = LOCK_DIR; -#else - /* OS/2 uses TMP directory, must also prepare for 8.3 names */ - tmppath = getenv("TMP"); - if (!tmppath) - FatalError("No TMP dir found\n"); -#endif sprintf(port, "%d", atoi(display)); len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) : @@ -422,12 +409,10 @@ LockServer(void) if (write(lfd, pid_str, 11) != 11) FatalError("Could not write pid to lock file in %s\n", tmp); -#ifndef __UNIXOS2__ #ifndef USE_CHMOD (void) fchmod(lfd, 0444); #else (void) chmod(tmp, 0444); -#endif #endif (void) close(lfd); @@ -507,9 +492,6 @@ UnlockServer(void) if (!StillLocking){ -#ifdef __UNIXOS2__ - (void) chmod(LockFile,S_IREAD|S_IWRITE); -#endif /* __UNIXOS2__ */ (void) unlink(LockFile); } } @@ -928,7 +910,7 @@ ProcessCommandLine(int argc, char *argv[]) #ifdef SERVER_LOCK else if ( strcmp ( argv[i], "-nolock") == 0) { -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) +#if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != 0) ErrorF("Warning: the -nolock option can only be used by root\n"); else @@ -1260,7 +1242,7 @@ ExpandCommandLine(int *pargc, char ***pargv) { int i; -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) +#if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != geteuid()) return; #endif @@ -1609,7 +1591,7 @@ OsReleaseSignals (void) #endif } -#if !defined(WIN32) && !defined(__UNIXOS2__) +#if !defined(WIN32) /* * "safer" versions of system(3), popen(3) and pclose(3) which give up * all privs before running a command. @@ -1964,7 +1946,7 @@ Fclose(void * iop) #endif } -#endif /* !WIN32 && !__UNIXOS2__ */ +#endif /* !WIN32 */ /* diff --git a/nx-X11/programs/Xserver/xkb/ddxConfig.c b/nx-X11/programs/Xserver/xkb/ddxConfig.c index 1ecabd108..2fd5e7610 100644 --- a/nx-X11/programs/Xserver/xkb/ddxConfig.c +++ b/nx-X11/programs/Xserver/xkb/ddxConfig.c @@ -128,9 +128,6 @@ XkbConfigRtrnPtr rtrn; sprintf(buf,"X%s-config%s%s",display,(dName[0]?".":""),dName); } #endif -#ifdef __UNIXOS2__ - strcpy(buf,(char*)__XOS2RedirRoot(buf)); -#endif #ifdef DEBUG ErrorF("Looking for keyboard configuration in %s...",buf); #endif diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index 53bae44df..89f777d58 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -82,7 +82,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" #define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" -#if defined(__UNIXOS2__) || defined(WIN32) +#if defined(WIN32) #define PATHSEPARATOR "\\" #else #define PATHSEPARATOR "/" @@ -558,8 +558,6 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; #endif -#ifndef __UNIXOS2__ - #ifdef NXAGENT_SERVER char *xkbbasedir = _NXGetXkbBasePath(XkbBaseDirectory); char *xkbbindir = _NXGetXkbCompPath(XkbBinDirectory); @@ -568,23 +566,6 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; char *xkbbindir = XkbBinDirectory; #endif -#else - /* relocate the basedir and replace the slashes with backslashes */ -#ifdef NXAGENT_SERVER - char *xkbbasedir = (char*)__XOS2RedirRoot(_NXGetXkbBasePath(XkbBaseDirectory)); - char *xkbbindir = (char*)__XOS2RedirRoot(_NXGetXkbCompPath(XkbBinDirectory)); -#else - char *xkbbasedir = (char*)__XOS2RedirRoot(XkbBaseDirectory); - char *xkbbindir = (char*)__XOS2RedirRoot(XkbBinDirectory); -#endif - int i; - - for (i=0; i10)?10:(int)xkbDebugFlags)), @@ -675,7 +656,6 @@ char tmpname[PATH_MAX]; for xkbcomp. xkbcomp does not read from stdin. */ char *xkmfile = tmpname; #endif -#ifndef __UNIXOS2__ #ifdef NXAGENT_SERVER char *xkbbasedir = _NXGetXkbBasePath(XkbBaseDirectory); char *xkbbindir = _NXGetXkbCompPath(XkbBinDirectory); @@ -683,20 +663,6 @@ char tmpname[PATH_MAX]; char *xkbbasedir = XkbBaseDirectory; char *xkbbindir = XkbBinDirectory; #endif -#else - int i; -#ifdef NXAGENT_SERVER - char *xkbbasedir = (char*)__XOS2RedirRoot(_NXGetXkbBasePath(XkbBaseDirectory)); - char *xkbbindir = (char*)__XOS2RedirRoot(_NXGetXkbCompPath(XkbBinDirectory)); -#else - char *xkbbasedir = (char*)__XOS2RedirRoot(XkbBaseDirectory); - char *xkbbindir = (char*)__XOS2RedirRoot(XkbBinDirectory); -#endif - for (i=0; i Date: Tue, 15 Nov 2016 19:20:13 +0100 Subject: drop platform support: unifdef Lynx. Fixes ArcticaProject/nx-libs#272. --- nx-X11/programs/Xserver/Imakefile | 5 ++--- nx-X11/programs/Xserver/Xext/shm.c | 5 ----- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/Xext/xvmc.c | 5 ----- nx-X11/programs/Xserver/include/servermd.h | 5 ----- nx-X11/programs/Xserver/os/access.c | 8 -------- nx-X11/programs/Xserver/os/connection.c | 8 -------- nx-X11/programs/Xserver/os/io.c | 4 ---- nx-X11/programs/Xserver/os/osinit.c | 4 ++-- nx-X11/programs/Xserver/os/utils.c | 6 +----- nx-X11/programs/Xserver/os/xdmcp.c | 4 ---- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 2 +- 12 files changed, 7 insertions(+), 51 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 9a7462c7a..d13b6b79d 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -248,8 +248,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXmiexpose.o \ hw/nxagent/NXresource.o \ hw/nxagent/NXdamage.o -#elif !defined(LynxOSArchitecture) && \ - !defined(Win32Architecture) && \ +#elif !defined(Win32Architecture) && \ !defined(QNX4Architecture) NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXwindow.o \ @@ -516,7 +515,7 @@ ServerTarget(NXWin,$(NXWINDIRS),$(NXWINOBJS), \ MIEXTDIRS = $(SHADOWDIR) $(LAYERDIR) $(ROOTLESSDIR) $(MIDAMAGEDIR) IPLANDIRS = $(IPLAN2P2DIR) $(IPLAN2P4DIR) $(IPLAN2P8DIR) -DDXDIRS = $(DECWSDDXDIR) $(SUNDDXDIR) $(LYNXDDXDIR) \ +DDXDIRS = $(DECWSDDXDIR) $(SUNDDXDIR) \ $(HPDDXDIR) $(XFREE86DDXDIR) \ $(NXAGENTDDXDIR) $(NXWINDDXDIR) SUBDIRS = $(STDDIRS) \ diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index c70f52b6a..dc8bbf97b 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -34,13 +34,8 @@ in this Software without prior written authorization from The Open Group. #endif #include -#ifndef Lynx #include #include -#else -#include -#include -#endif #include #include #include diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 4f24d5b54..e1580b3a3 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -71,7 +71,7 @@ PERFORMANCE OF THIS SOFTWARE. #include "protocol-versions.h" #include -#if !defined(WIN32) && !defined(Lynx) +#if !defined(WIN32) #include #endif diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index 710101d07..0a43baa22 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -22,14 +22,9 @@ #include "xvmcext.h" #ifdef HAS_XVMCSHM -#ifndef Lynx #include #include #include -#else -#include -#include -#endif /* Lynx */ #endif /* HAS_XVMCSHM */ diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index 76f28e9ed..4f2dc27f8 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -128,11 +128,6 @@ SOFTWARE. #define BITMAP_BIT_ORDER MSBFirst #define GLYPHPADBYTES 4 -/* XXX Should this be for Lynx only? */ -#ifdef Lynx -#define BITMAP_SCANLINE_UNIT 8 -#endif - #endif /* PowerPC */ #if defined(__sh__) diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index c775952e2..286e978ba 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -76,11 +76,7 @@ SOFTWARE. #include #include #ifndef WIN32 -#ifndef Lynx #include -#else -#include -#endif #include #include @@ -173,11 +169,7 @@ SOFTWARE. #endif /* WIN32 */ #ifndef PATH_MAX -#ifndef Lynx #include -#else -#include -#endif #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index e38e94c67..41234e231 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -80,11 +80,7 @@ SOFTWARE. #include #ifndef WIN32 -#if defined(Lynx) -#include -#else #include -#endif #ifdef hpux #include @@ -125,11 +121,7 @@ SOFTWARE. # include #endif -#ifndef Lynx #include -#else -#include -#endif #endif /* WIN32 */ #include "misc.h" #include "osdep.h" diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 8439a3edd..3771d40fb 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -71,11 +71,7 @@ SOFTWARE. #include #include #if !defined(WIN32) -#ifndef Lynx #include -#else -#include -#endif #endif #include #include diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 81429a462..025fd104c 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -67,11 +67,11 @@ SOFTWARE. #endif #endif -#if defined(Lynx) || defined(__SCO__) +#if defined(__SCO__) #include #endif -#if !defined(SYSV) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4) +#if !defined(SYSV) && !defined(WIN32) && !defined(QNX4) #include #endif diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index fca5ae2fd..5070eea8d 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -113,7 +113,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #ifndef WIN32 #include #endif -#if !defined(SYSV) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4) +#if !defined(SYSV) && !defined(WIN32) && !defined(QNX4) #include #endif #include @@ -329,11 +329,7 @@ OsSignal(sig, handler) #endif #ifndef PATH_MAX -#ifndef Lynx #include -#else -#include -#endif #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index 5daf1cbbf..31f013296 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -28,12 +28,8 @@ #include #if !defined(WIN32) -#ifndef Lynx #include #include -#else -#include -#endif #include #include #endif diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index 307673db7..27e56c05a 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "inputstr.h" #include -#if !defined(WIN32) && !defined(Lynx) +#if !defined(WIN32) #include #endif -- cgit v1.2.3 From f6dcf2feb8e0f48811852de7f4148cbf7336db08 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 20:59:35 +0100 Subject: drop platform support: unifdef hpux and __hppa__. Fixes ArcticaProject/nx-libs#273. --- nx-X11/programs/Xserver/include/servermd.h | 8 -------- nx-X11/programs/Xserver/os/access.c | 8 ++++---- nx-X11/programs/Xserver/os/connection.c | 10 +++------- nx-X11/programs/Xserver/os/osdep.h | 2 +- 4 files changed, 8 insertions(+), 20 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index 4f2dc27f8..5d26c3f7d 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -114,14 +114,6 @@ SOFTWARE. #endif /* __aarch64__ */ -#if defined (hpux) || defined __hppa__ - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 /* to make fb work */ - -#endif /* hpux || __hppa__ */ - #if defined(__powerpc__) || defined(__ppc__) #define IMAGE_BYTE_ORDER MSBFirst diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 286e978ba..de81c5141 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -105,7 +105,7 @@ SOFTWARE. #endif -#if defined(hpux) || defined(QNX4) +#if defined(QNX4) # include # ifdef HAS_IFREQ # include @@ -127,7 +127,7 @@ SOFTWARE. #else /*!__GNU__*/ # include #endif /*__GNU__ */ -#endif /* hpux */ +#endif /* QNX4 */ #ifdef SVR4 #include @@ -513,7 +513,7 @@ DefineSelf (int fd) #else /* WINTCP */ -#if !defined(SIOCGIFCONF) || (defined (hpux) && ! defined (HAS_IFREQ)) || defined(QNX4) +#if !defined(SIOCGIFCONF) || defined(QNX4) void DefineSelf (int fd) { @@ -1047,7 +1047,7 @@ DefineSelf (int fd) } } } -#endif /* hpux && !HAS_IFREQ */ +#endif /* SIOCGIFCONF || QNX4 */ #endif /* WINTCP */ #ifdef XDMCP diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 41234e231..60bcc6bb8 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -82,11 +82,6 @@ SOFTWARE. #ifndef WIN32 #include -#ifdef hpux -#include -#include -#endif - #if defined(DGUX) #include #include @@ -106,7 +101,9 @@ SOFTWARE. #if defined(TCPCONN) # include # include -# if !defined(hpux) + +/* FIXME: correct indentation levels after ancient platform support clean-up */ + # ifdef apollo # ifndef NO_TCP_H # include @@ -117,7 +114,6 @@ SOFTWARE. # endif # include # endif -# endif # include #endif diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index 3215b017e..6f38a2180 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -117,7 +117,7 @@ SOFTWARE. /* MAXSELECT is the number of fds that select() can handle */ #define MAXSELECT (sizeof(fd_set) * NBBY) -#if !defined(hpux) && !defined(SVR4) && !defined(SYSV) +#if !defined(SVR4) && !defined(SYSV) #define HAS_GETDTABLESIZE #endif -- cgit v1.2.3 From cc1350acecb23325096427d1c4947bf8a787304d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 21:20:22 +0100 Subject: drop platform support: unifdef AIXV3, AIXV4 (and AIXrt, AIX386). Fixes ArcticaProject/nx-libs#274. --- nx-X11/programs/Xserver/hw/nxagent/Init.c | 5 ----- nx-X11/programs/Xserver/include/servermd.h | 9 --------- nx-X11/programs/Xserver/os/connection.c | 4 ---- nx-X11/programs/Xserver/os/utils.c | 20 -------------------- nx-X11/programs/Xserver/xkb/ddxLoad.c | 2 +- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 4 ---- 6 files changed, 1 insertion(+), 43 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index c492378a0..218766e06 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -536,11 +536,6 @@ void OsVendorEndRedirectErrorFFunction() nxagentEndRedirectToClientsLog(); } -/* this is just to get the server to link on AIX */ -#ifdef AIXV3 -int SelectWaitTime = 10000; /* usec */ -#endif - ServerGrabInfoRec nxagentGrabServerInfo; static void nxagentGrabServerCallback(CallbackListPtr *callbacks, void *data, diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index 5d26c3f7d..78d7c5672 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -159,15 +159,6 @@ SOFTWARE. #endif /* sun && !(i386 && SVR4) */ - -#if defined(AIXV3) - -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the RISC/6000 */ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 - -#endif /* AIXV3 */ - #if defined(ibm032) || defined (ibm) #ifdef i386 diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 60bcc6bb8..f2172e0ad 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -94,10 +94,6 @@ SOFTWARE. #endif -#ifdef AIXV3 -#include -#endif - #if defined(TCPCONN) # include # include diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 5070eea8d..a6a42261c 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -264,11 +264,6 @@ int auditTrailLevel = 1; Bool Must_have_memory = FALSE; -#ifdef AIXV3 -int SyncOn = 0; -extern int SelectWaitTime; -#endif - #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) #define HAS_SAVED_IDS_AND_SETEUID #endif @@ -571,7 +566,6 @@ AdjustWaitForDelay (void * waitTime, unsigned long newdelay) void UseMsg(void) { -#if !defined(AIXrt) && !defined(AIX386) ErrorF("use: X [:] [option]\n"); ErrorF("-a # mouse acceleration (pixels)\n"); ErrorF("-ac disable access control restrictions\n"); @@ -664,7 +658,6 @@ void UseMsg(void) #ifdef XDMCP XdmcpUseMsg(); #endif -#endif /* !AIXrt && ! AIX386 */ #ifdef XKB XkbUseMsg(); #endif @@ -1062,19 +1055,6 @@ ProcessCommandLine(int argc, char *argv[]) i = skip - 1; } #endif -#ifdef AIXV3 - else if ( strcmp( argv[i], "-timeout") == 0) - { - if(++i < argc) - SelectWaitTime = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-sync") == 0) - { - SyncOn++; - } -#endif #ifdef SMART_SCHEDULE else if ( strcmp( argv[i], "-dumbSched") == 0) { diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index 89f777d58..d7b2314c3 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -53,7 +53,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "xkb.h" -#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) || defined(__GNU__) +#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(__osf__) || defined(__GNU__) #include #endif diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index 27e56c05a..a358c6293 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -360,9 +360,7 @@ XkbControlsPtr ctrls; if (keybd->kbdfeed->ctrl.autoRepeat && ((xkbi->slowKey != xkbi->mouseKey) || (!xkbi->mouseKeysAccel)) && (ctrls->enabled_ctrls&XkbRepeatKeysMask)) { -#ifndef AIXV3 if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,xkbi->slowKey)) -#endif { xkbi->repeatKey = xkbi->slowKey; xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer, @@ -529,9 +527,7 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key); if ((keybd->kbdfeed->ctrl.autoRepeat) && ((ctrls->enabled_ctrls&(XkbSlowKeysMask|XkbRepeatKeysMask))== XkbRepeatKeysMask)) { -#ifndef AIXV3 if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key)) -#endif { #ifdef DEBUG if (xkbDebugFlags&0x10) -- cgit v1.2.3 From 0a9f9a9511d80defd4835c9d19476e324bbd674d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 21:32:46 +0100 Subject: drop platform support: unifdef __osf__. Fixes ArcticaProject/nx-libs#288. --- nx-X11/programs/Xserver/xkb/ddxBeep.c | 29 ----------------------------- nx-X11/programs/Xserver/xkb/ddxLoad.c | 2 +- nx-X11/programs/Xserver/xkb/xkbInit.c | 2 +- nx-X11/programs/Xserver/xkb/xkbUtils.c | 4 ---- 4 files changed, 2 insertions(+), 35 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/xkb/ddxBeep.c b/nx-X11/programs/Xserver/xkb/ddxBeep.c index e4427ba26..fa4af7456 100644 --- a/nx-X11/programs/Xserver/xkb/ddxBeep.c +++ b/nx-X11/programs/Xserver/xkb/ddxBeep.c @@ -38,12 +38,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#if (defined(__osf__) && defined(__alpha)) -#include -#include -#include -#endif - /*#define FALLING_TONE 1*/ /*#define RISING_TONE 1*/ #define FALLING_TONE 10 @@ -115,31 +109,8 @@ _XkbDDXBeepInitAtoms(void) stickyLock= MAKE_ATOM(STICKY_LOCK); stickyUnlock= MAKE_ATOM(STICKY_UNLOCK); bounceReject= MAKE_ATOM(BOUNCE_REJECT); -#if (defined(__osf__) && defined(__alpha)) - /* [[[ WDW - Some bells do not allow for pitch changes. - * Maybe this could become part of the keymap? ]]] - */ - { - char keyboard[8]; - - /* Find the class of keyboard being used. - */ - keyboard[0] = '\0'; - if (-1 == getsysinfo(GSI_KEYBOARD, - keyboard, sizeof(keyboard), - 0, NULL)) - keyboard[0] = '\0'; - - if ((strcmp(keyboard,"LK201") == 0) || - (strcmp(keyboard,"LK401") == 0) || - (strcmp(keyboard,"LK421") == 0) || - (strcmp(keyboard,"LK443") == 0)) - doesPitch = 0; - } -#else #if defined(sun) doesPitch = 0; -#endif #endif return; } diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index d7b2314c3..ef32a4642 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -53,7 +53,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "xkb.h" -#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(__osf__) || defined(__GNU__) +#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(__GNU__) #include #endif diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index 42e6812d7..10260bf83 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -61,7 +61,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PHYS_LEDS 0x7f #define LED_COMPOSE 8 #else -#if defined(ultrix) || defined(__osf__) || defined(__alpha) || defined(__alpha__) +#if defined(ultrix) || defined(__alpha) || defined(__alpha__) #define LED_COMPOSE 2 #define LED_CAPS 3 #define LED_SCROLL 4 diff --git a/nx-X11/programs/Xserver/xkb/xkbUtils.c b/nx-X11/programs/Xserver/xkb/xkbUtils.c index b6a845c18..f4b7db3c6 100644 --- a/nx-X11/programs/Xserver/xkb/xkbUtils.c +++ b/nx-X11/programs/Xserver/xkb/xkbUtils.c @@ -51,12 +51,8 @@ int XkbDisableLockActions = 0; /***====================================================================***/ #ifndef RETURN_SHOULD_REPEAT -#if (defined(__osf__) && defined(__alpha)) -#define RETURN_SHOULD_REPEAT 1 -#else #define RETURN_SHOULD_REPEAT 0 #endif -#endif /***====================================================================***/ -- cgit v1.2.3 From 29401f29b3e818a74eab7334046bbb37173edffc Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 21:41:57 +0100 Subject: drop platform support: unifdef DGUX. Relates to ArcticaProject/nx-libs#275. --- nx-X11/programs/Xserver/os/access.c | 20 +++----------------- nx-X11/programs/Xserver/os/connection.c | 12 ------------ nx-X11/programs/Xserver/os/rpcauth.c | 5 ----- nx-X11/programs/Xserver/os/utils.c | 10 ---------- nx-X11/programs/Xserver/os/xdmcp.c | 5 ----- 5 files changed, 3 insertions(+), 49 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index de81c5141..e45645cda 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -91,20 +91,6 @@ SOFTWARE. # endif #endif -#if defined(DGUX) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - - #if defined(QNX4) # include # ifdef HAS_IFREQ @@ -307,7 +293,7 @@ AccessUsingXdmcp (void) } -#if ((defined(SVR4) && !defined(DGUX) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ @@ -356,9 +342,9 @@ ifioctl (int fd, int cmd, char *arg) #endif return(ret); } -#else /* Case DGUX, sun, SCO325 NCR and others */ +#else /* Case sun, SCO325 NCR and others */ #define ifioctl ioctl -#endif /* ((SVR4 && !DGUX !sun !SCO325 !NCR) || ISC) && SIOCGIFCONF */ +#endif /* ((SVR4 && !sun !SCO325 !NCR) || ISC) && SIOCGIFCONF */ /* * DefineSelf (fd): diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index f2172e0ad..458daab54 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -82,18 +82,6 @@ SOFTWARE. #ifndef WIN32 #include -#if defined(DGUX) -#include -#include -#include -#include -#include -#include -#include -#include -#endif - - #if defined(TCPCONN) # include # include diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c index 2a6874f4a..678bedf6c 100644 --- a/nx-X11/programs/Xserver/os/rpcauth.c +++ b/nx-X11/programs/Xserver/os/rpcauth.c @@ -51,11 +51,6 @@ from The Open Group. extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #endif -#if defined(DGUX) -#include -#include -#endif /* DGUX */ - #ifdef ultrix #include #include diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index a6a42261c..540de2835 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -124,11 +124,6 @@ OR PERFORMANCE OF THIS SOFTWARE. #include #include -#if defined(DGUX) -#include -#include -#endif - #include /* for malloc() */ #if defined(TCPCONN) @@ -318,11 +313,6 @@ OsSignal(sig, handler) #define LOCK_PREFIX "/.X" #define LOCK_SUFFIX "-lock" -#if defined(DGUX) -#include -#include -#endif - #ifndef PATH_MAX #include #ifndef PATH_MAX diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index 31f013296..83e234b43 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -45,11 +45,6 @@ #include "dixstruct.h" #include "opaque.h" -#if defined(DGUX) -#include -#include -#endif - #ifndef NX_TRANS_SOCKET -- cgit v1.2.3 From 5c3776d251ec0fb9cddf1d0ac641754582dbc4d7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 21:51:55 +0100 Subject: drop platform support: unifdef QNX. Relates to ArcticaProject/nx-libs#275. --- nx-X11/programs/Xserver/Imakefile | 3 +-- nx-X11/programs/Xserver/include/servermd.h | 1 - nx-X11/programs/Xserver/mi/miarc.c | 2 +- nx-X11/programs/Xserver/mi/miinitext.c | 4 ---- nx-X11/programs/Xserver/os/access.c | 24 ++---------------------- nx-X11/programs/Xserver/os/osdep.h | 3 --- nx-X11/programs/Xserver/os/osinit.c | 2 +- nx-X11/programs/Xserver/os/utils.c | 5 +---- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 3 --- 9 files changed, 6 insertions(+), 41 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index d13b6b79d..ddce93127 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -248,8 +248,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXmiexpose.o \ hw/nxagent/NXresource.o \ hw/nxagent/NXdamage.o -#elif !defined(Win32Architecture) && \ - !defined(QNX4Architecture) +#elif !defined(Win32Architecture) NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXwindow.o \ hw/nxagent/NXevents.o \ diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index 78d7c5672..7e4412e15 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -305,7 +305,6 @@ SOFTWARE. #if (defined(SVR4) && defined(i386)) || \ defined(__alpha__) || defined(__alpha) || \ defined(__i386__) || defined(__i386) || \ - defined(__QNX__) || \ defined(__s390x__) || defined(__s390__) #ifndef IMAGE_BYTE_ORDER diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index c812673eb..ee493bc2c 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -51,7 +51,7 @@ SOFTWARE. #include #endif -#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__) \ +#if defined(_XOPEN_SOURCE) \ || (defined(sun) && defined(__SVR4)) #include #else diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c index fc64937d7..6f6d67841 100644 --- a/nx-X11/programs/Xserver/mi/miinitext.c +++ b/nx-X11/programs/Xserver/mi/miinitext.c @@ -66,10 +66,6 @@ SOFTWARE. #include "extension.h" #include "micmap.h" -#if defined(QNX4) /* sleaze for Watcom on QNX4 ... */ -#undef GLXEXT -#endif - extern Bool noTestExtensions; #ifdef BIGREQS diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index e45645cda..c04e9c7a0 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -91,12 +91,6 @@ SOFTWARE. # endif #endif -#if defined(QNX4) -# include -# ifdef HAS_IFREQ -# include -# endif -#else #if defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__GNU__) # include #endif @@ -113,7 +107,6 @@ SOFTWARE. #else /*!__GNU__*/ # include #endif /*__GNU__ */ -#endif /* QNX4 */ #ifdef SVR4 #include @@ -499,7 +492,7 @@ DefineSelf (int fd) #else /* WINTCP */ -#if !defined(SIOCGIFCONF) || defined(QNX4) +#if !defined(SIOCGIFCONF) void DefineSelf (int fd) { @@ -542,19 +535,11 @@ DefineSelf (int fd) * uname() lets me access to the whole string (it smashes release, you * see), whereas gethostname() kindly truncates it for me. */ -#ifndef QNX4 #ifndef WIN32 uname(&name); #else gethostname(name.nodename, sizeof(name.nodename)); #endif -#else - /* QNX4's uname returns node number in name.nodename, not the hostname - have to overwrite it */ - char hname[1024]; - gethostname(hname, 1024); - name.nodename = hname; -#endif hp = _XGethostbyname(name.nodename, hparams); if (hp != NULL) @@ -663,14 +648,9 @@ DefineLocalHost: p->ifr_addr.sa_len - sizeof (p->ifr_addr) : 0)) #define ifraddr_size(a) (a.sa_len) #else -#ifdef QNX4 -#define ifr_size(p) (p->ifr_addr.sa_len + IFNAMSIZ) -#define ifraddr_size(a) (a.sa_len) -#else #define ifr_size(p) (sizeof (ifr_type)) #define ifraddr_size(a) (sizeof (a)) #endif -#endif #if defined(DEF_SELF_DEBUG) || (defined(IPv6) && defined(AF_INET6)) #include @@ -1033,7 +1013,7 @@ DefineSelf (int fd) } } } -#endif /* SIOCGIFCONF || QNX4 */ +#endif /* !SIOCGIFCONF */ #endif /* WINTCP */ #ifdef XDMCP diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index 6f38a2180..3babab3e1 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -79,9 +79,6 @@ SOFTWARE. #endif /* X_NOT_POSIX */ #endif -#ifdef __QNX__ -#define NOFILES_MAX 256 -#endif #ifndef OPEN_MAX #ifdef SVR4 #define OPEN_MAX 256 diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 025fd104c..7aa961a56 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -71,7 +71,7 @@ SOFTWARE. #include #endif -#if !defined(SYSV) && !defined(WIN32) && !defined(QNX4) +#if !defined(SYSV) && !defined(WIN32) #include #endif diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 540de2835..6e5482fc1 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -113,7 +113,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #ifndef WIN32 #include #endif -#if !defined(SYSV) && !defined(WIN32) && !defined(QNX4) +#if !defined(SYSV) && !defined(WIN32) #include #endif #include @@ -2007,9 +2007,6 @@ CheckUserParameters(int argc, char **argv, char **envp) enum BadCode bad = NotBad; int i = 0, j; char *a, *e = NULL; -#if defined(__QNX__) && !defined(__QNXNTO__) - char cmd_name[64]; -#endif #if CHECK_EUID if (geteuid() == 0 && getuid() != geteuid()) diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index a358c6293..4069ac209 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -30,9 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#ifdef __QNX__ -#include -#endif #include #include #include -- cgit v1.2.3 From 8c1a21b4568f50a1fbbe014ee744d7130754d2ed Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 22:03:39 +0100 Subject: drop platform support: unifdef sgi. Relates to ArcticaProject/nx-libs#275. --- nx-X11/programs/Xserver/Imakefile | 2 +- nx-X11/programs/Xserver/dix/devices.c | 6 ------ nx-X11/programs/Xserver/fb/fb.h | 3 +-- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 ------ nx-X11/programs/Xserver/include/servermd.h | 10 +--------- nx-X11/programs/Xserver/mi/micoord.h | 2 +- nx-X11/programs/Xserver/os/access.c | 2 +- nx-X11/programs/Xserver/os/osdep.h | 2 -- nx-X11/programs/Xserver/os/utils.c | 7 ------- nx-X11/programs/Xserver/render/picture.h | 3 +-- nx-X11/programs/Xserver/xkb/Imakefile | 6 +----- nx-X11/programs/Xserver/xkb/ddxLoad.c | 2 +- nx-X11/programs/Xserver/xkb/xkbInit.c | 8 -------- 13 files changed, 8 insertions(+), 51 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index ddce93127..fe70d007a 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -160,7 +160,7 @@ INSTPGMFLAGS = #if HasPam && HasPamMisc PAMLIBS = PamLibraries PamMiscLibraries #endif -#if !(SystemV4 || defined(SGIArchitecture) || UseRgbTxt) +#if !(SystemV4 || UseRgbTxt) DBMLIBS = DBMLibrary #endif SYSLIBS = $(ZLIB) MathLibrary $(DBMLIBS) $(USB) \ diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 69cdc82e1..ad1788277 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -662,13 +662,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) if (!feedc) return FALSE; feedc->CtrlProc = controlProc; -#ifdef sgi - feedc->ctrl.num = 1; - feedc->ctrl.den = 1; - feedc->ctrl.threshold = 1; -#else feedc->ctrl = defaultPointerControl; -#endif feedc->ctrl.id = 0; if ( (feedc->next = dev->ptrfeed) ) feedc->ctrl.id = dev->ptrfeed->ctrl.id + 1; diff --git a/nx-X11/programs/Xserver/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index 7c33562b4..58aa8561b 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -104,8 +104,7 @@ typedef unsigned __int64 FbBits; defined(__sparc64__) || defined(_LP64) || \ defined(__s390x__) || \ defined(amd64) || defined (__amd64__) || \ - defined (__powerpc64__) || \ - (defined(sgi) && (_MIPS_SZLONG == 64)) + defined (__powerpc64__) typedef unsigned long FbBits; # else typedef unsigned long long FbBits; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 4dbb003f2..46e01c737 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -587,12 +587,6 @@ int ddxProcessArgument(int argc, char *argv[], int i) if(++i < argc) { - #ifdef sgi - - userdefinedfontpath = 1; - - #endif - #ifdef TEST fprintf(stderr, "ddxProcessArgument: User defined font path [%s].\n", argv[i]); #endif diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index 7e4412e15..04cd97bb8 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -192,7 +192,7 @@ SOFTWARE. #endif /* macII */ -#if (defined(mips) || defined(__mips)) && !defined(sgi) +#if (defined(mips) || defined(__mips)) #if defined(MIPSEL) || defined(__MIPSEL__) # define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */ @@ -344,14 +344,6 @@ SOFTWARE. #endif /* linux/m68k */ -#ifdef sgi - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 - -#endif - /* linux on the Compaq Itsy */ #if defined(linux) && defined(__arm__) #define IMAGE_BYTE_ORDER LSBFirst diff --git a/nx-X11/programs/Xserver/mi/micoord.h b/nx-X11/programs/Xserver/mi/micoord.h index b3d725b73..3e45cfede 100644 --- a/nx-X11/programs/Xserver/mi/micoord.h +++ b/nx-X11/programs/Xserver/mi/micoord.h @@ -43,7 +43,7 @@ * forcing as to use div instead of shift. Let's be explicit. */ -#if defined(mips) || defined(sgi) || \ +#if defined(mips) || \ defined(sparc) || defined(__sparc64__) || \ defined(__alpha) || defined(__alpha__) || \ defined(__i386__) || defined(i386) || \ diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index c04e9c7a0..d3a18efbe 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -286,7 +286,7 @@ AccessUsingXdmcp (void) } -#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index 3babab3e1..f0e8b707b 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -61,7 +61,6 @@ SOFTWARE. #include -#ifndef sgi /* SGI defines OPEN_MAX in a useless way */ #ifndef X_NOT_POSIX #ifdef _POSIX_SOURCE #include @@ -77,7 +76,6 @@ SOFTWARE. #undef _POSIX_ #endif #endif /* X_NOT_POSIX */ -#endif #ifndef OPEN_MAX #ifdef SVR4 diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 6e5482fc1..5f7542a2d 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -269,10 +269,6 @@ long Memory_fail = 0; #include /* for random() */ #endif -#ifdef sgi -int userdefinedfontpath = 0; -#endif /* sgi */ - char *dev_tty_from_init = NULL; /* since we need to parse it anyway */ extern char dispatchExceptionAtReset; @@ -831,9 +827,6 @@ ProcessCommandLine(int argc, char *argv[]) { if(++i < argc) { -#ifdef sgi - userdefinedfontpath = 1; -#endif /* sgi */ defaultFontPath = argv[i]; } else diff --git a/nx-X11/programs/Xserver/render/picture.h b/nx-X11/programs/Xserver/render/picture.h index b09d9aac2..6f3f2d832 100644 --- a/nx-X11/programs/Xserver/render/picture.h +++ b/nx-X11/programs/Xserver/render/picture.h @@ -173,8 +173,7 @@ typedef __int64 xFixed_32_32; defined(ia64) || defined(__ia64__) || \ defined(__sparc64__) || \ defined(__s390x__) || \ - defined(amd64) || defined (__amd64__) || \ - (defined(sgi) && (_MIPS_SZLONG == 64)) + defined(amd64) || defined (__amd64__) typedef long xFixed_32_32; # else # if defined(__GNUC__) && \ diff --git a/nx-X11/programs/Xserver/xkb/Imakefile b/nx-X11/programs/Xserver/xkb/Imakefile index 07d715301..89e042212 100644 --- a/nx-X11/programs/Xserver/xkb/Imakefile +++ b/nx-X11/programs/Xserver/xkb/Imakefile @@ -1,10 +1,6 @@ #define SGIHyperOpt #include -#ifdef SGIArchitecture -EXTRA_ALLOC_DEFINES = -DFORCE_ALLOCA -#endif - #if BuildXInputExt XKBXI_SRCS = xkbPrOtherEv.c XKBXI_OBJS = xkbPrOtherEv.o @@ -48,7 +44,7 @@ XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln -DEFINES = $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES) +DEFINES = $(XKB_DDXDEFS) $(NX_DEFINES) XKB_DEFINES = -DXKB_BASE_DIRECTORY=\"$(LIBDIR)/xkb\" $(XKB_DISABLE) NormalLibraryObjectRule() diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index ef32a4642..4934d266c 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -53,7 +53,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "xkb.h" -#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(__GNU__) +#if defined(CSRG_BASED) || defined(linux) || defined(__GNU__) #include #endif diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index 10260bf83..1f4bc34b4 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -54,13 +54,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1) -#ifdef sgi -#define LED_CAPS 5 -#define LED_NUM 6 -#define LED_SCROLL 7 -#define PHYS_LEDS 0x7f -#define LED_COMPOSE 8 -#else #if defined(ultrix) || defined(__alpha) || defined(__alpha__) #define LED_COMPOSE 2 #define LED_CAPS 3 @@ -81,7 +74,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PHYS_LEDS 0x07 #endif #endif -#endif #define MAX_TOC 16 typedef struct _SrvXkmInfo { -- cgit v1.2.3 From bf1b3c6cfa5317c1ccc0befeb09541ddb5143fbe Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 4 Feb 2017 16:25:13 +0100 Subject: dix: remove staggeringly broken vendor workarounds Backported from X.org: From f93d10ce9bb4a6de83b561f44fb7b046def16234 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 6 Nov 2006 18:33:45 +0200 Subject: dix: remove staggeringly broken vendor workarounds Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/dix/events.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 166d2e85e..abbde67d5 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -2986,12 +2986,7 @@ EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask ma if (wClient (pWin) == client) { check = pWin->eventMask; -#ifdef SGIMISC - pWin->eventMask = - (mask & ~SGIMiscSpecialDestroyMask) | (pWin->eventMask & SGIMiscSpecialDestroyMask); -#else pWin->eventMask = mask; -#endif } else { @@ -3000,9 +2995,6 @@ EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask ma if (SameClient(others, client)) { check = others->mask; -#ifdef SGIMISC - mask = (mask & ~SGIMiscSpecialDestroyMask) | (others->mask & SGIMiscSpecialDestroyMask); -#endif if (mask == 0) { FreeResource(others->resource, RT_NONE); -- cgit v1.2.3 From e70448087a05c123f916ff82f468e6d5fc57d714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9rard?= Date: Thu, 9 Feb 2017 14:05:32 +0100 Subject: The smart scheduler is not optional. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backported from X.org: commit 9f9268821b13038556fbc029df54ab0e9b2aa77f Author: Mathieu Bérard Date: Mon Aug 11 13:52:38 2008 -0400 The smart scheduler is not optional. Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/damageext/damageext.c | 2 -- nx-X11/programs/Xserver/dix/dispatch.c | 17 ------------ nx-X11/programs/Xserver/dix/events.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Args.c | 20 -------------- nx-X11/programs/Xserver/hw/nxagent/Display.c | 35 ------------------------ nx-X11/programs/Xserver/hw/nxagent/Display.h | 4 --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 36 ------------------------- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 12 --------- nx-X11/programs/Xserver/include/dixstruct.h | 5 ---- nx-X11/programs/Xserver/os/WaitFor.c | 14 ---------- nx-X11/programs/Xserver/os/io.c | 6 ----- nx-X11/programs/Xserver/os/osinit.c | 4 --- nx-X11/programs/Xserver/os/utils.c | 9 ------- 13 files changed, 166 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 602825449..38a624be7 100644 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -84,9 +84,7 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes) if (pDamageClient->critical > 0) { SetCriticalOutputPending (); -#ifdef SMART_SCHEDULE pClient->smart_priority = SMART_MAX_PRIORITY; -#endif } } diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index d098afdc8..2c7550371 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -243,8 +243,6 @@ FlushClientCaches(XID id) } } } -#ifdef SMART_SCHEDULE - #undef SMART_DEBUG #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ @@ -345,7 +343,6 @@ SmartScheduleClient (int *clientReady, int nready) } return best; } -#endif #ifndef NXAGENT_SERVER #define MAJOROP ((xReq *)client->requestBuffer)->reqType @@ -358,9 +355,7 @@ Dispatch(void) register ClientPtr client; register int nready; register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE long start_tick; -#endif nextFreeClientID = 1; InitSelections(); @@ -380,13 +375,11 @@ Dispatch(void) nready = WaitForSomething(clientReady); -#ifdef SMART_SCHEDULE if (nready && !SmartScheduleDisable) { clientReady[0] = SmartScheduleClient (clientReady, nready); nready = 1; } -#endif /***************** * Handle events in round robin fashion, doing input between * each round @@ -409,9 +402,7 @@ Dispatch(void) isItTimeToYield = FALSE; requestingClient = client; -#ifdef SMART_SCHEDULE start_tick = SmartScheduleTime; -#endif while (!isItTimeToYield) { if (*icheck[0] != *icheck[1]) @@ -419,7 +410,6 @@ Dispatch(void) ProcessInputEvents(); FlushIfCriticalOutputPending(); } -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable && (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { @@ -428,7 +418,6 @@ Dispatch(void) client->smart_priority--; break; } -#endif /* now, finally, deal with client requests */ result = ReadRequestFromClient(client); @@ -466,11 +455,9 @@ Dispatch(void) #endif } FlushAllOutput(); -#ifdef SMART_SCHEDULE client = clients[clientReady[nready]]; if (client) client->smart_stop_tick = SmartScheduleTime; -#endif requestingClient = NULL; } dispatchException &= ~DE_PRIORITYCHANGE; @@ -3593,9 +3580,7 @@ CloseDownClient(register ClientPtr client) if (client->index < nextFreeClientID) nextFreeClientID = client->index; clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE SmartLastClient = NullClient; -#endif free(client); while (!clients[currentMaxClients-1]) @@ -3684,12 +3669,10 @@ void InitClient(ClientPtr client, int i, void * ospriv) client->authId = 0; #endif client->fontResFunc = NULL; -#ifdef SMART_SCHEDULE client->smart_priority = 0; client->smart_start_tick = SmartScheduleTime; client->smart_stop_tick = SmartScheduleTime; client->smart_check_tick = SmartScheduleTime; -#endif } extern int clientPrivateLen; diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index abbde67d5..fa8bfc92d 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1542,10 +1542,8 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, #endif if (BitIsOn(criticalEvents, type)) { -#ifdef SMART_SCHEDULE if (client->smart_priority < SMART_MAX_PRIORITY) client->smart_priority++; -#endif SetCriticalOutputPending(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 46e01c737..3844fe046 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -2538,26 +2538,10 @@ void nxagentSetBufferSize() void nxagentSetScheduler() { - #ifdef DISABLE_SMART_SCHEDULE - - #ifdef SMART_SCHEDULE - - #ifdef TEST - fprintf(stderr, "nxagentSetScheduler: Disabling the smart scheduler.\n"); - #endif - - nxagentDisableTimer(); - - #endif - - #else /* #ifdef DISABLE_SMART_SCHEDULE */ - /* * The smart scheduler is the default. */ - #ifdef SMART_SCHEDULE - if (nxagentOption(Shadow) == 1) { #ifdef TEST @@ -2566,10 +2550,6 @@ void nxagentSetScheduler() nxagentDisableTimer(); } - - #endif - - #endif /* #ifdef DISABLE_SMART_SCHEDULE */ } void nxagentSetCoalescence() diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index d8e6aa7e3..eaee84855 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -597,8 +597,6 @@ Display *nxagentInternalOpenDisplay(char *display) int result; - #ifdef SMART_SCHEDULE - /* * Stop the smart schedule timer since * it uses SIGALRM as we do. @@ -606,8 +604,6 @@ Display *nxagentInternalOpenDisplay(char *display) nxagentStopTimer(); - #endif - /* * Install the handler rejecting a possible * loopback connection. @@ -678,16 +674,12 @@ static void nxagentDisplayBlockHandler(Display *display, int reason) * for the remote display. */ - #ifdef SMART_SCHEDULE - #ifdef DEBUG fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Stopping the smart schedule timer.\n"); #endif nxagentStopTimer(); - #endif - if (reason == NXBlockRead) { #ifdef DEBUG @@ -702,13 +694,9 @@ static void nxagentDisplayBlockHandler(Display *display, int reason) nxagentBlocking = 1; - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - /* * Let the dispatch attend the next * client. @@ -723,12 +711,8 @@ static void nxagentDisplayBlockHandler(Display *display, int reason) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - #ifdef SMART_SCHEDULE - } - #endif - /* * Give a chance to the next client. */ @@ -1022,12 +1006,8 @@ void nxagentInstallSignalHandlers() * Reset the SIGALRM to the default. */ - #ifdef SMART_SCHEDULE - nxagentStopTimer(); - #endif - newAction.sa_handler = SIG_DFL; sigfillset(&newAction.sa_mask); @@ -1040,8 +1020,6 @@ void nxagentInstallSignalHandlers() FatalError("Can't set the handler for alarm signal."); } - #ifdef SMART_SCHEDULE - /* * Let the smart schedule set the SIGALRM * handler again. @@ -1049,8 +1027,6 @@ void nxagentInstallSignalHandlers() nxagentInitTimer(); - #endif - /* * Install our own handler for the SIGHUP. */ @@ -1146,12 +1122,8 @@ void nxagentResetSignalHandlers() * Reset the SIGALRM to the default. */ - #ifdef SMART_SCHEDULE - nxagentStopTimer(); - #endif - newAction.sa_handler = SIG_DFL; sigfillset(&newAction.sa_mask); @@ -1164,8 +1136,6 @@ void nxagentResetSignalHandlers() FatalError("Can't set the handler for alarm signal."); } - #ifdef SMART_SCHEDULE - /* * Let the smart schedule set the SIGALRM * handler again. @@ -1173,7 +1143,6 @@ void nxagentResetSignalHandlers() nxagentInitTimer(); - #endif } void nxagentOpenDisplay(int argc, char *argv[]) @@ -2969,16 +2938,12 @@ void nxagentWaitDisplay() * Disable the smart scheduler's interrupts. */ - #ifdef SMART_SCHEDULE - #ifdef DEBUG fprintf(stderr, "nxagentWaitDisplay: Stopping the smart schedule timer.\n"); #endif nxagentStopTimer(); - #endif - if (nxagentDisplay != NULL) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.h b/nx-X11/programs/Xserver/hw/nxagent/Display.h index fe8ae1d43..75da371d8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.h @@ -116,8 +116,6 @@ Bool nxagentReconnectDisplay(void *p0); * Deal with the smart scheduler. */ -#ifdef SMART_SCHEDULE - #define nxagentInitTimer() \ \ SmartScheduleInit(); @@ -149,8 +147,6 @@ Bool nxagentReconnectDisplay(void *p0); \ SmartScheduleDisable = 1; -#endif /* #ifdef SMART_SCHEDULE */ - /* * File descriptor currently used by * Xlib for the agent display. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 1721be9fb..8e80a1524 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -564,16 +564,12 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * the client is scheduled in. */ - #ifdef SMART_SCHEDULE - #ifdef DEBUG fprintf(stderr, "nxagentBlockHandler: Stopping the smart schedule timer.\n"); #endif nxagentStopTimer(); - #endif - nxagentPrintGeometry(); #ifdef BLOCKS @@ -601,13 +597,9 @@ void nxagentWakeupHandler(void * data, int count, void * mask) nxagentHandleConnectionStates(); } - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: Resetting the dispatch state after wakeup.\n"); #endif @@ -617,12 +609,8 @@ void nxagentWakeupHandler(void * data, int count, void * mask) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - #ifdef SMART_SCHEDULE - } - #endif - /* * Can become true during the dispatch loop. */ @@ -897,13 +885,9 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) nxagentHandleConnectionStates(); } - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - #ifdef DEBUG fprintf(stderr, "nxagentShadowWakeupHandler: Resetting the dispatch state after wakeup.\n"); #endif @@ -913,12 +897,8 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - #ifdef SMART_SCHEDULE - } - #endif - /* * Can become true during the dispatch loop. */ @@ -1095,13 +1075,9 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) #endif } - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - /* * Pay attention to the next client if this * client produced enough output. @@ -1131,12 +1107,8 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) } #endif - #ifdef SMART_SCHEDULE - } - #endif - return; } else if (in > 0) @@ -1178,13 +1150,9 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) * the inner dispatch loop forever. */ - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - if (client -> index != nxagentDispatch.client) { #ifdef DEBUG @@ -1230,12 +1198,8 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) #endif } - #ifdef SMART_SCHEDULE - } - #endif - } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 452fe8c43..8fc6cf5fd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -241,9 +241,7 @@ Dispatch(void) register ClientPtr client; register int nready; register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE long start_tick; -#endif unsigned long currentDispatch = 0; @@ -389,13 +387,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio #endif -#ifdef SMART_SCHEDULE if (nready && !SmartScheduleDisable) { clientReady[0] = SmartScheduleClient (clientReady, nready); nready = 1; } -#endif /***************** * Handle events in round robin fashion, doing input between * each round @@ -418,9 +414,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio isItTimeToYield = FALSE; requestingClient = client; -#ifdef SMART_SCHEDULE start_tick = SmartScheduleTime; -#endif while (!isItTimeToYield) { if (*icheck[0] != *icheck[1]) @@ -428,7 +422,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ProcessInputEvents(); FlushIfCriticalOutputPending(); } -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable && (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { @@ -437,7 +430,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio client->smart_priority--; break; } -#endif /* now, finally, deal with client requests */ #ifdef TEST @@ -535,11 +527,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio #endif } FlushAllOutput(); -#ifdef SMART_SCHEDULE client = clients[clientReady[nready]]; if (client) client->smart_stop_tick = SmartScheduleTime; -#endif requestingClient = NULL; } dispatchException &= ~DE_PRIORITYCHANGE; @@ -1318,9 +1308,7 @@ CloseDownClient(register ClientPtr client) if (client->index < nextFreeClientID) nextFreeClientID = client->index; clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE SmartLastClient = NullClient; -#endif free(client); while (!clients[currentMaxClients-1]) diff --git a/nx-X11/programs/Xserver/include/dixstruct.h b/nx-X11/programs/Xserver/include/dixstruct.h index 5019dea4a..ca50c7ca7 100644 --- a/nx-X11/programs/Xserver/include/dixstruct.h +++ b/nx-X11/programs/Xserver/include/dixstruct.h @@ -141,15 +141,12 @@ typedef struct _Client { struct _FontResolution * (*fontResFunc) ( /* no need for font.h */ ClientPtr /* pClient */, int * /* num */); -#ifdef SMART_SCHEDULE int smart_priority; long smart_start_tick; long smart_stop_tick; long smart_check_tick; -#endif } ClientRec; -#ifdef SMART_SCHEDULE /* * Scheduling interface */ @@ -170,8 +167,6 @@ extern Bool SmartScheduleStopTimer(void); extern Bool SmartScheduleInit(void); -#endif - /* This prototype is used pervasively in Xext, dix */ #define DISPATCH_PROC(func) int func(ClientPtr /* client */) diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 899b1de0b..0ecca8b7a 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -190,9 +190,7 @@ WaitForSomething(int *pClientsReady) int nready; fd_set devicesReadable; CARD32 now = 0; -#ifdef SMART_SCHEDULE Bool someReady = FALSE; -#endif #if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) fprintf(stderr, "WaitForSomething: Got called.\n"); @@ -215,7 +213,6 @@ WaitForSomething(int *pClientsReady) ProcessWorkQueue(); if (XFD_ANYSET (&ClientsWithInput)) { -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) { someReady = TRUE; @@ -224,13 +221,11 @@ WaitForSomething(int *pClientsReady) wt = &waittime; } else -#endif { XFD_COPYSET (&ClientsWithInput, &clientsReadable); break; } } -#ifdef SMART_SCHEDULE if (someReady) { XFD_COPYSET(&AllSockets, &LastSelectMask); @@ -238,7 +233,6 @@ WaitForSomething(int *pClientsReady) } else { -#endif wt = NULL; if (timers) { @@ -252,10 +246,8 @@ WaitForSomething(int *pClientsReady) wt = &waittime; } XFD_COPYSET(&AllSockets, &LastSelectMask); -#ifdef SMART_SCHEDULE } SmartScheduleIdle = TRUE; -#endif BlockHandler((void *)&wt, (void *)&LastSelectMask); if (NewOutputPending) FlushAllOutput(); @@ -394,7 +386,6 @@ WaitForSomething(int *pClientsReady) i = XTestProcessInputAction (i, &waittime); } #endif /* XTESTEXT1 */ -#ifdef SMART_SCHEDULE if (i >= 0) { SmartScheduleIdle = FALSE; @@ -402,7 +393,6 @@ WaitForSomething(int *pClientsReady) if (SmartScheduleTimerStopped) (void) SmartScheduleStartTimer (); } -#endif if (i <= 0) /* An error or timeout occurred */ { #if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) @@ -442,7 +432,6 @@ WaitForSomething(int *pClientsReady) selecterr); } } -#ifdef SMART_SCHEDULE else if (someReady) { /* @@ -452,7 +441,6 @@ WaitForSomething(int *pClientsReady) XFD_COPYSET(&ClientsWithInput, &clientsReadable); break; } -#endif #if defined(NX_TRANS_SOCKET) if (*checkForInput[0] != *checkForInput[1]) { @@ -499,10 +487,8 @@ WaitForSomething(int *pClientsReady) return 0; } } -#ifdef SMART_SCHEDULE if (someReady) XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); -#endif if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable)) { NewOutputPending = TRUE; diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 3771d40fb..87739cfb1 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -430,11 +430,9 @@ ReadRequestFromClient(ClientPtr client) FD_SET(fd, &ClientsWithInput); else { -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) FD_CLR(fd, &ClientsWithInput); else -#endif YieldControlNoInput(); } } @@ -442,16 +440,12 @@ ReadRequestFromClient(ClientPtr client) { if (!gotnow) AvailableInput = oc; -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) FD_CLR(fd, &ClientsWithInput); else -#endif YieldControlNoInput(); } -#ifdef SMART_SCHEDULE if (SmartScheduleDisable) -#endif if (++timesThisConnection >= MAX_TIMES_PER) YieldControl(); #ifdef BIGREQS diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 7aa961a56..59b567356 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -55,9 +55,7 @@ SOFTWARE. #include "osdep.h" #include -#ifdef SMART_SCHEDULE #include "dixstruct.h" -#endif #ifndef PATH_MAX #ifdef MAXPATHLEN @@ -216,11 +214,9 @@ OsInit(void) * log file name if logging to a file is desired. */ LogInit(NULL, NULL); -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) if (!SmartScheduleInit ()) SmartScheduleDisable = TRUE; -#endif OsInitAllocator(); if (!OsDelayInitColors) OsInitColors(); } diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 5f7542a2d..204494d63 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -134,9 +134,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "opaque.h" -#ifdef SMART_SCHEDULE #include "dixstruct.h" -#endif #ifdef XKB #include "xkbsrv.h" @@ -635,10 +633,8 @@ void UseMsg(void) ErrorF("+rrxinerama Enable XINERAMA (via RandR) extension (default)\n"); ErrorF("-rrxinerama Disable XINERAMA (via RandR) extension\n"); #endif -#ifdef SMART_SCHEDULE ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n"); -#endif ErrorF("+extension name Enable extension\n"); ErrorF("-extension name Disable extension\n"); #ifdef XDMCP @@ -1038,7 +1034,6 @@ ProcessCommandLine(int argc, char *argv[]) i = skip - 1; } #endif -#ifdef SMART_SCHEDULE else if ( strcmp( argv[i], "-dumbSched") == 0) { SmartScheduleDisable = TRUE; @@ -1062,7 +1057,6 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } -#endif #ifdef RENDER else if ( strcmp( argv[i], "-render" ) == 0) { @@ -1367,8 +1361,6 @@ XNFstrdup(const char *s) return ret; } -#ifdef SMART_SCHEDULE - unsigned long SmartScheduleIdleCount; Bool SmartScheduleIdle; Bool SmartScheduleTimerStopped; @@ -1494,7 +1486,6 @@ SmartScheduleInit (void) return FALSE; #endif } -#endif #ifdef SIG_BLOCK static sigset_t PreviousSignalMask; -- cgit v1.2.3 From efc0dae0519aa0ef1fabea6a64919475fd916347 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 17 Feb 2017 12:43:06 +0000 Subject: Switch from using libNX_X11's deprecated XKeycodeToKeysym() function to using XGetKeyboardMapping(). Fixes ArcticaProject/nx-libs#229. --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 21 ++++++++++++++++---- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 27 +++++++++++++++++++------- 2 files changed, 37 insertions(+), 11 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 371780a92..efe745718 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -934,7 +934,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) { enum HandleEventResult result; - KeySym keysym; + XlibKeySym *keysym; #ifdef TEST fprintf(stderr, "nxagentDispatchEvents: Going to handle new KeyPress event.\n"); @@ -1101,12 +1101,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) * sive delay. */ - keysym = XKeycodeToKeysym(nxagentDisplay, X.xkey.keycode, 0); + int keysyms_per_keycode_return; + keysym = XGetKeyboardMapping(nxagentDisplay, + X.xkey.keycode, + 1, + &keysyms_per_keycode_return); - if (nxagentMonitoredDuplicate(keysym) == 1) + if (nxagentMonitoredDuplicate(keysym[0]) == 1) { nxagentRemoveDuplicatedKeys(&X); } + free(keysym); if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) { @@ -4638,8 +4643,16 @@ void nxagentDumpInputDevicesState(void) { if (val & (mask << k)) { + int keysyms_per_keycode_return; + XlibKeySym *keysym = XGetKeyboardMapping(nxagentDisplay, + i * 8 + k, + 1, + &keysyms_per_keycode_return); + + fprintf(stderr, "\n\t[%d] [%s]", i * 8 + k, - XKeysymToString(XKeycodeToKeysym(nxagentDisplay, i * 8 + k, 0))); + XKeysymToString(keysym[0])); + free(keysym); } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index 8dc1a0b85..6237b9dac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -406,7 +406,13 @@ free(filename); static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) { - KeySym keysym = XKeycodeToKeysym(nxagentDisplay, X->keycode, 0); + int keysyms_per_keycode_return; + XlibKeySym *keysym = XGetKeyboardMapping(nxagentDisplay, + X->keycode, + 1, + &keysyms_per_keycode_return); + + struct nxagentSpecialKeystrokeMap *cur = map; if (! nxagentKeystrokeFileParsed) @@ -418,19 +424,20 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING; while (cur->stroke != KEYSTROKE_END_MARKER) { - if (cur->keysym == keysym && modifier_matches(cur->modifierMask, cur->modifierAltMeta, X->state)) { + if (cur->keysym == keysym[0] && modifier_matches(cur->modifierMask, cur->modifierAltMeta, X->state)) { + + free(keysym); return cur->stroke; } cur++; } + free(keysym); return ret; } int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) { - KeySym sym; - int index = 0; enum nxagentSpecialKeystroke stroke = find_keystroke(X); *result = doNothing; @@ -440,17 +447,23 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) * Do we need a cache ? */ - sym = XKeycodeToKeysym(nxagentDisplay, X -> keycode, index); + int keysyms_per_keycode_return; + XlibKeySym *sym = XGetKeyboardMapping(nxagentDisplay, + X->keycode, + 1, + &keysyms_per_keycode_return); - if (sym == XK_VoidSymbol || sym == NoSymbol) + if (sym[0] == XK_VoidSymbol || sym[0] == NoSymbol) { + free(sym); return 0; } #ifdef TEST fprintf(stderr, "nxagentCheckSpecialKeystroke: got code %x - state %x - sym %lx\n", - X -> keycode, X -> state, sym); + X -> keycode, X -> state, sym[0]); #endif + free(sym); /* * Check special keys. -- cgit v1.2.3 From 52c3c80d75081b91ff27cb8ab37ca943980d424d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 15 Feb 2017 09:59:00 +0100 Subject: Naming change: Security*Access -> Dix*Access Backported from X.org: commit 6c46645cfc1afda8aeabfe0ed4d9342673b702f1 Author: Eamon Walsh Date: Thu Dec 14 14:45:42 2006 -0500 Naming change: Security*Access -> Dix*Access Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 172 ++++++++++++------------ nx-X11/programs/Xserver/Xext/saver.c | 10 +- nx-X11/programs/Xserver/Xext/security.c | 10 +- nx-X11/programs/Xserver/Xext/shape.c | 22 +-- nx-X11/programs/Xserver/Xext/shm.c | 6 +- nx-X11/programs/Xserver/Xext/sync.c | 16 +-- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 4 +- nx-X11/programs/Xserver/Xext/xvdisp.c | 30 ++--- nx-X11/programs/Xserver/composite/compwindow.c | 2 +- nx-X11/programs/Xserver/damageext/damageext.c | 10 +- nx-X11/programs/Xserver/dbe/dbe.c | 12 +- nx-X11/programs/Xserver/dix/colormap.c | 4 +- nx-X11/programs/Xserver/dix/cursor.c | 4 +- nx-X11/programs/Xserver/dix/dispatch.c | 116 ++++++++-------- nx-X11/programs/Xserver/dix/dixfonts.c | 8 +- nx-X11/programs/Xserver/dix/dixutils.c | 6 +- nx-X11/programs/Xserver/dix/events.c | 38 +++--- nx-X11/programs/Xserver/dix/gc.c | 8 +- nx-X11/programs/Xserver/dix/property.c | 20 +-- nx-X11/programs/Xserver/dix/resource.c | 4 +- nx-X11/programs/Xserver/dix/window.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 16 +-- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 48 +++---- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 10 +- nx-X11/programs/Xserver/include/dix.h | 10 +- nx-X11/programs/Xserver/include/resource.h | 8 +- nx-X11/programs/Xserver/randr/randrstr.h | 8 +- nx-X11/programs/Xserver/randr/rrdispatch.c | 2 +- nx-X11/programs/Xserver/randr/rrmode.c | 2 +- nx-X11/programs/Xserver/randr/rrmonitor.c | 6 +- nx-X11/programs/Xserver/randr/rroutput.c | 4 +- nx-X11/programs/Xserver/randr/rrprovider.c | 2 +- nx-X11/programs/Xserver/randr/rrscreen.c | 10 +- nx-X11/programs/Xserver/randr/rrxinerama.c | 6 +- nx-X11/programs/Xserver/render/picture.c | 4 +- nx-X11/programs/Xserver/render/render.c | 122 ++++++++--------- nx-X11/programs/Xserver/xfixes/cursor.c | 12 +- nx-X11/programs/Xserver/xfixes/region.c | 46 +++---- nx-X11/programs/Xserver/xfixes/saveset.c | 2 +- nx-X11/programs/Xserver/xfixes/select.c | 2 +- 43 files changed, 421 insertions(+), 425 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 9da3328f8..906fdd137 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -89,7 +89,7 @@ int PanoramiXCreateWindow(ClientPtr client) return BadLength; if (!(parent = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->parent, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->parent, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(stuff->class == CopyFromParent) @@ -103,7 +103,7 @@ int PanoramiXCreateWindow(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -112,7 +112,7 @@ int PanoramiXCreateWindow(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -121,7 +121,7 @@ int PanoramiXCreateWindow(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_COLORMAP, SecurityReadAccess))) + client, tmp, XRT_COLORMAP, DixReadAccess))) return BadColor; } } @@ -190,7 +190,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) return BadLength; if (!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; if((win->u.win.class == InputOnly) && @@ -202,7 +202,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -211,7 +211,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -220,7 +220,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_COLORMAP, SecurityReadAccess))) + client, tmp, XRT_COLORMAP, DixReadAccess))) return BadColor; } } @@ -249,7 +249,7 @@ int PanoramiXDestroyWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityDestroyAccess))) + client, stuff->id, XRT_WINDOW, DixDestroyAccess))) return BadWindow; FOR_NSCREENS_BACKWARD(j) { @@ -274,7 +274,7 @@ int PanoramiXDestroySubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityDestroyAccess))) + client, stuff->id, XRT_WINDOW, DixDestroyAccess))) return BadWindow; FOR_NSCREENS_BACKWARD(j) { @@ -299,7 +299,7 @@ int PanoramiXChangeSaveSet(ClientPtr client) REQUEST_SIZE_MATCH(xChangeSaveSetReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityReadAccess))) + client, stuff->window, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_BACKWARD(j) { @@ -323,11 +323,11 @@ int PanoramiXReparentWindow(ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(!(parent = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->parent, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->parent, XRT_WINDOW, DixWriteAccess))) return BadWindow; x = stuff->x; @@ -358,7 +358,7 @@ int PanoramiXMapWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -380,7 +380,7 @@ int PanoramiXMapSubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -402,7 +402,7 @@ int PanoramiXUnmapWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -424,7 +424,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -455,11 +455,11 @@ int PanoramiXConfigureWindow(ClientPtr client) /* because we need the parent */ if (!(pWin = (WindowPtr)SecurityLookupIDByType( - client, stuff->window, RT_WINDOW, SecurityWriteAccess))) + client, stuff->window, RT_WINDOW, DixWriteAccess))) return BadWindow; if (!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; if ((Mask)stuff->mask & CWSibling) { @@ -467,7 +467,7 @@ int PanoramiXConfigureWindow(ClientPtr client) sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1)); if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) { if(!(sib = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_WINDOW, SecurityReadAccess))) + client, tmp, XRT_WINDOW, DixReadAccess))) return BadWindow; } } @@ -512,7 +512,7 @@ int PanoramiXCirculateWindow(ClientPtr client) REQUEST_SIZE_MATCH(xCirculateWindowReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -577,11 +577,11 @@ int PanoramiXTranslateCoords(ClientPtr client) REQUEST_SIZE_MATCH(xTranslateCoordsReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); + DixReadAccess); if (!pDst) return(BadWindow); rep.type = X_Reply; @@ -653,7 +653,7 @@ int PanoramiXCreatePixmap(ClientPtr client) client->errorValue = stuff->pid; if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; if(!(newPix = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) @@ -692,7 +692,7 @@ int PanoramiXFreePixmap(ClientPtr client) client->errorValue = stuff->id; if(!(pix = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_PIXMAP, SecurityDestroyAccess))) + client, stuff->id, XRT_PIXMAP, DixDestroyAccess))) return BadPixmap; FOR_NSCREENS_BACKWARD(j) { @@ -728,14 +728,14 @@ int PanoramiXCreateGC(ClientPtr client) return BadLength; if (!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; if ((Mask)stuff->mask & GCTile) { tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { if(!(tile = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -743,7 +743,7 @@ int PanoramiXCreateGC(ClientPtr client) stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { if(!(stip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -751,7 +751,7 @@ int PanoramiXCreateGC(ClientPtr client) clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { if(!(clip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -803,14 +803,14 @@ int PanoramiXChangeGC(ClientPtr client) return BadLength; if (!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if ((Mask)stuff->mask & GCTile) { tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { if(!(tile = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -818,7 +818,7 @@ int PanoramiXChangeGC(ClientPtr client) stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { if(!(stip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -826,7 +826,7 @@ int PanoramiXChangeGC(ClientPtr client) clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { if(!(clip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -857,11 +857,11 @@ int PanoramiXCopyGC(ClientPtr client) REQUEST_SIZE_MATCH(xCopyGCReq); if(!(srcGC = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->srcGC, XRT_GC, SecurityReadAccess))) + client, stuff->srcGC, XRT_GC, DixReadAccess))) return BadGC; if(!(dstGC = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dstGC, XRT_GC, SecurityWriteAccess))) + client, stuff->dstGC, XRT_GC, DixWriteAccess))) return BadGC; FOR_NSCREENS(j) { @@ -884,7 +884,7 @@ int PanoramiXSetDashes(ClientPtr client) REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityWriteAccess))) + client, stuff->gc, XRT_GC, DixWriteAccess))) return BadGC; FOR_NSCREENS_BACKWARD(j) { @@ -906,7 +906,7 @@ int PanoramiXSetClipRectangles(ClientPtr client) REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityWriteAccess))) + client, stuff->gc, XRT_GC, DixWriteAccess))) return BadGC; FOR_NSCREENS_BACKWARD(j) { @@ -928,7 +928,7 @@ int PanoramiXFreeGC(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_GC, SecurityDestroyAccess))) + client, stuff->id, XRT_GC, DixDestroyAccess))) return BadGC; FOR_NSCREENS_BACKWARD(j) { @@ -954,7 +954,7 @@ int PanoramiXClearToBackground(ClientPtr client) REQUEST_SIZE_MATCH(xClearAreaReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; x = stuff->x; @@ -996,13 +996,13 @@ int PanoramiXCopyArea(ClientPtr client) REQUEST_SIZE_MATCH(xCopyAreaReq); if(!(src = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->srcDrawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; srcShared = IS_SHARED_PIXMAP(src); if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->dstDrawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; dstShared = IS_SHARED_PIXMAP(dst); @@ -1011,7 +1011,7 @@ int PanoramiXCopyArea(ClientPtr client) return (* SavedProcVector[X_CopyArea])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if((dst->type == XRT_WINDOW) && dst->u.win.root) @@ -1080,7 +1080,7 @@ int PanoramiXCopyArea(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; @@ -1144,13 +1144,13 @@ int PanoramiXCopyPlane(ClientPtr client) REQUEST_SIZE_MATCH(xCopyPlaneReq); if(!(src = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->srcDrawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; srcShared = IS_SHARED_PIXMAP(src); if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->dstDrawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; dstShared = IS_SHARED_PIXMAP(dst); @@ -1159,7 +1159,7 @@ int PanoramiXCopyPlane(ClientPtr client) return (* SavedProcVector[X_CopyPlane])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if((dst->type == XRT_WINDOW) && dst->u.win.root) @@ -1186,7 +1186,7 @@ int PanoramiXCopyPlane(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; return (BadMatch); @@ -1244,14 +1244,14 @@ int PanoramiXPolyPoint(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyPointReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyPoint])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1302,14 +1302,14 @@ int PanoramiXPolyLine(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyLineReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyLine])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1360,14 +1360,14 @@ int PanoramiXPolySegment(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolySegmentReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolySegment])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1422,14 +1422,14 @@ int PanoramiXPolyRectangle(ClientPtr client) if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyRectangle])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1482,14 +1482,14 @@ int PanoramiXPolyArc(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyArcReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyArc])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1540,14 +1540,14 @@ int PanoramiXFillPoly(ClientPtr client) REQUEST_AT_LEAST_SIZE(xFillPolyReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_FillPoly])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1599,14 +1599,14 @@ int PanoramiXPolyFillRectangle(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillRectangle])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1658,14 +1658,14 @@ int PanoramiXPolyFillArc(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillArc])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1716,14 +1716,14 @@ int PanoramiXPutImage(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PutImage])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1767,7 +1767,7 @@ int PanoramiXGetImage(ClientPtr client) } if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(draw->type == XRT_PIXMAP) @@ -1907,14 +1907,14 @@ PanoramiXPolyText8(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyTextReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText8])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1946,14 +1946,14 @@ PanoramiXPolyText16(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyTextReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText16])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1985,14 +1985,14 @@ int PanoramiXImageText8(ClientPtr client) REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText8])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2024,14 +2024,14 @@ int PanoramiXImageText16(ClientPtr client) REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText16])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2062,7 +2062,7 @@ int PanoramiXCreateColormap(ClientPtr client) REQUEST_SIZE_MATCH(xCreateColormapReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityReadAccess))) + client, stuff->window, XRT_WINDOW, DixReadAccess))) return BadWindow; if(!stuff->visual || (stuff->visual > 255)) @@ -2105,7 +2105,7 @@ int PanoramiXFreeColormap(ClientPtr client) client->errorValue = stuff->id; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_COLORMAP, SecurityDestroyAccess))) + client, stuff->id, XRT_COLORMAP, DixDestroyAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j) { @@ -2134,7 +2134,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client) if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( client, stuff->srcCmap, XRT_COLORMAP, - SecurityReadAccess | SecurityWriteAccess))) + DixReadAccess | DixWriteAccess))) return BadColor; if(!(newCmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) @@ -2172,7 +2172,7 @@ int PanoramiXInstallColormap(ClientPtr client) client->errorValue = stuff->id; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_COLORMAP, SecurityReadAccess))) + client, stuff->id, XRT_COLORMAP, DixReadAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2195,7 +2195,7 @@ int PanoramiXUninstallColormap(ClientPtr client) client->errorValue = stuff->id; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_COLORMAP, SecurityReadAccess))) + client, stuff->id, XRT_COLORMAP, DixReadAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j) { @@ -2218,7 +2218,7 @@ int PanoramiXAllocColor(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2241,7 +2241,7 @@ int PanoramiXAllocNamedColor(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2264,7 +2264,7 @@ int PanoramiXAllocColorCells(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2287,7 +2287,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2311,7 +2311,7 @@ int PanoramiXFreeColors(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j) { @@ -2333,7 +2333,7 @@ int PanoramiXStoreColors(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2356,7 +2356,7 @@ int PanoramiXStoreNamedColor(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 3e4fd8a95..06a967eb4 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -1199,7 +1199,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2); @@ -1211,7 +1211,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -1221,7 +1221,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -1231,7 +1231,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_COLORMAP, SecurityReadAccess))) + client, tmp, XRT_COLORMAP, DixReadAccess))) return BadColor; } } @@ -1271,7 +1271,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client) int i; if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; for(i = PanoramiXNumScreens - 1; i > 0; i--) { diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 3a638460e..55a805aea 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -750,7 +750,7 @@ ProcSecurityRevokeAuthorization( REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client, - stuff->authId, SecurityAuthorizationResType, SecurityDestroyAccess); + stuff->authId, SecurityAuthorizationResType, DixDestroyAccess); if (!pAuth) return SecurityErrorBase + XSecurityBadAuthorization; @@ -1115,7 +1115,7 @@ SecurityCheckResourceIDAccess( int cid = CLIENT_ID(id); int reqtype = ((xReq *)client->requestBuffer)->reqType; - if (SecurityUnknownAccess == access_mode) + if (DixUnknownAccess == access_mode) return rval; /* for compatibility, we have to allow access */ switch (reqtype) @@ -2051,11 +2051,11 @@ SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode) * executed a continue, which will skip the follwing code. */ action = SecurityAllowOperation; - if (access_mode & SecurityReadAccess) + if (access_mode & DixReadAccess) action = max(action, pacl->readAction); - if (access_mode & SecurityWriteAccess) + if (access_mode & DixWriteAccess) action = max(action, pacl->writeAction); - if (access_mode & SecurityDestroyAccess) + if (access_mode & DixDestroyAccess) action = max(action, pacl->destroyAction); break; } /* end for each pacl */ diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index de597dead..cd29ec721 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -385,7 +385,7 @@ ProcPanoramiXShapeRectangles( REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -417,7 +417,7 @@ ProcShapeMask (client) REQUEST_SIZE_MATCH (xShapeMaskReq); UpdateCurrentTime(); - pWin = SecurityLookupWindow (stuff->dest, client, SecurityWriteAccess); + pWin = SecurityLookupWindow (stuff->dest, client, DixWriteAccess); if (!pWin) return BadWindow; switch (stuff->destKind) { @@ -439,7 +439,7 @@ ProcShapeMask (client) srcRgn = 0; else { pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (!pPixmap) return BadPixmap; if (pPixmap->drawable.pScreen != pScreen || @@ -483,12 +483,12 @@ ProcPanoramiXShapeMask( REQUEST_SIZE_MATCH (xShapeMaskReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(stuff->src != None) { if(!(pmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->src, XRT_PIXMAP, SecurityReadAccess))) + client, stuff->src, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } else pmap = NULL; @@ -611,11 +611,11 @@ ProcPanoramiXShapeCombine( REQUEST_AT_LEAST_SIZE (xShapeCombineReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(!(win2 = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->src, XRT_WINDOW, SecurityReadAccess))) + client, stuff->src, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -683,7 +683,7 @@ ProcPanoramiXShapeOffset( REQUEST_AT_LEAST_SIZE (xShapeOffsetReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -817,11 +817,11 @@ ProcShapeSelectInput (client) XID clientResource; REQUEST_SIZE_MATCH (xShapeSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); + pWin = SecurityLookupWindow (stuff->window, client, DixWriteAccess); if (!pWin) return BadWindow; pHead = (ShapeEventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, SecurityWriteAccess); + pWin->drawable.id, EventType, DixWriteAccess); switch (stuff->enable) { case xTrue: if (pHead) { @@ -988,7 +988,7 @@ ProcShapeInputSelected (client) if (!pWin) return BadWindow; pHead = (ShapeEventPtr *) SecurityLookupIDByType(client, - pWin->drawable.id, EventType, SecurityReadAccess); + pWin->drawable.id, EventType, DixReadAccess); enabled = xFalse; if (pHead) { for (pShapeEvent = *pHead; diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index dc8bbf97b..e3fa3a24e 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -568,11 +568,11 @@ ProcPanoramiXShmPutImage(register ClientPtr client) REQUEST_SIZE_MATCH(xShmPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -618,7 +618,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) } if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if (draw->type == XRT_PIXMAP) diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index e1580b3a3..8cf6af562 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -425,7 +425,7 @@ SyncInitTrigger(client, pTrigger, counter, changes) if (counter == None) pCounter = NULL; else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType( - client, counter, RTCounter, SecurityReadAccess))) + client, counter, RTCounter, DixReadAccess))) { client->errorValue = counter; return SyncErrorBase + XSyncBadCounter; @@ -1527,7 +1527,7 @@ ProcSyncSetCounter(client) REQUEST_SIZE_MATCH(xSyncSetCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid, - RTCounter, SecurityWriteAccess); + RTCounter, DixWriteAccess); if (pCounter == NULL) { client->errorValue = stuff->cid; @@ -1560,7 +1560,7 @@ ProcSyncChangeCounter(client) REQUEST_SIZE_MATCH(xSyncChangeCounterReq); pCounter = (SyncCounter *) SecurityLookupIDByType(client, stuff->cid, - RTCounter, SecurityWriteAccess); + RTCounter, DixWriteAccess); if (pCounter == NULL) { client->errorValue = stuff->cid; @@ -1598,7 +1598,7 @@ ProcSyncDestroyCounter(client) REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, - RTCounter, SecurityDestroyAccess); + RTCounter, DixDestroyAccess); if (pCounter == NULL) { client->errorValue = stuff->counter; @@ -1744,7 +1744,7 @@ ProcSyncQueryCounter(client) REQUEST_SIZE_MATCH(xSyncQueryCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, - RTCounter, SecurityReadAccess); + RTCounter, DixReadAccess); if (pCounter == NULL) { client->errorValue = stuff->counter; @@ -1872,7 +1872,7 @@ ProcSyncChangeAlarm(client) REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityWriteAccess))) + RTAlarm, DixWriteAccess))) { client->errorValue = stuff->alarm; return SyncErrorBase + XSyncBadAlarm; @@ -1913,7 +1913,7 @@ ProcSyncQueryAlarm(client) REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityReadAccess); + RTAlarm, DixReadAccess); if (!pAlarm) { client->errorValue = stuff->alarm; @@ -1972,7 +1972,7 @@ ProcSyncDestroyAlarm(client) REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityDestroyAccess))) + RTAlarm, DixDestroyAccess))) { client->errorValue = stuff->alarm; return SyncErrorBase + XSyncBadAlarm; diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 67a09f77b..6ec47c4f4 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -443,11 +443,11 @@ ProcXF86BigfontQueryFont( #endif client->errorValue = stuff->id; /* EITHER font or gc */ pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { /* can't use VERIFY_GC because it might return BadGC */ GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); + DixReadAccess); if (!pGC) { client->errorValue = stuff->id; return BadFont; /* procotol spec says only error is BadFont */ diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index 34f4537f2..b33bfa493 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -1854,11 +1854,11 @@ XineramaXvStopVideo(ClientPtr client) REQUEST_SIZE_MATCH(xvStopVideoReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; FOR_NSCREENS_BACKWARD(i) { @@ -1882,7 +1882,7 @@ XineramaXvSetPortAttribute(ClientPtr client) REQUEST_SIZE_MATCH(xvSetPortAttributeReq); if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; FOR_NSCREENS_BACKWARD(i) { @@ -1908,15 +1908,15 @@ XineramaXvShmPutImage(ClientPtr client) REQUEST_SIZE_MATCH(xvShmPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1955,15 +1955,15 @@ XineramaXvPutImage(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2000,15 +2000,15 @@ XineramaXvPutVideo(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutVideoReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2045,15 +2045,15 @@ XineramaXvPutStill(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c index 799aad023..e9bb39827 100644 --- a/nx-X11/programs/Xserver/composite/compwindow.c +++ b/nx-X11/programs/Xserver/composite/compwindow.c @@ -83,7 +83,7 @@ compRepaintBorder (ClientPtr pClient, void * closure) dixLookupWindow(&pWindow, (XID) (intptr_t) closure, pClient, DixWriteAccess); #else - pWindow = SecurityLookupWindow((XID) (intptr_t) closure, pClient, SecurityWriteAccess); + pWindow = SecurityLookupWindow((XID) (intptr_t) closure, pClient, DixWriteAccess); int rc = pWindow ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 38a624be7..6ade82f84 100644 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -175,7 +175,7 @@ ProcDamageCreate (ClientPtr client) REQUEST_SIZE_MATCH(xDamageCreateReq); LEGAL_NEW_RESOURCE(stuff->damage, client); SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); switch (stuff->level) { case XDamageReportRawRectangles: level = DamageReportRawRegion; @@ -233,7 +233,7 @@ ProcDamageDestroy (ClientPtr client) DamageExtPtr pDamageExt; REQUEST_SIZE_MATCH(xDamageDestroyReq); - VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, SecurityWriteAccess); + VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess); FreeResource (stuff->damage, RT_NONE); return (client->noClientException); } @@ -247,9 +247,9 @@ ProcDamageSubtract (ClientPtr client) RegionPtr pParts; REQUEST_SIZE_MATCH(xDamageSubtractReq); - VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE(pRepair, stuff->repair, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE(pParts, stuff->parts, client, SecurityWriteAccess); + VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess); + VERIFY_REGION_OR_NONE(pRepair, stuff->repair, client, DixWriteAccess); + VERIFY_REGION_OR_NONE(pParts, stuff->parts, client, DixWriteAccess); if (pDamageExt->level != DamageReportRawRegion) { diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index d0487ba63..95740871a 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -420,7 +420,7 @@ ProcDbeAllocateBackBufferName(client) /* The window must be valid. */ if (!(pWin = SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess))) + DixWriteAccess))) { return(BadWindow); } @@ -648,9 +648,9 @@ ProcDbeDeallocateBackBufferName(client) /* Buffer name must be valid */ if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client, - stuff->buffer, dbeWindowPrivResType, SecurityDestroyAccess)) || + stuff->buffer, dbeWindowPrivResType, DixDestroyAccess)) || !(SecurityLookupIDByType(client, stuff->buffer, dbeDrawableResType, - SecurityDestroyAccess))) + DixDestroyAccess))) { client->errorValue = stuff->buffer; return(dbeErrorBase + DbeBadBuffer); @@ -751,7 +751,7 @@ ProcDbeSwapBuffers(client) /* Each window must be a valid window - BadWindow. */ if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client, - SecurityWriteAccess))) + DixWriteAccess))) { free(swapInfo); return(BadWindow); @@ -916,7 +916,7 @@ ProcDbeGetVisualInfo(client) for (i = 0; i < stuff->n; i++) { if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( - drawables[i], client, SecurityReadAccess))) + drawables[i], client, DixReadAccess))) { free(pDrawables); return(BadDrawable); @@ -1072,7 +1072,7 @@ ProcDbeGetBackBufferAttributes(client) REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client, - stuff->buffer, dbeWindowPrivResType, SecurityReadAccess))) + stuff->buffer, dbeWindowPrivResType, DixReadAccess))) { rep.attributes = None; } diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index b8361a9cf..8b0e1e421 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -892,7 +892,7 @@ AllocColor (ColormapPtr pmap, { ColormapPtr prootmap = (ColormapPtr) SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pmap->class == prootmap->class) FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb, @@ -909,7 +909,7 @@ AllocColor (ColormapPtr pmap, { ColormapPtr prootmap = (ColormapPtr) SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pmap->class == prootmap->class) { diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index 093464298..a1bf6a7ed 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -262,9 +262,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, GlyphSharePtr pShare; sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT, - SecurityReadAccess); + DixReadAccess); maskfont = (FontPtr) SecurityLookupIDByType(client, mask, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!sourcefont) { diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 2c7550371..02d5170fb 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -491,7 +491,7 @@ ProcCreateWindow(ClientPtr client) LEGAL_NEW_RESOURCE(stuff->wid, client); if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess))) + DixWriteAccess))) return BadWindow; len = client->req_len - (sizeof(xCreateWindowReq) >> 2); if (Ones(stuff->mask) != len) @@ -532,7 +532,7 @@ ProcChangeWindowAttributes(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); @@ -557,7 +557,7 @@ ProcGetWindowAttributes(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); memset(&wa, 0, sizeof(xGetWindowAttributesReply)); @@ -574,7 +574,7 @@ ProcDestroyWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); + DixDestroyAccess); if (!pWin) return(BadWindow); if (pWin->parent) @@ -590,7 +590,7 @@ ProcDestroySubwindows(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); + DixDestroyAccess); if (!pWin) return(BadWindow); DestroySubwindows(pWin, client); @@ -606,7 +606,7 @@ ProcChangeSaveSet(register ClientPtr client) REQUEST_SIZE_MATCH(xChangeSaveSetReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) @@ -636,11 +636,11 @@ ProcReparentWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); + DixWriteAccess); if (!pParent) return(BadWindow); if (SAME_SCREENS(pWin->drawable, pParent->drawable)) @@ -671,7 +671,7 @@ ProcMapWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); MapWindow(pWin, client); @@ -687,7 +687,7 @@ ProcMapSubwindows(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); MapSubwindows(pWin, client); @@ -703,7 +703,7 @@ ProcUnmapWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); UnmapWindow(pWin, FALSE); @@ -719,7 +719,7 @@ ProcUnmapSubwindows(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); UnmapSubwindows(pWin); @@ -736,7 +736,7 @@ ProcConfigureWindow(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); @@ -764,7 +764,7 @@ ProcCirculateWindow(register ClientPtr client) return BadValue; } pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); CirculateWindow(pWin, (int)stuff->direction, client); @@ -778,7 +778,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); + SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, DixReadAccess); memset(rep, 0, sizeof(xGetGeometryReply)); rep->type = X_Reply; rep->length = 0; @@ -839,7 +839,7 @@ ProcQueryTree(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); memset(&reply, 0, sizeof(xQueryTreeReply)); @@ -957,7 +957,7 @@ ProcSetSelectionOwner(register ClientPtr client) if (stuff->window != None) { pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); } @@ -1079,7 +1079,7 @@ ProcConvertSelection(register ClientPtr client) REQUEST_SIZE_MATCH(xConvertSelectionReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -1098,7 +1098,7 @@ ProcConvertSelection(register ClientPtr client) #ifdef XCSECURITY && (!client->CheckAccess || (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, + RT_WINDOW, DixReadAccess, CurrentSelections[i].pWin)) #endif ) @@ -1208,11 +1208,11 @@ ProcTranslateCoords(register ClientPtr client) REQUEST_SIZE_MATCH(xTranslateCoordsReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); + DixReadAccess); if (!pDst) return(BadWindow); memset(&rep, 0, sizeof(xTranslateCoordsReply)); @@ -1305,7 +1305,7 @@ ProcCloseFont(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); + DixDestroyAccess); if ( pFont != (FontPtr)NULL) /* id was valid */ { FreeResource(stuff->id, RT_NONE); @@ -1331,12 +1331,12 @@ ProcQueryFont(register ClientPtr client) client->errorValue = stuff->id; /* EITHER font or gc */ pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { /* can't use VERIFY_GC because it might return BadGC */ pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); + DixReadAccess); if (!pGC) { client->errorValue = stuff->id; @@ -1394,11 +1394,11 @@ ProcQueryTextExtents(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, - SecurityReadAccess); + DixReadAccess); if (!pGC) { client->errorValue = stuff->fid; @@ -1479,7 +1479,7 @@ ProcCreatePixmap(register ClientPtr client) client->errorValue = stuff->pid; LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); if (!stuff->width || !stuff->height) { client->errorValue = 0; @@ -1535,7 +1535,7 @@ ProcFreePixmap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); + DixDestroyAccess); if (pMap) { FreeResource(stuff->id, RT_NONE); @@ -1562,7 +1562,7 @@ ProcCreateGC(register ClientPtr client) client->errorValue = stuff->gc; LEGAL_NEW_RESOURCE(stuff->gc, client); SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); len = client->req_len - (sizeof(xCreateGCReq) >> 2); if (len != Ones(stuff->mask)) return BadLength; @@ -1584,7 +1584,7 @@ ProcChangeGC(register ClientPtr client) unsigned len; REQUEST_AT_LEAST_SIZE(xChangeGCReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess); len = client->req_len - (sizeof(xChangeGCReq) >> 2); if (len != Ones(stuff->mask)) return BadLength; @@ -1608,8 +1608,8 @@ ProcCopyGC(register ClientPtr client) REQUEST(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq); - SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); - SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); + SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, DixReadAccess); + SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, DixWriteAccess); if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) return (BadMatch); result = CopyGC(pGC, dstGC, stuff->mask); @@ -1636,7 +1636,7 @@ ProcSetDashes(register ClientPtr client) return BadValue; } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); + SECURITY_VERIFY_GC(pGC,stuff->gc, client, DixWriteAccess); result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, (unsigned char *)&stuff[1]); @@ -1664,7 +1664,7 @@ ProcSetClipRectangles(register ClientPtr client) client->errorValue = stuff->ordering; return BadValue; } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); + SECURITY_VERIFY_GC(pGC,stuff->gc, client, DixWriteAccess); nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); if (nr & 4) @@ -1685,7 +1685,7 @@ ProcFreeGC(register ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); + SECURITY_VERIFY_GC(pGC, stuff->id, client, DixDestroyAccess); FreeResource(stuff->id, RT_NONE); return(client->noClientException); } @@ -1698,7 +1698,7 @@ ProcClearToBackground(register ClientPtr client) REQUEST_SIZE_MATCH(xClearAreaReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (pWin->drawable.class == InputOnly) @@ -1732,7 +1732,7 @@ ProcCopyArea(register ClientPtr client) if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; @@ -1772,7 +1772,7 @@ ProcCopyPlane(register ClientPtr client) if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; @@ -2115,7 +2115,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, client->errorValue = format; return(BadValue); } - SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); + SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, DixReadAccess); memset(&xgi, 0, sizeof(xGetImageReply)); if(pDraw->type == DRAWABLE_WINDOW) @@ -2447,7 +2447,7 @@ ProcCreateColormap(register ClientPtr client) mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -2477,7 +2477,7 @@ ProcFreeColormap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, - SecurityDestroyAccess); + DixDestroyAccess); if (pmap) { /* Freeing a default colormap is a no-op */ @@ -2505,7 +2505,7 @@ ProcCopyColormapAndFree(register ClientPtr client) mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, - RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) + RT_COLORMAP, DixReadAccess|DixWriteAccess)) ) { result = CopyColormapAndFree(mid, pSrcMap, client->index); if (client->noClientException != Success) @@ -2528,7 +2528,7 @@ ProcInstallColormap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { (*(pcmp->pScreen->InstallColormap)) (pcmp); @@ -2549,7 +2549,7 @@ ProcUninstallColormap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { if(pcmp->mid != pcmp->pScreen->defColormap) @@ -2573,7 +2573,7 @@ ProcListInstalledColormaps(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -2608,7 +2608,7 @@ ProcAllocColor (register ClientPtr client) REQUEST_SIZE_MATCH(xAllocColorReq); pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pmap) { acr.type = X_Reply; @@ -2648,7 +2648,7 @@ ProcAllocNamedColor (register ClientPtr client) REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { int retval; @@ -2700,7 +2700,7 @@ ProcAllocColorCells (register ClientPtr client) REQUEST_SIZE_MATCH(xAllocColorCellsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { xAllocColorCellsReply accr; @@ -2766,7 +2766,7 @@ ProcAllocColorPlanes(register ClientPtr client) REQUEST_SIZE_MATCH(xAllocColorPlanesReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { xAllocColorPlanesReply acpr; @@ -2830,7 +2830,7 @@ ProcFreeColors(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xFreeColorsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { int count; @@ -2865,7 +2865,7 @@ ProcStoreColors (ClientPtr client) REQUEST_AT_LEAST_SIZE(xStoreColorsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { int count; @@ -2899,7 +2899,7 @@ ProcStoreNamedColor (register ClientPtr client) REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { xColorItem def; @@ -2933,7 +2933,7 @@ ProcQueryColors(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xQueryColorsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { int count, retval; @@ -2987,7 +2987,7 @@ ProcLookupColor(register ClientPtr client) REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { xLookupColorReply lcr; @@ -3037,9 +3037,9 @@ ProcCreateCursor (register ClientPtr client) LEGAL_NEW_RESOURCE(stuff->cid, client); src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if ( src == (PixmapPtr)NULL) { client->errorValue = stuff->source; @@ -3139,7 +3139,7 @@ ProcFreeCursor (register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, - RT_CURSOR, SecurityDestroyAccess); + RT_CURSOR, DixDestroyAccess); if (pCursor) { FreeResource(stuff->id, RT_NONE); @@ -3169,7 +3169,7 @@ ProcQueryBestSize (register ClientPtr client) return(BadValue); } SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) return (BadMatch); pScreen = pDraw->pScreen; diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index aa90b8769..f7d047c2d 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1197,7 +1197,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) if (c->slept && c->pDraw && c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) + RC_DRAWABLE, DixWriteAccess)) { /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client and avoid further @@ -1227,7 +1227,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) | ((Font)*(c->pElt+2)) << 16 | ((Font)*(c->pElt+1)) << 24; pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { client->errorValue = fid; @@ -1489,7 +1489,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) if (c->slept && c->pDraw && c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) + RC_DRAWABLE, DixWriteAccess)) { /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ @@ -2044,7 +2044,7 @@ FontPtr find_old_font(XID id) { return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); + DixUnknownAccess); } Font diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index bd7439d89..bf925f748 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -260,13 +260,13 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) WindowPtr LookupWindow(XID rid, ClientPtr client) { - return SecurityLookupWindow(rid, client, SecurityUnknownAccess); + return SecurityLookupWindow(rid, client, DixUnknownAccess); } void * LookupDrawable(XID rid, ClientPtr client) { - return SecurityLookupDrawable(rid, client, SecurityUnknownAccess); + return SecurityLookupDrawable(rid, client, DixUnknownAccess); } #else /* not XCSECURITY */ @@ -317,7 +317,7 @@ ClientPtr LookupClient(XID rid, ClientPtr client) { void * pRes = (void *)SecurityLookupIDByClass(client, rid, RC_ANY, - SecurityReadAccess); + DixReadAccess); int clientIndex = CLIENT_ID(rid); if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index fa8bfc92d..fde3e91dd 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -2201,7 +2201,7 @@ XineramaWarpPointer(ClientPtr client) if (stuff->dstWid != None) { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); + dest = SecurityLookupWindow(stuff->dstWid, client, DixReadAccess); if (!dest) return BadWindow; } @@ -2214,7 +2214,7 @@ XineramaWarpPointer(ClientPtr client) XID winID = stuff->srcWid; WindowPtr source; - source = SecurityLookupWindow(winID, client, SecurityReadAccess); + source = SecurityLookupWindow(winID, client, DixReadAccess); if (!source) return BadWindow; winX = source->drawable.x; @@ -2281,7 +2281,7 @@ ProcWarpPointer(ClientPtr client) if (stuff->dstWid != None) { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); + dest = SecurityLookupWindow(stuff->dstWid, client, DixReadAccess); if (!dest) return BadWindow; } @@ -2294,7 +2294,7 @@ ProcWarpPointer(ClientPtr client) XID winID = stuff->srcWid; WindowPtr source; - source = SecurityLookupWindow(winID, client, SecurityReadAccess); + source = SecurityLookupWindow(winID, client, DixReadAccess); if (!source) return BadWindow; winX = source->drawable.x; @@ -3469,7 +3469,7 @@ SetInputFocus( else if ((focusID == FollowKeyboard) && followOK) focusWin = inputInfo.keyboard->focus->win; else if (!(focusWin = SecurityLookupWindow(focusID, client, - SecurityReadAccess))) + DixReadAccess))) return BadWindow; else { @@ -3590,7 +3590,7 @@ ProcGrabPointer(ClientPtr client) client->errorValue = stuff->eventMask; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; if (stuff->confineTo == None) @@ -3598,7 +3598,7 @@ ProcGrabPointer(ClientPtr client) else { confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); + DixReadAccess); if (!confineTo) return BadWindow; } @@ -3607,7 +3607,7 @@ ProcGrabPointer(ClientPtr client) else { cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursor) { client->errorValue = stuff->cursor; @@ -3682,7 +3682,7 @@ ProcChangeActivePointerGrab(ClientPtr client) else { newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!newCursor) { client->errorValue = stuff->cursor; @@ -3752,7 +3752,7 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, client->errorValue = ownerEvents; return BadValue; } - pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; time = ClientTimeToServerTime(ctime); @@ -3842,7 +3842,7 @@ ProcQueryPointer(ClientPtr client) DeviceIntPtr mouse = inputInfo.pointer; REQUEST_SIZE_MATCH(xResourceReq); - pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->id, client, DixReadAccess); if (!pWin) return BadWindow; if (mouse->valuator->motionHintWindow) @@ -4009,7 +4009,7 @@ ProcSendEvent(ClientPtr client) } else pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) @@ -4048,7 +4048,7 @@ ProcUngrabKey(ClientPtr client) DeviceIntPtr keybd = inputInfo.keyboard; REQUEST_SIZE_MATCH(xUngrabKeyReq); - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; @@ -4119,7 +4119,7 @@ ProcGrabKey(ClientPtr client) client->errorValue = stuff->modifiers; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; @@ -4171,14 +4171,14 @@ ProcGrabButton(ClientPtr client) client->errorValue = stuff->eventMask; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; if (stuff->confineTo == None) confineTo = NullWindow; else { confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); + DixReadAccess); if (!confineTo) return BadWindow; } @@ -4187,7 +4187,7 @@ ProcGrabButton(ClientPtr client) else { cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursor) { client->errorValue = stuff->cursor; @@ -4222,7 +4222,7 @@ ProcUngrabButton(ClientPtr client) client->errorValue = stuff->modifiers; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; tempGrab.resource = client->clientAsMask; @@ -4376,7 +4376,7 @@ ProcRecolorCursor(ClientPtr client) REQUEST_SIZE_MATCH(xRecolorCursorReq); pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityWriteAccess); + RT_CURSOR, DixWriteAccess); if ( !pCursor) { client->errorValue = stuff->cursor; diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index 29f14de43..b3a4edf4d 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -271,7 +271,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { NEXTVAL(XID, newpix); pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - newpix, RT_PIXMAP, SecurityReadAccess); + newpix, RT_PIXMAP, DixReadAccess); } if (pPixmap) { @@ -307,7 +307,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { NEXTVAL(XID, newstipple) pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - newstipple, RT_PIXMAP, SecurityReadAccess); + newstipple, RT_PIXMAP, DixReadAccess); } if (pPixmap) { @@ -349,7 +349,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { NEXTVAL(XID, newfont) pFont = (FontPtr)SecurityLookupIDByType(client, newfont, - RT_FONT, SecurityReadAccess); + RT_FONT, DixReadAccess); } if (pFont) { @@ -416,7 +416,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC } else pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - pid, RT_PIXMAP, SecurityReadAccess); + pid, RT_PIXMAP, DixReadAccess); } if (pPixmap) diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 2e5569367..f5713cf5e 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -106,7 +106,7 @@ ProcRotateProperties(ClientPtr client) REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); UpdateCurrentTime(); pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!stuff->nAtoms) @@ -119,7 +119,7 @@ ProcRotateProperties(ClientPtr client) { #ifdef XCSECURITY char action = SecurityCheckPropertyAccess(client, pWin, atoms[i], - SecurityReadAccess|SecurityWriteAccess); + DixReadAccess|DixWriteAccess); #endif if (!ValidAtom(atoms[i]) #ifdef XCSECURITY @@ -219,7 +219,7 @@ ProcChangeProperty(ClientPtr client) REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!ValidAtom(stuff->property)) @@ -235,7 +235,7 @@ ProcChangeProperty(ClientPtr client) #ifdef XCSECURITY switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) + DixWriteAccess)) { case SecurityErrorOperation: client->errorValue = stuff->property; @@ -469,7 +469,7 @@ ProcGetProperty(ClientPtr client) if (stuff->delete) UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; @@ -507,10 +507,10 @@ ProcGetProperty(ClientPtr client) #ifdef XCSECURITY { - Mask access_mode = SecurityReadAccess; + Mask access_mode = DixReadAccess; if (stuff->delete) - access_mode |= SecurityDestroyAccess; + access_mode |= DixDestroyAccess; switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, access_mode)) { @@ -614,7 +614,7 @@ ProcListProperties(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -659,7 +659,7 @@ ProcDeleteProperty(register ClientPtr client) REQUEST_SIZE_MATCH(xDeletePropertyReq); UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!ValidAtom(stuff->property)) @@ -670,7 +670,7 @@ ProcDeleteProperty(register ClientPtr client) #ifdef XCSECURITY switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityDestroyAccess)) + DixDestroyAccess)) { case SecurityErrorOperation: client->errorValue = stuff->property; diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index ca7da1601..d22b0cdd0 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -878,14 +878,14 @@ void * LookupIDByType(XID id, RESTYPE rtype) { return SecurityLookupIDByType(NullClient, id, rtype, - SecurityUnknownAccess); + DixUnknownAccess); } void * LookupIDByClass(XID id, RESTYPE classes) { return SecurityLookupIDByClass(NullClient, id, classes, - SecurityUnknownAccess); + DixUnknownAccess); } #else /* not XCSECURITY */ diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 1239ab9f7..a7346e778 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -1028,7 +1028,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt else { pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (pPixmap != (PixmapPtr) NULL) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || @@ -1089,7 +1089,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt else { pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (pPixmap) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || @@ -1302,7 +1302,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt goto PatchUp; } pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (!pCmap) { error = BadColor; @@ -1378,7 +1378,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt else { pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!pCursor) { error = BadCursor; @@ -2252,7 +2252,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP sibwid = (Window ) *pVlist; pVlist++; pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); + RT_WINDOW, DixReadAccess); if (!pSib) { client->errorValue = sibwid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 8fc6cf5fd..a46434bf1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -586,7 +586,7 @@ ProcReparentWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); @@ -596,7 +596,7 @@ ProcReparentWindow(register ClientPtr client) } pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); + DixWriteAccess); if (!pParent) return(BadWindow); if (SAME_SCREENS(pWin->drawable, pParent->drawable)) @@ -630,7 +630,7 @@ ProcQueryTree(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); memset(&reply, 0, sizeof(xQueryTreeReply)); @@ -698,7 +698,7 @@ ProcSetSelectionOwner(register ClientPtr client) if (stuff->window != None) { pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); } @@ -797,7 +797,7 @@ ProcConvertSelection(register ClientPtr client) REQUEST_SIZE_MATCH(xConvertSelectionReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -837,7 +837,7 @@ ProcConvertSelection(register ClientPtr client) #ifdef XCSECURITY && (!client->CheckAccess || (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, + RT_WINDOW, DixReadAccess, CurrentSelections[i].pWin)) #endif ) @@ -918,7 +918,7 @@ ProcCloseFont(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); + DixDestroyAccess); if (pFont != (FontPtr)NULL) { #ifdef NXAGENT_SERVER @@ -1015,7 +1015,7 @@ ProcFreePixmap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); + DixDestroyAccess); if (pMap) { #ifdef NXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index f507e5f71..43cb806e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -583,7 +583,7 @@ ProcSendEvent(ClientPtr client) } else pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 881d2e2d0..28fdd19f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -131,7 +131,7 @@ ProcChangeProperty(ClientPtr client) if (pWin == NULL) #endif pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!ValidAtom(stuff->property)) @@ -147,7 +147,7 @@ ProcChangeProperty(ClientPtr client) #ifdef XCSECURITY switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) + DixWriteAccess)) { case SecurityErrorOperation: client->errorValue = stuff->property; @@ -348,7 +348,7 @@ ProcGetProperty(ClientPtr client) if (stuff->delete) UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; @@ -439,10 +439,10 @@ ProcGetProperty(ClientPtr client) #ifdef XCSECURITY { - Mask access_mode = SecurityReadAccess; + Mask access_mode = DixReadAccess; if (stuff->delete) - access_mode |= SecurityDestroyAccess; + access_mode |= DixDestroyAccess; switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, access_mode)) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index b8c5cdbd2..8d55516fb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -385,11 +385,11 @@ ProcRenderCreatePicture (ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); + DixWriteAccess); pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->format; @@ -426,7 +426,7 @@ ProcRenderChangePicture (ClientPtr client) int error; REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); @@ -450,7 +450,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) int result; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -558,13 +558,13 @@ ProcRenderComposite (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, + VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || @@ -687,9 +687,9 @@ ProcRenderTrapezoids (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -700,7 +700,7 @@ ProcRenderTrapezoids (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -758,7 +758,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) format = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!format) { client->errorValue = stuff->format; @@ -809,7 +809,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->existing, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->existing; @@ -834,7 +834,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityDestroyAccess); + DixDestroyAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -860,7 +860,7 @@ ProcRenderFreeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -928,9 +928,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -941,7 +941,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -954,7 +954,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1027,7 +1027,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, gs, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = gs; @@ -1163,7 +1163,7 @@ ProcRenderFillRectangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1212,7 +1212,7 @@ ProcRenderCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH (xRenderCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); if (!pSrc->pDrawable) return BadDrawable; @@ -1430,7 +1430,7 @@ ProcRenderSetPictureTransform (ClientPtr client) int result; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); @@ -1453,7 +1453,7 @@ ProcRenderSetPictureFilter (ClientPtr client) char *name; REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); name = (char *) (stuff + 1); params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); @@ -1490,7 +1490,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) for (i = 0; i < ncursor; i++) { cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursors[i]) { free (cursors); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 7cb29bde5..adff36569 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -503,7 +503,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP sibwid = (Window ) *pVlist; pVlist++; pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); + RT_WINDOW, DixReadAccess); if (!pSib) { client->errorValue = sibwid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index bb961e5a8..bb19b3458 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -540,7 +540,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & IconPixmapHint) && (wmHints.icon_pixmap != None)) { PixmapPtr icon = (PixmapPtr)SecurityLookupIDByType(pClient, wmHints.icon_pixmap, - RT_PIXMAP, SecurityDestroyAccess); + RT_PIXMAP, DixDestroyAccess); if (icon) { @@ -567,7 +567,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & IconWindowHint) && (wmHints.icon_window != None)) { WindowPtr icon = (WindowPtr)SecurityLookupWindow(wmHints.icon_window, pClient, - SecurityDestroyAccess); + DixDestroyAccess); if (icon) { @@ -589,7 +589,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & IconMaskHint) && (wmHints.icon_mask != None)) { PixmapPtr icon = (PixmapPtr)SecurityLookupIDByType(pClient, wmHints.icon_mask, - RT_PIXMAP, SecurityDestroyAccess); + RT_PIXMAP, DixDestroyAccess); if (icon) { @@ -611,7 +611,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & WindowGroupHint) && (wmHints.window_group != None)) { WindowPtr window = (WindowPtr)SecurityLookupWindow(wmHints.window_group, pClient, - SecurityDestroyAccess); + DixDestroyAccess); if (window) { @@ -695,7 +695,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) for (i = 0; i < nUnits; i++) { pWindow = (WindowPtr)SecurityLookupWindow(input[i], pClient, - SecurityDestroyAccess); + DixDestroyAccess); if ((input[i] != None) && pWindow) { wind[i] = nxagentWindow(pWindow); diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index 4b9c7749c..0b08b46a9 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -138,13 +138,13 @@ SOFTWARE. } #define VERIFY_DRAWABLE(pDraw, did, client)\ - SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess) + SECURITY_VERIFY_DRAWABLE(pDraw, did, client, DixUnknownAccess) #define VERIFY_GEOMETRABLE(pDraw, did, client)\ - SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess) + SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, DixUnknownAccess) #define VERIFY_GC(pGC, rid, client)\ - SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess) + SECURITY_VERIFY_GC(pGC, rid, client, DixUnknownAccess) #else /* not XCSECURITY */ @@ -255,8 +255,8 @@ SOFTWARE. if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\ (client->lastDrawableID != drawID))\ {\ - SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\ - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\ + SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, DixWriteAccess);\ + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);\ if ((pGC->depth != pDraw->depth) ||\ (pGC->pScreen != pDraw->pScreen))\ return (BadMatch);\ diff --git a/nx-X11/programs/Xserver/include/resource.h b/nx-X11/programs/Xserver/include/resource.h index 5e169e093..164e7ccfc 100644 --- a/nx-X11/programs/Xserver/include/resource.h +++ b/nx-X11/programs/Xserver/include/resource.h @@ -220,10 +220,10 @@ extern void * LookupClientResourceComplex( * simultaneously. */ -#define SecurityUnknownAccess 0 /* don't know intentions */ -#define SecurityReadAccess (1<<0) /* inspecting the object */ -#define SecurityWriteAccess (1<<1) /* changing the object */ -#define SecurityDestroyAccess (1<<2) /* destroying the object */ +#define DixUnknownAccess 0 /* don't know intentions */ +#define DixReadAccess (1<<0) /* inspecting the object */ +#define DixWriteAccess (1<<1) /* changing the object */ +#define DixDestroyAccess (1<<2) /* destroying the object */ #ifdef XCSECURITY diff --git a/nx-X11/programs/Xserver/randr/randrstr.h b/nx-X11/programs/Xserver/randr/randrstr.h index 459a47383..4b497f82d 100644 --- a/nx-X11/programs/Xserver/randr/randrstr.h +++ b/nx-X11/programs/Xserver/randr/randrstr.h @@ -443,12 +443,8 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; (SecurityLookupIDByType (client, id, \ RRProviderType, a))) -#define DixUnknownAccess SecurityUnknownAccess -#define DixReadAccess SecurityReadAccess -#define DixWriteAccess SecurityWriteAccess -#define DixSetAttrAccess SecurityWriteAccess -#define DixUseAccess SecurityWriteAccess -#define DixDestroyAccess SecurityDestroyAccess +#define DixSetAttrAccess DixWriteAccess +#define DixUseAccess DixWriteAccess #endif diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index 14f74d771..68d3b97e6 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -87,7 +87,7 @@ ProcRRSelectInput(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityWriteAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixWriteAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index 8f8d2d0aa..876ebea42 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -360,7 +360,7 @@ ProcRRCreateMode(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c index 8829caf2f..13b061c35 100644 --- a/nx-X11/programs/Xserver/randr/rrmonitor.c +++ b/nx-X11/programs/Xserver/randr/rrmonitor.c @@ -636,7 +636,7 @@ ProcRRGetMonitors(ClientPtr client) #ifndef NXAGENT_SERVER r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); #else - window = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + window = SecurityLookupWindow(stuff->window, client, DixReadAccess); r = window ? Success : BadWindow; #endif @@ -723,7 +723,7 @@ ProcRRSetMonitor(ClientPtr client) #ifndef NXAGENT_SERVER r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); #else - window = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + window = SecurityLookupWindow(stuff->window, client, DixReadAccess); r = window ? Success : BadWindow; #endif @@ -772,7 +772,7 @@ ProcRRDeleteMonitor(ClientPtr client) #ifndef NXAGENT_SERVER r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); #else - window = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + window = SecurityLookupWindow(stuff->window, client, DixReadAccess); r = window ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index e5f69e010..c4da7d534 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -587,7 +587,7 @@ ProcRRSetOutputPrimary(ClientPtr client) #ifndef NXAGENT_SERVER ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); ret = pWin ? Success : BadWindow; #endif @@ -645,7 +645,7 @@ ProcRRGetOutputPrimary(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c index ed2b1baca..0ac9474c6 100644 --- a/nx-X11/programs/Xserver/randr/rrprovider.c +++ b/nx-X11/programs/Xserver/randr/rrprovider.c @@ -69,7 +69,7 @@ ProcRRGetProviders(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index bdb8b6dd3..1a30b29d4 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -222,7 +222,7 @@ ProcRRGetScreenSizeRange(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif @@ -276,7 +276,7 @@ ProcRRSetScreenSize(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) @@ -532,7 +532,7 @@ rrGetScreenResources(ClientPtr client, Bool query) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) @@ -806,7 +806,7 @@ ProcRRGetScreenInfo(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif @@ -980,7 +980,7 @@ ProcRRSetScreenConfig(ClientPtr client) rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); #else /* !defined(NXAGENT_SERVER) */ pDraw = - SecurityLookupDrawable(stuff->drawable, client, SecurityWriteAccess); + SecurityLookupDrawable(stuff->drawable, client, DixWriteAccess); rc = pDraw ? Success : BadDrawable; #endif /* !defined(NXAGENT_SERVER) */ diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c index 5c80e52db..d863897a7 100644 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c +++ b/nx-X11/programs/Xserver/randr/rrxinerama.c @@ -150,7 +150,7 @@ ProcRRXineramaGetState(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif @@ -205,7 +205,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) @@ -240,7 +240,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 4a1cd98f5..862ae0031 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1210,7 +1210,7 @@ ChangePicture (PicturePtr pPicture, pAlpha = (PicturePtr) SecurityLookupIDByType(client, pid, PictureType, - SecurityWriteAccess|SecurityReadAccess); + DixWriteAccess|DixReadAccess); if (!pAlpha) { client->errorValue = pid; @@ -1271,7 +1271,7 @@ ChangePicture (PicturePtr pPicture, pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pid, RT_PIXMAP, - SecurityReadAccess); + DixReadAccess); if (!pPixmap) { client->errorValue = pid; diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 774dcc8ec..abc26b5d9 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -567,7 +567,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { @@ -636,11 +636,11 @@ ProcRenderCreatePicture (ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); + DixWriteAccess); pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->format; @@ -674,7 +674,7 @@ ProcRenderChangePicture (ClientPtr client) int len; REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); @@ -694,7 +694,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) int result; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -721,7 +721,7 @@ ProcRenderFreePicture (ClientPtr client) REQUEST_SIZE_MATCH(xRenderFreePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess, RenderErrBase + BadPicture); FreeResource (stuff->picture, RT_NONE); return(client->noClientException); @@ -752,13 +752,13 @@ ProcRenderComposite (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, + VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) @@ -800,9 +800,9 @@ ProcRenderTrapezoids (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -813,7 +813,7 @@ ProcRenderTrapezoids (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -848,9 +848,9 @@ ProcRenderTriangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -861,7 +861,7 @@ ProcRenderTriangles (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -895,9 +895,9 @@ ProcRenderTriStrip (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -908,7 +908,7 @@ ProcRenderTriStrip (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -942,9 +942,9 @@ ProcRenderTriFan (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -955,7 +955,7 @@ ProcRenderTriFan (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -1008,7 +1008,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) format = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!format) { client->errorValue = stuff->format; @@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->existing, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->existing; @@ -1083,7 +1083,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityDestroyAccess); + DixDestroyAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1118,7 +1118,7 @@ ProcRenderAddGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1223,7 +1223,7 @@ ProcRenderFreeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1278,9 +1278,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1291,7 +1291,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -1304,7 +1304,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1366,7 +1366,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, gs, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = gs; @@ -1447,7 +1447,7 @@ ProcRenderFillRectangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1515,7 +1515,7 @@ ProcRenderCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH (xRenderCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); if (!pSrc->pDrawable) return BadDrawable; @@ -1699,7 +1699,7 @@ ProcRenderSetPictureTransform (ClientPtr client) int result; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); if (client->noClientException != Success) @@ -1726,7 +1726,7 @@ ProcRenderQueryFilters (ClientPtr client) char *names; REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); + SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, DixReadAccess); pScreen = pDrawable->pScreen; nbytesName = 0; @@ -1828,7 +1828,7 @@ ProcRenderSetPictureFilter (ClientPtr client) char *name; REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); name = (char *) (stuff + 1); params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); @@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) for (i = 0; i < ncursor; i++) { cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursors[i]) { free (cursors); @@ -1891,7 +1891,7 @@ ProcRenderAddTraps (ClientPtr client) REQUEST(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -2644,7 +2644,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; @@ -2686,7 +2686,7 @@ PanoramiXRenderChangePicture (ClientPtr client) REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2707,7 +2707,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2728,7 +2728,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2749,7 +2749,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2772,7 +2772,7 @@ PanoramiXRenderFreePicture (ClientPtr client) client->errorValue = stuff->picture; - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess, RenderErrBase + BadPicture); @@ -2798,11 +2798,11 @@ PanoramiXRenderComposite (ClientPtr client) REQUEST_SIZE_MATCH(xRenderCompositeReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, + VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); orig = *stuff; @@ -2846,9 +2846,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client) INT16 xSrc, ySrc; REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + @@ -2889,7 +2889,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) int extra_len; REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); if (extra_len && @@ -2936,9 +2936,9 @@ PanoramiXRenderTrapezoids(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); @@ -2998,9 +2998,9 @@ PanoramiXRenderTriangles(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); @@ -3056,9 +3056,9 @@ PanoramiXRenderTriStrip(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); @@ -3110,9 +3110,9 @@ PanoramiXRenderTriFan(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); @@ -3166,7 +3166,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); @@ -3210,7 +3210,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); @@ -3256,7 +3256,7 @@ PanoramiXRenderAddTraps (ClientPtr client) INT16 x_off, y_off; REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); if (extra_len && diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 61822aab7..67f46f55e 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -193,7 +193,7 @@ ProcXFixesSelectCursorInput (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (stuff->eventMask & ~CursorAllEvents) @@ -362,7 +362,7 @@ ProcXFixesSetCursorName (ClientPtr client) Atom atom; REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityWriteAccess); + VERIFY_CURSOR(pCursor, stuff->cursor, client, DixWriteAccess); tchar = (char *) &stuff[1]; atom = MakeAtom (tchar, stuff->nbytes, TRUE); if (atom == BAD_RESOURCE) @@ -394,7 +394,7 @@ ProcXFixesGetCursorName (ClientPtr client) int len; REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityReadAccess); + VERIFY_CURSOR(pCursor, stuff->cursor, client, DixReadAccess); if (pCursor->name) str = NameForAtom (pCursor->name); else @@ -619,8 +619,8 @@ ProcXFixesChangeCursor (ClientPtr client) REQUEST(xXFixesChangeCursorReq); REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); - VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_CURSOR (pSource, stuff->source, client, DixReadAccess); + VERIFY_CURSOR (pDestination, stuff->destination, client, DixWriteAccess); ReplaceCursor (pSource, TestForCursor, (void *) pDestination); return (client->noClientException); @@ -653,7 +653,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) REQUEST(xXFixesChangeCursorByNameReq); REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes); - VERIFY_CURSOR(pSource, stuff->source, client, SecurityReadAccess); + VERIFY_CURSOR(pSource, stuff->source, client, DixReadAccess); tchar = (char *) &stuff[1]; name = MakeAtom (tchar, stuff->nbytes, FALSE); if (name) diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 6759b4bfe..31d19b5ff 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -117,7 +117,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) pPixmap = (PixmapPtr) SecurityLookupIDByType (client, stuff->bitmap, RT_PIXMAP, - SecurityReadAccess); + DixReadAccess); if (!pPixmap) { client->errorValue = stuff->bitmap; @@ -222,7 +222,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); LEGAL_NEW_RESOURCE (stuff->region, client); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess); switch (pGC->clientClipType) { case CT_PIXMAP: @@ -269,7 +269,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); LEGAL_NEW_RESOURCE (stuff->region, client); - VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityReadAccess, + VERIFY_PICTURE(pPicture, stuff->picture, client, DixReadAccess, RenderErrBase + BadPicture); switch (pPicture->clientClipType) { @@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client) RegionPtr pRegion; REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); FreeResource (stuff->region, RT_NONE); return(client->noClientException); } @@ -340,7 +340,7 @@ ProcXFixesSetRegion (ClientPtr client) REQUEST (xXFixesSetRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); things = (client->req_len << 2) - sizeof (xXFixesCreateRegionReq); if (things & 4) @@ -377,8 +377,8 @@ ProcXFixesCopyRegion (ClientPtr client) RegionPtr pSource, pDestination; REQUEST (xXFixesCopyRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); if (!RegionCopy(pDestination, pSource)) return BadAlloc; @@ -406,9 +406,9 @@ ProcXFixesCombineRegion (ClientPtr client) REQUEST (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); - VERIFY_REGION(pSource1, stuff->source1, client, SecurityReadAccess); - VERIFY_REGION(pSource2, stuff->source2, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource1, stuff->source1, client, DixReadAccess); + VERIFY_REGION(pSource2, stuff->source2, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: @@ -452,8 +452,8 @@ ProcXFixesInvertRegion (ClientPtr client) REQUEST(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); /* Compute bounds, limit to 16 bits */ bounds.x1 = stuff->x; @@ -499,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client) REQUEST(xXFixesTranslateRegionReq); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); RegionTranslate(pRegion, stuff->dx, stuff->dy); return (client->noClientException); @@ -525,8 +525,8 @@ ProcXFixesRegionExtents (ClientPtr client) REQUEST(xXFixesRegionExtentsReq); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); RegionReset(pDestination, RegionExtents(pSource)); @@ -557,7 +557,7 @@ ProcXFixesFetchRegion (ClientPtr client) REQUEST(xXFixesFetchRegionReq); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityReadAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess); pExtent = RegionExtents(pRegion); pBox = RegionRects (pRegion); @@ -618,8 +618,8 @@ ProcXFixesSetGCClipRegion (ClientPtr client) REQUEST(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, SecurityReadAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess); + VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, DixReadAccess); if (pRegion) { @@ -669,7 +669,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) client->errorValue = stuff->dest; return BadWindow; } - VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess); pScreen = pWin->drawable.pScreen; switch (stuff->destKind) { case ShapeBounding: @@ -756,9 +756,9 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) REQUEST(xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); - VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); - VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityReadAccess); + VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess); return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, pRegion); @@ -793,8 +793,8 @@ ProcXFixesExpandRegion (ClientPtr client) int i; REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); nBoxes = RegionNumRects(pSource); pSrc = RegionRects(pSource); diff --git a/nx-X11/programs/Xserver/xfixes/saveset.c b/nx-X11/programs/Xserver/xfixes/saveset.c index a81c0ca1b..0a5b2b8da 100644 --- a/nx-X11/programs/Xserver/xfixes/saveset.c +++ b/nx-X11/programs/Xserver/xfixes/saveset.c @@ -38,7 +38,7 @@ ProcXFixesChangeSaveSet(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index 600abc660..b21301d1c 100644 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -198,7 +198,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (stuff->eventMask & ~SelectionAllEvents) -- cgit v1.2.3 From 1d24554ff5754e294c03da0a3c5a53af8736ee2b Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 19 Feb 2017 00:06:54 +0100 Subject: dix: fix incomplete commit The following commit turned out to be incomplete. This commit makes it complete by removing client->lastDrawable/lastGC everywhere thus fixing ArcticaProject/nx-libs#306 and #322 commit e6f2f6427122dc4bc802acebf26f8cec16cd2f62 Author: Mike Gabriel Date: Mon Jun 20 16:45:38 2016 +0200 dix: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Backported from X.org: commit 9a183d7ba50e31afa133cc03aee7991517a283ea Author: Eamon Walsh Date: Tue Aug 14 11:39:26 2007 -0400 dix: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/dbe/dbe.c | 2 +- nx-X11/programs/Xserver/dix/dispatch.c | 42 +-------------------------- nx-X11/programs/Xserver/dix/dixutils.c | 45 +++-------------------------- nx-X11/programs/Xserver/include/dix.h | 38 ++---------------------- nx-X11/programs/Xserver/include/dixstruct.h | 4 --- nx-X11/programs/Xserver/include/resource.h | 6 ++-- 6 files changed, 12 insertions(+), 125 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 95740871a..85a22219f 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -1842,7 +1842,7 @@ DbeExtensionInit() /* Create the resource types. */ dbeDrawableResType = - CreateNewResourceType(DbeDrawableDelete) | RC_CACHED | RC_DRAWABLE; + CreateNewResourceType(DbeDrawableDelete) | RC_DRAWABLE; dbeWindowPrivResType = CreateNewResourceType(DbeWindowPrivDelete); diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 02d5170fb..044ba1c4b 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -216,33 +216,6 @@ InitSelections() } #endif /* NXAGENT_SERVER */ -void -FlushClientCaches(XID id) -{ - int i; - register ClientPtr client; - - client = clients[CLIENT_ID(id)]; - if (client == NullClient) - return ; - for (i=0; ilastDrawableID == id) - { - client->lastDrawableID = screenInfo.screens[0]->root->drawable.id; - client->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; - } - else if (client->lastGCID == id) - { - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - } - } -} #undef SMART_DEBUG #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ @@ -3629,20 +3602,7 @@ void InitClient(ClientPtr client, int i, void * ospriv) client->sequence = 0; client->clientAsMask = ((Mask)i) << CLIENTOFFSET; client->clientGone = FALSE; - if (i) - { - client->closeDownMode = DestroyAll; - client->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; - client->lastDrawableID = screenInfo.screens[0]->root->drawable.id; - } - else - { - client->closeDownMode = RetainPermanent; - client->lastDrawable = (DrawablePtr)NULL; - client->lastDrawableID = INVALID; - } - client->lastGC = (GCPtr) NULL; - client->lastGCID = INVALID; + client->closeDownMode = i ? DestroyAll : RetainPermanent; client->numSaved = 0; client->saveSet = (SaveSetElt *)NULL; client->noClientException = Success; diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index bf925f748..3ccc90d71 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -210,27 +210,10 @@ CompareISOLatin1Lowered(unsigned char *s1, int s1len, WindowPtr SecurityLookupWindow(XID rid, ClientPtr client, Mask access_mode) { - WindowPtr pWin; - client->errorValue = rid; if(rid == INVALID) return NULL; - if (client->trustLevel != XSecurityClientTrusted) - return (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); - if (client->lastDrawableID == rid) - { - if (client->lastDrawable->type == DRAWABLE_WINDOW) - return ((WindowPtr) client->lastDrawable); - return (WindowPtr) NULL; - } - pWin = (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); - if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) { - client->lastDrawable = (DrawablePtr) pWin; - client->lastDrawableID = rid; - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - return pWin; + return (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); } @@ -241,15 +224,10 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) if(rid == INVALID) return (void *) NULL; - if (client->trustLevel != XSecurityClientTrusted) - return (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, - access_mode); - if (client->lastDrawableID == rid) - return ((void *) client->lastDrawable); pDraw = (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, access_mode); - if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) - return (void *)pDraw; + if ((client->trustLevel != XSecurityClientTrusted) || (pDraw && (pDraw->type != UNDRAWABLE_WINDOW))) + return (void *)pDraw; return (void *)NULL; } @@ -279,20 +257,7 @@ LookupWindow(XID rid, ClientPtr client) client->errorValue = rid; if(rid == INVALID) return NULL; - if (client->lastDrawableID == rid) - { - if (client->lastDrawable->type == DRAWABLE_WINDOW) - return ((WindowPtr) client->lastDrawable); - return (WindowPtr) NULL; - } - pWin = (WindowPtr)LookupIDByType(rid, RT_WINDOW); - if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) { - client->lastDrawable = (DrawablePtr) pWin; - client->lastDrawableID = rid; - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - return pWin; + return (WindowPtr)LookupIDByType(rid, RT_WINDOW); } @@ -303,8 +268,6 @@ LookupDrawable(XID rid, ClientPtr client) if(rid == INVALID) return (void *) NULL; - if (client->lastDrawableID == rid) - return ((void *) client->lastDrawable); pDraw = (DrawablePtr)LookupIDByClass(rid, RC_DRAWABLE); if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) return (void *)pDraw; diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index 0b08b46a9..58f6c6eb0 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -91,15 +91,11 @@ SOFTWARE. /* XXX if you are using this macro, you are probably not generating Match * errors where appropriate */ #define LOOKUP_DRAWABLE(did, client)\ - ((client->lastDrawableID == did) ? \ - client->lastDrawable : (DrawablePtr)LookupDrawable(did, client)) + ((DrawablePtr)LookupDrawable(did, client)) #ifdef XCSECURITY #define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\ - if (client->lastDrawableID == did && !client->trustLevel)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \ RC_DRAWABLE, mode);\ @@ -113,9 +109,6 @@ SOFTWARE. } #define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\ - if (client->lastDrawableID == did && !client->trustLevel)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \ RC_DRAWABLE, mode);\ @@ -127,10 +120,7 @@ SOFTWARE. } #define SECURITY_VERIFY_GC(pGC, rid, client, mode)\ - if (client->lastGCID == rid && !client->trustLevel)\ - pGC = client->lastGC;\ - else\ - pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\ + pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\ if (!pGC)\ {\ client->errorValue = rid;\ @@ -149,9 +139,6 @@ SOFTWARE. #else /* not XCSECURITY */ #define VERIFY_DRAWABLE(pDraw, did, client)\ - if (client->lastDrawableID == did)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\ if (!pDraw) \ @@ -164,9 +151,6 @@ SOFTWARE. } #define VERIFY_GEOMETRABLE(pDraw, did, client)\ - if (client->lastDrawableID == did)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\ if (!pDraw) \ @@ -177,10 +161,7 @@ SOFTWARE. } #define VERIFY_GC(pGC, rid, client)\ - if (client->lastGCID == rid)\ - pGC = client->lastGC;\ - else\ - pGC = (GC *)LookupIDByType(rid, RT_GC);\ + pGC = (GC *)LookupIDByType(rid, RT_GC);\ if (!pGC)\ {\ client->errorValue = rid;\ @@ -252,23 +233,12 @@ SOFTWARE. #endif /* NEED_DBE_BUF_BITS */ #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\ - if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\ - (client->lastDrawableID != drawID))\ {\ SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, DixWriteAccess);\ SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);\ if ((pGC->depth != pDraw->depth) ||\ (pGC->pScreen != pDraw->pScreen))\ return (BadMatch);\ - client->lastDrawable = pDraw;\ - client->lastDrawableID = drawID;\ - client->lastGC = pGC;\ - client->lastGCID = stuff->gc;\ - }\ - else\ - {\ - pGC = client->lastGC;\ - pDraw = client->lastDrawable;\ }\ SET_DBE_DSTBUF(pDraw, drawID);\ if (pGC->serialNumber != pDraw->serialNumber)\ @@ -325,8 +295,6 @@ extern void UpdateCurrentTimeIf(void); extern void InitSelections(void); -extern void FlushClientCaches(XID /*id*/); - extern int dixDestroyPixmap( void * /*value*/, XID /*pid*/); diff --git a/nx-X11/programs/Xserver/include/dixstruct.h b/nx-X11/programs/Xserver/include/dixstruct.h index ca50c7ca7..3c97e5bb7 100644 --- a/nx-X11/programs/Xserver/include/dixstruct.h +++ b/nx-X11/programs/Xserver/include/dixstruct.h @@ -101,10 +101,6 @@ typedef struct _Client { int clientGone; int noClientException; /* this client died or needs to be * killed */ - DrawablePtr lastDrawable; - Drawable lastDrawableID; - GCPtr lastGC; - GContext lastGCID; SaveSetElt *saveSet; int numSaved; void *screenPrivate[MAXSCREENS]; diff --git a/nx-X11/programs/Xserver/include/resource.h b/nx-X11/programs/Xserver/include/resource.h index 164e7ccfc..30ae624fb 100644 --- a/nx-X11/programs/Xserver/include/resource.h +++ b/nx-X11/programs/Xserver/include/resource.h @@ -71,9 +71,9 @@ typedef unsigned long RESTYPE; /* types for Resource routines */ -#define RT_WINDOW ((RESTYPE)1|RC_CACHED|RC_DRAWABLE) -#define RT_PIXMAP ((RESTYPE)2|RC_CACHED|RC_DRAWABLE) -#define RT_GC ((RESTYPE)3|RC_CACHED) +#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE) +#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE) +#define RT_GC ((RESTYPE)3) #undef RT_FONT #undef RT_CURSOR #define RT_FONT ((RESTYPE)4) -- cgit v1.2.3 From 095ba65b0320be5ac864245c99da1a94f83d96eb Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 24 Feb 2017 22:22:47 +0000 Subject: release 3.5.99.4 --- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 769367c54..af5fc88f8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -24,7 +24,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .ds q \N'34' -.TH NXAGENT 1 3.6.x +.TH nxagent 1 "Feb 2017" "Version 3.6.x" "NX Agent (Xserver)" .SH NAME nxagent \- nx-X11 Agent (nested Xserver optimized for remote computing) .SH SYNOPSIS -- cgit v1.2.3 From 7e99ae37541b48b61fe81230c5920b1a355cf67f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 6 Feb 2017 15:19:47 +0100 Subject: Xserver/os/oscolor.c: Follow X.org in dropping the rgb.txt file entirely. Content of that file is now hard-coded. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 which seems unneeded. We drop that one line from oscolor.c. Fixes ArcticaProject/nx-libs#259. --- nx-X11/programs/Xserver/Imakefile | 5 +- nx-X11/programs/Xserver/dix/Imakefile | 8 +- nx-X11/programs/Xserver/dix/globals.c | 1 - nx-X11/programs/Xserver/include/globals.h | 1 - nx-X11/programs/Xserver/include/os.h | 1 - nx-X11/programs/Xserver/include/site.h | 12 +- nx-X11/programs/Xserver/os/Imakefile | 12 +- nx-X11/programs/Xserver/os/oscolor.c | 2037 +++++++++++++++++++++++------ nx-X11/programs/Xserver/os/osinit.c | 3 - nx-X11/programs/Xserver/os/utils.c | 8 - 10 files changed, 1617 insertions(+), 471 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index fe70d007a..a18f04108 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -160,10 +160,7 @@ INSTPGMFLAGS = #if HasPam && HasPamMisc PAMLIBS = PamLibraries PamMiscLibraries #endif -#if !(SystemV4 || UseRgbTxt) - DBMLIBS = DBMLibrary -#endif - SYSLIBS = $(ZLIB) MathLibrary $(DBMLIBS) $(USB) \ + SYSLIBS = $(ZLIB) MathLibrary $(USB) \ $(PAMLIBS) $(EXTRASYSLIBS) #if !HasCbrt CBRT = mi/LibraryTargetName(cbrt) diff --git a/nx-X11/programs/Xserver/dix/Imakefile b/nx-X11/programs/Xserver/dix/Imakefile index 7acd1b45c..1024de965 100644 --- a/nx-X11/programs/Xserver/dix/Imakefile +++ b/nx-X11/programs/Xserver/dix/Imakefile @@ -91,7 +91,6 @@ OBJS = \ * .macros files or site.def in the directory util/imake.includes/: * * DefaultFontPath COMPILEDDEFAULTFONTPATH - * DefaultRGBDatabase RGB_DB * * The sample util/imake.includes/Imake.tmpl will provide generic defaults. * The values in site.h are simply a last line of defense and should not be @@ -103,11 +102,6 @@ DEFAULTFONTPATH = DefaultFontPath SITE_FONT_PATH = -DCOMPILEDDEFAULTFONTPATH=\"$(DEFAULTFONTPATH)\" #endif -#ifdef DefaultRGBDatabase -DEFAULTRGBDATABASE = DefaultRGBDatabase - SITE_RGB_DB = -DRGB_DB=\"$(DEFAULTRGBDATABASE)\" -#endif - #ifdef DefaultDisplayClass DEFAULTDISPLAYCLASS = DefaultDisplayClass SITE_DISPLAY_CLASS = -DCOMPILEDDISPLAYCLASS=\"$(DEFAULTDISPLAYCLASS)\" @@ -129,7 +123,7 @@ VENDORRELEASE = XVendorRelease #endif #endif -SITE_DEFINES = $(SITE_FONT_PATH) $(SITE_RGB_DB) $(SITE_DISPLAY_CLASS) +SITE_DEFINES = $(SITE_FONT_PATH) $(SITE_DISPLAY_CLASS) VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) $(QUARTZ_DEFINES) diff --git a/nx-X11/programs/Xserver/dix/globals.c b/nx-X11/programs/Xserver/dix/globals.c index 5a2819e50..a0af50fa8 100644 --- a/nx-X11/programs/Xserver/dix/globals.c +++ b/nx-X11/programs/Xserver/dix/globals.c @@ -130,7 +130,6 @@ int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER; char *defaultFontPath = COMPILEDDEFAULTFONTPATH; char *defaultTextFont = COMPILEDDEFAULTFONT; char *defaultCursorFont = COMPILEDCURSORFONT; -char *rgbPath = RGB_DB; char *defaultDisplayClass = COMPILEDDISPLAYCLASS; FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in every compilation of dix code */ diff --git a/nx-X11/programs/Xserver/include/globals.h b/nx-X11/programs/Xserver/include/globals.h index 6bc31d8e7..1c4d73e64 100644 --- a/nx-X11/programs/Xserver/include/globals.h +++ b/nx-X11/programs/Xserver/include/globals.h @@ -12,7 +12,6 @@ extern CARD32 ScreenSaverTime; extern CARD32 ScreenSaverInterval; extern char *defaultFontPath; -extern char *rgbPath; extern int monitorResolution; extern Bool loadableFonts; extern int defaultColorVisualClass; diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 881abfccb..a53f0d4c8 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -94,7 +94,6 @@ typedef struct _NewClientRec *NewClientPtr; #define SIGVAL void #endif -extern Bool OsDelayInitColors; extern void (*OsVendorVErrorFProc)(const char *, va_list args); extern int WaitForSomething( diff --git a/nx-X11/programs/Xserver/include/site.h b/nx-X11/programs/Xserver/include/site.h index 5b9f25815..c8dfe69a6 100644 --- a/nx-X11/programs/Xserver/include/site.h +++ b/nx-X11/programs/Xserver/include/site.h @@ -65,19 +65,15 @@ SOFTWARE. #endif /* - * The following constants are provided solely as a last line of defense. The - * normal build ALWAYS overrides them using a special rule given in - * server/dix/Imakefile. If you want to change either of these constants, - * you should set the DefaultFontPath or DefaultRGBDatabase configuration - * parameters. + * The following constant is provided solely as a last line of defense. The + * normal build ALWAYS overrides it using a special rule given in + * server/dix/Imakefile. If you want to change this constant, you should set + * the DefaultFontPath configuration parameter. * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! */ #ifndef COMPILEDDEFAULTFONTPATH #define COMPILEDDEFAULTFONTPATH "/usr/lib/X11/fonts/misc/" #endif -#ifndef RGB_DB -#define RGB_DB "/usr/lib/X11/rgb" -#endif /* * The following constants contain default values for all of the variables diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index d381ac272..26d9c6dff 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -125,10 +125,6 @@ BOOTSTRAPCFLAGS = #if UseMemLeak MEM_DEFINES = -DMEMBUG #endif -#if UseRgbTxt - RGB_DEFINES = -DUSE_RGB_TXT -#endif - DBM_DEFINES = NdbmDefines ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\" XDMCP_DEFINES = ServerXdmcpDefines ERROR_DEFINES = ServerErrorDefines @@ -139,14 +135,14 @@ BOOTSTRAPCFLAGS = DEFINES = $(CONNECTION_FLAGS) $(MEM_DEFINES) \ $(XDMAUTHDEFS) $(RPCDEFS) $(SIGNAL_DEFINES) $(OS_DEFINES) \ - $(RGB_DEFINES) $(GETPEER_DEFINES) \ + $(GETPEER_DEFINES) \ $(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) \ $(XTRANS_DEFINES) $(NX_DEFINES) INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(TOP)/lib/Xau $(NX_INCLUDES) \ `pkg-config --cflags-only-I pixman-1` - DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \ + DEPEND_DEFINES = $(XDMCP_DEFINES) $(EXT_DEFINES) \ $(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \ DependDefines LINTLIBS = ../dix/llib-ldix.ln @@ -182,9 +178,7 @@ SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR #if defined(SparcArchitecture) && HasGcc && !HasGcc2 oscolor.o: oscolor.c $(ICONFIGFILES) $(RM) $@ - cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c -#else -SpecialCObjectRule(oscolor,$(ICONFIGFILES),$(DBM_DEFINES)) + cc -c $(CDEBUGFLAGS) $(ALLDEFINES) $*.c #endif #if !HasSnprintf diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c index 88b243d65..70940653f 100644 --- a/nx-X11/programs/Xserver/os/oscolor.c +++ b/nx-X11/programs/Xserver/os/oscolor.c @@ -22,18 +22,17 @@ Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. - Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -45,438 +44,1618 @@ SOFTWARE. ******************************************************************/ -#ifdef NX_TRANS_SOCKET - -#include -#include -#include - -/* FIXME: we need more intelligent code (like provided by the nxagentX2go - * var in hw/nxagent/Init.h) to detect our current runtime mode (running - * as x2goagent, running as nxagent) - */ -static char* nxAltRgbPaths[] = {"/etc/x2go/rgb", \ - "/usr/share/x2go/rgb", \ - "/usr/local/share/x2go/rgb", \ - "/etc/nxagent/rgb", \ - "/usr/share/nx/rgb", \ - "/usr/local/share/nx/rgb", \ - "/usr/NX/share/rgb", \ - "/usr/share/X11/rgb", \ - "/etc/X11/rgb"}; -static char _NXRgbPath[1024]; - -#endif - #ifdef HAVE_DIX_CONFIG_H #include #endif -#ifndef USE_RGB_TXT - -#ifdef NDBM -#include -#else -#ifdef SVR4 -#include -#else -#include -#endif -#endif -#include "rgb.h" #include "os.h" -#include "opaque.h" - -/* Note that we are assuming there is only one database for all the screens. */ - -#ifdef NDBM -DBM *rgb_dbm = (DBM *)NULL; -#else -int rgb_dbm = 0; -#endif - -extern void CopyISOLatin1Lowered( - char * /*dest*/, - const char * /*source*/, - int /*length*/); - -int -OsInitColors(void) -{ - if (!rgb_dbm) - { -#ifdef NDBM - rgb_dbm = dbm_open(rgbPath, 0, 0); -#else - if (dbminit(rgbPath) == 0) - rgb_dbm = 1; -#endif - if (!rgb_dbm) { - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - return FALSE; - } - } - return TRUE; -} - -/*ARGSUSED*/ -int -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - datum dbent; - RGB rgb; - char buf[64]; - char *lowername; - - if(!rgb_dbm) - return(0); - - /* we use malloc here so that we can compile with cc without alloca - * when otherwise using gcc */ - if (len < sizeof(buf)) - lowername = buf; - else if (!(lowername = (char *)malloc(len + 1))) - return(0); - CopyISOLatin1Lowered ((unsigned char *) lowername, (unsigned char *) name, - (int)len); - - dbent.dptr = lowername; - dbent.dsize = len; -#ifdef NDBM - dbent = dbm_fetch(rgb_dbm, dbent); -#else - dbent = fetch (dbent); -#endif - - if (len >= sizeof(buf)) - free(lowername); - - if(dbent.dptr) - { - memmove((char *) &rgb, dbent.dptr, sizeof (RGB)); - *pred = rgb.red; - *pgreen = rgb.green; - *pblue = rgb.blue; - return (1); - } - return(0); -} - -#else /* USE_RGB_TXT */ - - -/* - * The dbm routines are a porting hassle. This implementation will do - * the same thing by reading the rgb.txt file directly, which is much - * more portable. - */ - -#include -#include "os.h" -#include "opaque.h" - -#define HASHSIZE 511 - -typedef struct _dbEntry * dbEntryPtr; -typedef struct _dbEntry { - dbEntryPtr link; - unsigned short red; - unsigned short green; - unsigned short blue; - char name[1]; /* some compilers complain if [0] */ -} dbEntry; - - -extern void CopyISOLatin1Lowered( - char * /*dest*/, - const char * /*source*/, - int /*length*/); - -static dbEntryPtr hashTab[HASHSIZE]; - -#ifdef NX_TRANS_SOCKET - -static int NXVerifyRgbPath(char *path) -{ - int size; - char *rgbPath; - struct stat rgbFileStat; - - /* - * Check if rgb file is present. - */ - - size = strlen(path) + strlen(".txt") + 1; - - rgbPath = (char *) ALLOCATE_LOCAL(size + 1); - - strcpy(rgbPath, path); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Looking for [%s] file.\n", - rgbPath); - #endif - - if (stat(rgbPath, &rgbFileStat) != 0) - { - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Can't find the rgb file [%s].\n", - rgbPath); - #endif - - strcat(rgbPath, ".txt"); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Looking for [%s] file.\n", - rgbPath); - #endif - - if (stat(rgbPath, &rgbFileStat) != 0) - { - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Can't find the rgb file [%s].\n", - rgbPath); - #endif - - DEALLOCATE_LOCAL(rgbPath); - - return 0; - } - } - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: rgb path [%s] is valid.\n", - path); - #endif - - DEALLOCATE_LOCAL(rgbPath); - - return 1; -} - -static const char *_NXGetRgbPath(const char *path) -{ - const char *systemEnv; - char rgbPath[1024]; - int numAltRgbPaths; - int i; - - /* - * Check the environment only once. - */ - - if (*_NXRgbPath != '\0') - { - return _NXRgbPath; - } - - systemEnv = getenv("NX_SYSTEM"); - - if (systemEnv != NULL && *systemEnv != '\0') - { - if (strlen(systemEnv) + strlen("/share/rgb") + 1 > 1024) - { - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: WARNING! Maximum length of rgb file path exceeded.\n"); - #endif - - goto _NXGetRgbPathError; - } - - strcpy(rgbPath, systemEnv); - strcat(rgbPath, "/share/rgb"); - - if (NXVerifyRgbPath(rgbPath) == 1) - { - strcpy(_NXRgbPath, systemEnv); - strcat(_NXRgbPath, "/share/rgb"); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: Using rgb file path [%s].\n", - _NXRgbPath); - #endif - - return _NXRgbPath; - } - } - - numAltRgbPaths = sizeof(nxAltRgbPaths) / sizeof(*nxAltRgbPaths); - - for (i = 0; i < numAltRgbPaths; i++) - { - if (NXVerifyRgbPath(nxAltRgbPaths[i]) == 1) - { - if (strlen(nxAltRgbPaths[i]) + 1 > 1024) - { - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: WARNING! Maximum length of rgb file path exceeded.\n"); - #endif - - goto _NXGetRgbPathError; - } - - strcpy(_NXRgbPath, nxAltRgbPaths[i]); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: Using rgb file path [%s].\n", - _NXRgbPath); - #endif - - return _NXRgbPath; - } - } - -_NXGetRgbPathError: - - strcpy(_NXRgbPath, path); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: Using default rgb file path [%s].\n", - _NXRgbPath); - #endif - - return _NXRgbPath; -} - -#endif - -static dbEntryPtr -lookup(char *name, int len, Bool create) -{ - unsigned int h = 0, g; - dbEntryPtr entry, *prev = NULL; - char *str = name; - - if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL; - CopyISOLatin1Lowered(name, str, len); - name[len] = '\0'; - - for(str = name; *str; str++) { - h = (h << 4) + *str; - if ((g = h) & 0xf0000000) h ^= (g >> 24); - h &= g; - } - h %= HASHSIZE; - - if ( (entry = hashTab[h]) ) - { - for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link ) - if (! strcmp(name, entry->name) ) break; - } - else - prev = &(hashTab[h]); - - if (!entry && create && (entry = (dbEntryPtr)malloc(sizeof(dbEntry) +len))) - { - *prev = entry; - entry->link = NULL; - strcpy( entry->name, name ); - } - - DEALLOCATE_LOCAL(name); - - return entry; -} +typedef struct _builtinColor { + unsigned char red; + unsigned char green; + unsigned char blue; + unsigned short name; +} BuiltinColor; + +static const char BuiltinColorNames[] = { + "alice blue\0" + "AliceBlue\0" + "antique white\0" + "AntiqueWhite\0" + "AntiqueWhite1\0" + "AntiqueWhite2\0" + "AntiqueWhite3\0" + "AntiqueWhite4\0" + "aqua\0" + "aquamarine\0" + "aquamarine1\0" + "aquamarine2\0" + "aquamarine3\0" + "aquamarine4\0" + "azure\0" + "azure1\0" + "azure2\0" + "azure3\0" + "azure4\0" + "beige\0" + "bisque\0" + "bisque1\0" + "bisque2\0" + "bisque3\0" + "bisque4\0" + "black\0" + "blanched almond\0" + "BlanchedAlmond\0" + "blue\0" + "blue violet\0" + "blue1\0" + "blue2\0" + "blue3\0" + "blue4\0" + "BlueViolet\0" + "brown\0" + "brown1\0" + "brown2\0" + "brown3\0" + "brown4\0" + "burlywood\0" + "burlywood1\0" + "burlywood2\0" + "burlywood3\0" + "burlywood4\0" + "cadet blue\0" + "CadetBlue\0" + "CadetBlue1\0" + "CadetBlue2\0" + "CadetBlue3\0" + "CadetBlue4\0" + "chartreuse\0" + "chartreuse1\0" + "chartreuse2\0" + "chartreuse3\0" + "chartreuse4\0" + "chocolate\0" + "chocolate1\0" + "chocolate2\0" + "chocolate3\0" + "chocolate4\0" + "coral\0" + "coral1\0" + "coral2\0" + "coral3\0" + "coral4\0" + "cornflower blue\0" + "CornflowerBlue\0" + "cornsilk\0" + "cornsilk1\0" + "cornsilk2\0" + "cornsilk3\0" + "cornsilk4\0" + "crimson\0" + "cyan\0" + "cyan1\0" + "cyan2\0" + "cyan3\0" + "cyan4\0" + "dark blue\0" + "dark cyan\0" + "dark goldenrod\0" + "dark gray\0" + "dark green\0" + "dark grey\0" + "dark khaki\0" + "dark magenta\0" + "dark olive green\0" + "dark orange\0" + "dark orchid\0" + "dark red\0" + "dark salmon\0" + "dark sea green\0" + "dark slate blue\0" + "dark slate gray\0" + "dark slate grey\0" + "dark turquoise\0" + "dark violet\0" + "DarkBlue\0" + "DarkCyan\0" + "DarkGoldenrod\0" + "DarkGoldenrod1\0" + "DarkGoldenrod2\0" + "DarkGoldenrod3\0" + "DarkGoldenrod4\0" + "DarkGray\0" + "DarkGreen\0" + "DarkGrey\0" + "DarkKhaki\0" + "DarkMagenta\0" + "DarkOliveGreen\0" + "DarkOliveGreen1\0" + "DarkOliveGreen2\0" + "DarkOliveGreen3\0" + "DarkOliveGreen4\0" + "DarkOrange\0" + "DarkOrange1\0" + "DarkOrange2\0" + "DarkOrange3\0" + "DarkOrange4\0" + "DarkOrchid\0" + "DarkOrchid1\0" + "DarkOrchid2\0" + "DarkOrchid3\0" + "DarkOrchid4\0" + "DarkRed\0" + "DarkSalmon\0" + "DarkSeaGreen\0" + "DarkSeaGreen1\0" + "DarkSeaGreen2\0" + "DarkSeaGreen3\0" + "DarkSeaGreen4\0" + "DarkSlateBlue\0" + "DarkSlateGray\0" + "DarkSlateGray1\0" + "DarkSlateGray2\0" + "DarkSlateGray3\0" + "DarkSlateGray4\0" + "DarkSlateGrey\0" + "DarkTurquoise\0" + "DarkViolet\0" + "deep pink\0" + "deep sky blue\0" + "DeepPink\0" + "DeepPink1\0" + "DeepPink2\0" + "DeepPink3\0" + "DeepPink4\0" + "DeepSkyBlue\0" + "DeepSkyBlue1\0" + "DeepSkyBlue2\0" + "DeepSkyBlue3\0" + "DeepSkyBlue4\0" + "dim gray\0" + "dim grey\0" + "DimGray\0" + "DimGrey\0" + "dodger blue\0" + "DodgerBlue\0" + "DodgerBlue1\0" + "DodgerBlue2\0" + "DodgerBlue3\0" + "DodgerBlue4\0" + "firebrick\0" + "firebrick1\0" + "firebrick2\0" + "firebrick3\0" + "firebrick4\0" + "floral white\0" + "FloralWhite\0" + "forest green\0" + "ForestGreen\0" + "fuchsia\0" + "gainsboro\0" + "ghost white\0" + "GhostWhite\0" + "gold\0" + "gold1\0" + "gold2\0" + "gold3\0" + "gold4\0" + "goldenrod\0" + "goldenrod1\0" + "goldenrod2\0" + "goldenrod3\0" + "goldenrod4\0" + "gray\0" + "gray0\0" + "gray1\0" + "gray10\0" + "gray100\0" + "gray11\0" + "gray12\0" + "gray13\0" + "gray14\0" + "gray15\0" + "gray16\0" + "gray17\0" + "gray18\0" + "gray19\0" + "gray2\0" + "gray20\0" + "gray21\0" + "gray22\0" + "gray23\0" + "gray24\0" + "gray25\0" + "gray26\0" + "gray27\0" + "gray28\0" + "gray29\0" + "gray3\0" + "gray30\0" + "gray31\0" + "gray32\0" + "gray33\0" + "gray34\0" + "gray35\0" + "gray36\0" + "gray37\0" + "gray38\0" + "gray39\0" + "gray4\0" + "gray40\0" + "gray41\0" + "gray42\0" + "gray43\0" + "gray44\0" + "gray45\0" + "gray46\0" + "gray47\0" + "gray48\0" + "gray49\0" + "gray5\0" + "gray50\0" + "gray51\0" + "gray52\0" + "gray53\0" + "gray54\0" + "gray55\0" + "gray56\0" + "gray57\0" + "gray58\0" + "gray59\0" + "gray6\0" + "gray60\0" + "gray61\0" + "gray62\0" + "gray63\0" + "gray64\0" + "gray65\0" + "gray66\0" + "gray67\0" + "gray68\0" + "gray69\0" + "gray7\0" + "gray70\0" + "gray71\0" + "gray72\0" + "gray73\0" + "gray74\0" + "gray75\0" + "gray76\0" + "gray77\0" + "gray78\0" + "gray79\0" + "gray8\0" + "gray80\0" + "gray81\0" + "gray82\0" + "gray83\0" + "gray84\0" + "gray85\0" + "gray86\0" + "gray87\0" + "gray88\0" + "gray89\0" + "gray9\0" + "gray90\0" + "gray91\0" + "gray92\0" + "gray93\0" + "gray94\0" + "gray95\0" + "gray96\0" + "gray97\0" + "gray98\0" + "gray99\0" + "green\0" + "green yellow\0" + "green1\0" + "green2\0" + "green3\0" + "green4\0" + "GreenYellow\0" + "grey\0" + "grey0\0" + "grey1\0" + "grey10\0" + "grey100\0" + "grey11\0" + "grey12\0" + "grey13\0" + "grey14\0" + "grey15\0" + "grey16\0" + "grey17\0" + "grey18\0" + "grey19\0" + "grey2\0" + "grey20\0" + "grey21\0" + "grey22\0" + "grey23\0" + "grey24\0" + "grey25\0" + "grey26\0" + "grey27\0" + "grey28\0" + "grey29\0" + "grey3\0" + "grey30\0" + "grey31\0" + "grey32\0" + "grey33\0" + "grey34\0" + "grey35\0" + "grey36\0" + "grey37\0" + "grey38\0" + "grey39\0" + "grey4\0" + "grey40\0" + "grey41\0" + "grey42\0" + "grey43\0" + "grey44\0" + "grey45\0" + "grey46\0" + "grey47\0" + "grey48\0" + "grey49\0" + "grey5\0" + "grey50\0" + "grey51\0" + "grey52\0" + "grey53\0" + "grey54\0" + "grey55\0" + "grey56\0" + "grey57\0" + "grey58\0" + "grey59\0" + "grey6\0" + "grey60\0" + "grey61\0" + "grey62\0" + "grey63\0" + "grey64\0" + "grey65\0" + "grey66\0" + "grey67\0" + "grey68\0" + "grey69\0" + "grey7\0" + "grey70\0" + "grey71\0" + "grey72\0" + "grey73\0" + "grey74\0" + "grey75\0" + "grey76\0" + "grey77\0" + "grey78\0" + "grey79\0" + "grey8\0" + "grey80\0" + "grey81\0" + "grey82\0" + "grey83\0" + "grey84\0" + "grey85\0" + "grey86\0" + "grey87\0" + "grey88\0" + "grey89\0" + "grey9\0" + "grey90\0" + "grey91\0" + "grey92\0" + "grey93\0" + "grey94\0" + "grey95\0" + "grey96\0" + "grey97\0" + "grey98\0" + "grey99\0" + "honeydew\0" + "honeydew1\0" + "honeydew2\0" + "honeydew3\0" + "honeydew4\0" + "hot pink\0" + "HotPink\0" + "HotPink1\0" + "HotPink2\0" + "HotPink3\0" + "HotPink4\0" + "indian red\0" + "IndianRed\0" + "IndianRed1\0" + "IndianRed2\0" + "IndianRed3\0" + "IndianRed4\0" + "indigo\0" + "ivory\0" + "ivory1\0" + "ivory2\0" + "ivory3\0" + "ivory4\0" + "khaki\0" + "khaki1\0" + "khaki2\0" + "khaki3\0" + "khaki4\0" + "lavender\0" + "lavender blush\0" + "LavenderBlush\0" + "LavenderBlush1\0" + "LavenderBlush2\0" + "LavenderBlush3\0" + "LavenderBlush4\0" + "lawn green\0" + "LawnGreen\0" + "lemon chiffon\0" + "LemonChiffon\0" + "LemonChiffon1\0" + "LemonChiffon2\0" + "LemonChiffon3\0" + "LemonChiffon4\0" + "light blue\0" + "light coral\0" + "light cyan\0" + "light goldenrod\0" + "light goldenrod yellow\0" + "light gray\0" + "light green\0" + "light grey\0" + "light pink\0" + "light salmon\0" + "light sea green\0" + "light sky blue\0" + "light slate blue\0" + "light slate gray\0" + "light slate grey\0" + "light steel blue\0" + "light yellow\0" + "LightBlue\0" + "LightBlue1\0" + "LightBlue2\0" + "LightBlue3\0" + "LightBlue4\0" + "LightCoral\0" + "LightCyan\0" + "LightCyan1\0" + "LightCyan2\0" + "LightCyan3\0" + "LightCyan4\0" + "LightGoldenrod\0" + "LightGoldenrod1\0" + "LightGoldenrod2\0" + "LightGoldenrod3\0" + "LightGoldenrod4\0" + "LightGoldenrodYellow\0" + "LightGray\0" + "LightGreen\0" + "LightGrey\0" + "LightPink\0" + "LightPink1\0" + "LightPink2\0" + "LightPink3\0" + "LightPink4\0" + "LightSalmon\0" + "LightSalmon1\0" + "LightSalmon2\0" + "LightSalmon3\0" + "LightSalmon4\0" + "LightSeaGreen\0" + "LightSkyBlue\0" + "LightSkyBlue1\0" + "LightSkyBlue2\0" + "LightSkyBlue3\0" + "LightSkyBlue4\0" + "LightSlateBlue\0" + "LightSlateGray\0" + "LightSlateGrey\0" + "LightSteelBlue\0" + "LightSteelBlue1\0" + "LightSteelBlue2\0" + "LightSteelBlue3\0" + "LightSteelBlue4\0" + "LightYellow\0" + "LightYellow1\0" + "LightYellow2\0" + "LightYellow3\0" + "LightYellow4\0" + "lime\0" + "lime green\0" + "LimeGreen\0" + "linen\0" + "magenta\0" + "magenta1\0" + "magenta2\0" + "magenta3\0" + "magenta4\0" + "maroon\0" + "maroon1\0" + "maroon2\0" + "maroon3\0" + "maroon4\0" + "medium aquamarine\0" + "medium blue\0" + "medium orchid\0" + "medium purple\0" + "medium sea green\0" + "medium slate blue\0" + "medium spring green\0" + "medium turquoise\0" + "medium violet red\0" + "MediumAquamarine\0" + "MediumBlue\0" + "MediumOrchid\0" + "MediumOrchid1\0" + "MediumOrchid2\0" + "MediumOrchid3\0" + "MediumOrchid4\0" + "MediumPurple\0" + "MediumPurple1\0" + "MediumPurple2\0" + "MediumPurple3\0" + "MediumPurple4\0" + "MediumSeaGreen\0" + "MediumSlateBlue\0" + "MediumSpringGreen\0" + "MediumTurquoise\0" + "MediumVioletRed\0" + "midnight blue\0" + "MidnightBlue\0" + "mint cream\0" + "MintCream\0" + "misty rose\0" + "MistyRose\0" + "MistyRose1\0" + "MistyRose2\0" + "MistyRose3\0" + "MistyRose4\0" + "moccasin\0" + "navajo white\0" + "NavajoWhite\0" + "NavajoWhite1\0" + "NavajoWhite2\0" + "NavajoWhite3\0" + "NavajoWhite4\0" + "navy\0" + "navy blue\0" + "NavyBlue\0" + "old lace\0" + "OldLace\0" + "olive\0" + "olive drab\0" + "OliveDrab\0" + "OliveDrab1\0" + "OliveDrab2\0" + "OliveDrab3\0" + "OliveDrab4\0" + "orange\0" + "orange red\0" + "orange1\0" + "orange2\0" + "orange3\0" + "orange4\0" + "OrangeRed\0" + "OrangeRed1\0" + "OrangeRed2\0" + "OrangeRed3\0" + "OrangeRed4\0" + "orchid\0" + "orchid1\0" + "orchid2\0" + "orchid3\0" + "orchid4\0" + "pale goldenrod\0" + "pale green\0" + "pale turquoise\0" + "pale violet red\0" + "PaleGoldenrod\0" + "PaleGreen\0" + "PaleGreen1\0" + "PaleGreen2\0" + "PaleGreen3\0" + "PaleGreen4\0" + "PaleTurquoise\0" + "PaleTurquoise1\0" + "PaleTurquoise2\0" + "PaleTurquoise3\0" + "PaleTurquoise4\0" + "PaleVioletRed\0" + "PaleVioletRed1\0" + "PaleVioletRed2\0" + "PaleVioletRed3\0" + "PaleVioletRed4\0" + "papaya whip\0" + "PapayaWhip\0" + "peach puff\0" + "PeachPuff\0" + "PeachPuff1\0" + "PeachPuff2\0" + "PeachPuff3\0" + "PeachPuff4\0" + "peru\0" + "pink\0" + "pink1\0" + "pink2\0" + "pink3\0" + "pink4\0" + "plum\0" + "plum1\0" + "plum2\0" + "plum3\0" + "plum4\0" + "powder blue\0" + "PowderBlue\0" + "purple\0" + "purple1\0" + "purple2\0" + "purple3\0" + "purple4\0" + "rebecca purple\0" + "RebeccaPurple\0" + "red\0" + "red1\0" + "red2\0" + "red3\0" + "red4\0" + "rosy brown\0" + "RosyBrown\0" + "RosyBrown1\0" + "RosyBrown2\0" + "RosyBrown3\0" + "RosyBrown4\0" + "royal blue\0" + "RoyalBlue\0" + "RoyalBlue1\0" + "RoyalBlue2\0" + "RoyalBlue3\0" + "RoyalBlue4\0" + "saddle brown\0" + "SaddleBrown\0" + "salmon\0" + "salmon1\0" + "salmon2\0" + "salmon3\0" + "salmon4\0" + "sandy brown\0" + "SandyBrown\0" + "sea green\0" + "SeaGreen\0" + "SeaGreen1\0" + "SeaGreen2\0" + "SeaGreen3\0" + "SeaGreen4\0" + "seashell\0" + "seashell1\0" + "seashell2\0" + "seashell3\0" + "seashell4\0" + "sienna\0" + "sienna1\0" + "sienna2\0" + "sienna3\0" + "sienna4\0" + "silver\0" + "sky blue\0" + "SkyBlue\0" + "SkyBlue1\0" + "SkyBlue2\0" + "SkyBlue3\0" + "SkyBlue4\0" + "slate blue\0" + "slate gray\0" + "slate grey\0" + "SlateBlue\0" + "SlateBlue1\0" + "SlateBlue2\0" + "SlateBlue3\0" + "SlateBlue4\0" + "SlateGray\0" + "SlateGray1\0" + "SlateGray2\0" + "SlateGray3\0" + "SlateGray4\0" + "SlateGrey\0" + "snow\0" + "snow1\0" + "snow2\0" + "snow3\0" + "snow4\0" + "spring green\0" + "SpringGreen\0" + "SpringGreen1\0" + "SpringGreen2\0" + "SpringGreen3\0" + "SpringGreen4\0" + "steel blue\0" + "SteelBlue\0" + "SteelBlue1\0" + "SteelBlue2\0" + "SteelBlue3\0" + "SteelBlue4\0" + "tan\0" + "tan1\0" + "tan2\0" + "tan3\0" + "tan4\0" + "teal\0" + "thistle\0" + "thistle1\0" + "thistle2\0" + "thistle3\0" + "thistle4\0" + "tomato\0" + "tomato1\0" + "tomato2\0" + "tomato3\0" + "tomato4\0" + "turquoise\0" + "turquoise1\0" + "turquoise2\0" + "turquoise3\0" + "turquoise4\0" + "violet\0" + "violet red\0" + "VioletRed\0" + "VioletRed1\0" + "VioletRed2\0" + "VioletRed3\0" + "VioletRed4\0" + "web gray\0" + "web green\0" + "web grey\0" + "web maroon\0" + "web purple\0" + "WebGray\0" + "WebGreen\0" + "WebGrey\0" + "WebMaroon\0" + "WebPurple\0" + "wheat\0" + "wheat1\0" + "wheat2\0" + "wheat3\0" + "wheat4\0" + "white\0" + "white smoke\0" + "WhiteSmoke\0" + "x11 gray\0" + "x11 green\0" + "x11 grey\0" + "x11 maroon\0" + "x11 purple\0" + "X11Gray\0" + "X11Green\0" + "X11Grey\0" + "X11Maroon\0" + "X11Purple\0" + "yellow\0" + "yellow green\0" + "yellow1\0" + "yellow2\0" + "yellow3\0" + "yellow4\0" + "YellowGreen\0" +}; + +static const BuiltinColor BuiltinColors[] = { + {240, 248, 255, 0}, /* alice blue */ + {240, 248, 255, 11}, /* AliceBlue */ + {250, 235, 215, 21}, /* antique white */ + {250, 235, 215, 35}, /* AntiqueWhite */ + {255, 239, 219, 48}, /* AntiqueWhite1 */ + {238, 223, 204, 62}, /* AntiqueWhite2 */ + {205, 192, 176, 76}, /* AntiqueWhite3 */ + {139, 131, 120, 90}, /* AntiqueWhite4 */ + {0, 255, 255, 104}, /* aqua */ + {127, 255, 212, 109}, /* aquamarine */ + {127, 255, 212, 120}, /* aquamarine1 */ + {118, 238, 198, 132}, /* aquamarine2 */ + {102, 205, 170, 144}, /* aquamarine3 */ + {69, 139, 116, 156}, /* aquamarine4 */ + {240, 255, 255, 168}, /* azure */ + {240, 255, 255, 174}, /* azure1 */ + {224, 238, 238, 181}, /* azure2 */ + {193, 205, 205, 188}, /* azure3 */ + {131, 139, 139, 195}, /* azure4 */ + {245, 245, 220, 202}, /* beige */ + {255, 228, 196, 208}, /* bisque */ + {255, 228, 196, 215}, /* bisque1 */ + {238, 213, 183, 223}, /* bisque2 */ + {205, 183, 158, 231}, /* bisque3 */ + {139, 125, 107, 239}, /* bisque4 */ + {0, 0, 0, 247}, /* black */ + {255, 235, 205, 253}, /* blanched almond */ + {255, 235, 205, 269}, /* BlanchedAlmond */ + {0, 0, 255, 284}, /* blue */ + {138, 43, 226, 289}, /* blue violet */ + {0, 0, 255, 301}, /* blue1 */ + {0, 0, 238, 307}, /* blue2 */ + {0, 0, 205, 313}, /* blue3 */ + {0, 0, 139, 319}, /* blue4 */ + {138, 43, 226, 325}, /* BlueViolet */ + {165, 42, 42, 336}, /* brown */ + {255, 64, 64, 342}, /* brown1 */ + {238, 59, 59, 349}, /* brown2 */ + {205, 51, 51, 356}, /* brown3 */ + {139, 35, 35, 363}, /* brown4 */ + {222, 184, 135, 370}, /* burlywood */ + {255, 211, 155, 380}, /* burlywood1 */ + {238, 197, 145, 391}, /* burlywood2 */ + {205, 170, 125, 402}, /* burlywood3 */ + {139, 115, 85, 413}, /* burlywood4 */ + {95, 158, 160, 424}, /* cadet blue */ + {95, 158, 160, 435}, /* CadetBlue */ + {152, 245, 255, 445}, /* CadetBlue1 */ + {142, 229, 238, 456}, /* CadetBlue2 */ + {122, 197, 205, 467}, /* CadetBlue3 */ + {83, 134, 139, 478}, /* CadetBlue4 */ + {127, 255, 0, 489}, /* chartreuse */ + {127, 255, 0, 500}, /* chartreuse1 */ + {118, 238, 0, 512}, /* chartreuse2 */ + {102, 205, 0, 524}, /* chartreuse3 */ + {69, 139, 0, 536}, /* chartreuse4 */ + {210, 105, 30, 548}, /* chocolate */ + {255, 127, 36, 558}, /* chocolate1 */ + {238, 118, 33, 569}, /* chocolate2 */ + {205, 102, 29, 580}, /* chocolate3 */ + {139, 69, 19, 591}, /* chocolate4 */ + {255, 127, 80, 602}, /* coral */ + {255, 114, 86, 608}, /* coral1 */ + {238, 106, 80, 615}, /* coral2 */ + {205, 91, 69, 622}, /* coral3 */ + {139, 62, 47, 629}, /* coral4 */ + {100, 149, 237, 636}, /* cornflower blue */ + {100, 149, 237, 652}, /* CornflowerBlue */ + {255, 248, 220, 667}, /* cornsilk */ + {255, 248, 220, 676}, /* cornsilk1 */ + {238, 232, 205, 686}, /* cornsilk2 */ + {205, 200, 177, 696}, /* cornsilk3 */ + {139, 136, 120, 706}, /* cornsilk4 */ + {220, 20, 60, 716}, /* crimson */ + {0, 255, 255, 724}, /* cyan */ + {0, 255, 255, 729}, /* cyan1 */ + {0, 238, 238, 735}, /* cyan2 */ + {0, 205, 205, 741}, /* cyan3 */ + {0, 139, 139, 747}, /* cyan4 */ + {0, 0, 139, 753}, /* dark blue */ + {0, 139, 139, 763}, /* dark cyan */ + {184, 134, 11, 773}, /* dark goldenrod */ + {169, 169, 169, 788}, /* dark gray */ + {0, 100, 0, 798}, /* dark green */ + {169, 169, 169, 809}, /* dark grey */ + {189, 183, 107, 819}, /* dark khaki */ + {139, 0, 139, 830}, /* dark magenta */ + {85, 107, 47, 843}, /* dark olive green */ + {255, 140, 0, 860}, /* dark orange */ + {153, 50, 204, 872}, /* dark orchid */ + {139, 0, 0, 884}, /* dark red */ + {233, 150, 122, 893}, /* dark salmon */ + {143, 188, 143, 905}, /* dark sea green */ + {72, 61, 139, 920}, /* dark slate blue */ + {47, 79, 79, 936}, /* dark slate gray */ + {47, 79, 79, 952}, /* dark slate grey */ + {0, 206, 209, 968}, /* dark turquoise */ + {148, 0, 211, 983}, /* dark violet */ + {0, 0, 139, 995}, /* DarkBlue */ + {0, 139, 139, 1004}, /* DarkCyan */ + {184, 134, 11, 1013}, /* DarkGoldenrod */ + {255, 185, 15, 1027}, /* DarkGoldenrod1 */ + {238, 173, 14, 1042}, /* DarkGoldenrod2 */ + {205, 149, 12, 1057}, /* DarkGoldenrod3 */ + {139, 101, 8, 1072}, /* DarkGoldenrod4 */ + {169, 169, 169, 1087}, /* DarkGray */ + {0, 100, 0, 1096}, /* DarkGreen */ + {169, 169, 169, 1106}, /* DarkGrey */ + {189, 183, 107, 1115}, /* DarkKhaki */ + {139, 0, 139, 1125}, /* DarkMagenta */ + {85, 107, 47, 1137}, /* DarkOliveGreen */ + {202, 255, 112, 1152}, /* DarkOliveGreen1 */ + {188, 238, 104, 1168}, /* DarkOliveGreen2 */ + {162, 205, 90, 1184}, /* DarkOliveGreen3 */ + {110, 139, 61, 1200}, /* DarkOliveGreen4 */ + {255, 140, 0, 1216}, /* DarkOrange */ + {255, 127, 0, 1227}, /* DarkOrange1 */ + {238, 118, 0, 1239}, /* DarkOrange2 */ + {205, 102, 0, 1251}, /* DarkOrange3 */ + {139, 69, 0, 1263}, /* DarkOrange4 */ + {153, 50, 204, 1275}, /* DarkOrchid */ + {191, 62, 255, 1286}, /* DarkOrchid1 */ + {178, 58, 238, 1298}, /* DarkOrchid2 */ + {154, 50, 205, 1310}, /* DarkOrchid3 */ + {104, 34, 139, 1322}, /* DarkOrchid4 */ + {139, 0, 0, 1334}, /* DarkRed */ + {233, 150, 122, 1342}, /* DarkSalmon */ + {143, 188, 143, 1353}, /* DarkSeaGreen */ + {193, 255, 193, 1366}, /* DarkSeaGreen1 */ + {180, 238, 180, 1380}, /* DarkSeaGreen2 */ + {155, 205, 155, 1394}, /* DarkSeaGreen3 */ + {105, 139, 105, 1408}, /* DarkSeaGreen4 */ + {72, 61, 139, 1422}, /* DarkSlateBlue */ + {47, 79, 79, 1436}, /* DarkSlateGray */ + {151, 255, 255, 1450}, /* DarkSlateGray1 */ + {141, 238, 238, 1465}, /* DarkSlateGray2 */ + {121, 205, 205, 1480}, /* DarkSlateGray3 */ + {82, 139, 139, 1495}, /* DarkSlateGray4 */ + {47, 79, 79, 1510}, /* DarkSlateGrey */ + {0, 206, 209, 1524}, /* DarkTurquoise */ + {148, 0, 211, 1538}, /* DarkViolet */ + {255, 20, 147, 1549}, /* deep pink */ + {0, 191, 255, 1559}, /* deep sky blue */ + {255, 20, 147, 1573}, /* DeepPink */ + {255, 20, 147, 1582}, /* DeepPink1 */ + {238, 18, 137, 1592}, /* DeepPink2 */ + {205, 16, 118, 1602}, /* DeepPink3 */ + {139, 10, 80, 1612}, /* DeepPink4 */ + {0, 191, 255, 1622}, /* DeepSkyBlue */ + {0, 191, 255, 1634}, /* DeepSkyBlue1 */ + {0, 178, 238, 1647}, /* DeepSkyBlue2 */ + {0, 154, 205, 1660}, /* DeepSkyBlue3 */ + {0, 104, 139, 1673}, /* DeepSkyBlue4 */ + {105, 105, 105, 1686}, /* dim gray */ + {105, 105, 105, 1695}, /* dim grey */ + {105, 105, 105, 1704}, /* DimGray */ + {105, 105, 105, 1712}, /* DimGrey */ + {30, 144, 255, 1720}, /* dodger blue */ + {30, 144, 255, 1732}, /* DodgerBlue */ + {30, 144, 255, 1743}, /* DodgerBlue1 */ + {28, 134, 238, 1755}, /* DodgerBlue2 */ + {24, 116, 205, 1767}, /* DodgerBlue3 */ + {16, 78, 139, 1779}, /* DodgerBlue4 */ + {178, 34, 34, 1791}, /* firebrick */ + {255, 48, 48, 1801}, /* firebrick1 */ + {238, 44, 44, 1812}, /* firebrick2 */ + {205, 38, 38, 1823}, /* firebrick3 */ + {139, 26, 26, 1834}, /* firebrick4 */ + {255, 250, 240, 1845}, /* floral white */ + {255, 250, 240, 1858}, /* FloralWhite */ + {34, 139, 34, 1870}, /* forest green */ + {34, 139, 34, 1883}, /* ForestGreen */ + {255, 0, 255, 1895}, /* fuchsia */ + {220, 220, 220, 1903}, /* gainsboro */ + {248, 248, 255, 1913}, /* ghost white */ + {248, 248, 255, 1925}, /* GhostWhite */ + {255, 215, 0, 1936}, /* gold */ + {255, 215, 0, 1941}, /* gold1 */ + {238, 201, 0, 1947}, /* gold2 */ + {205, 173, 0, 1953}, /* gold3 */ + {139, 117, 0, 1959}, /* gold4 */ + {218, 165, 32, 1965}, /* goldenrod */ + {255, 193, 37, 1975}, /* goldenrod1 */ + {238, 180, 34, 1986}, /* goldenrod2 */ + {205, 155, 29, 1997}, /* goldenrod3 */ + {139, 105, 20, 2008}, /* goldenrod4 */ + {190, 190, 190, 2019}, /* gray */ + {0, 0, 0, 2024}, /* gray0 */ + {3, 3, 3, 2030}, /* gray1 */ + {26, 26, 26, 2036}, /* gray10 */ + {255, 255, 255, 2043}, /* gray100 */ + {28, 28, 28, 2051}, /* gray11 */ + {31, 31, 31, 2058}, /* gray12 */ + {33, 33, 33, 2065}, /* gray13 */ + {36, 36, 36, 2072}, /* gray14 */ + {38, 38, 38, 2079}, /* gray15 */ + {41, 41, 41, 2086}, /* gray16 */ + {43, 43, 43, 2093}, /* gray17 */ + {46, 46, 46, 2100}, /* gray18 */ + {48, 48, 48, 2107}, /* gray19 */ + {5, 5, 5, 2114}, /* gray2 */ + {51, 51, 51, 2120}, /* gray20 */ + {54, 54, 54, 2127}, /* gray21 */ + {56, 56, 56, 2134}, /* gray22 */ + {59, 59, 59, 2141}, /* gray23 */ + {61, 61, 61, 2148}, /* gray24 */ + {64, 64, 64, 2155}, /* gray25 */ + {66, 66, 66, 2162}, /* gray26 */ + {69, 69, 69, 2169}, /* gray27 */ + {71, 71, 71, 2176}, /* gray28 */ + {74, 74, 74, 2183}, /* gray29 */ + {8, 8, 8, 2190}, /* gray3 */ + {77, 77, 77, 2196}, /* gray30 */ + {79, 79, 79, 2203}, /* gray31 */ + {82, 82, 82, 2210}, /* gray32 */ + {84, 84, 84, 2217}, /* gray33 */ + {87, 87, 87, 2224}, /* gray34 */ + {89, 89, 89, 2231}, /* gray35 */ + {92, 92, 92, 2238}, /* gray36 */ + {94, 94, 94, 2245}, /* gray37 */ + {97, 97, 97, 2252}, /* gray38 */ + {99, 99, 99, 2259}, /* gray39 */ + {10, 10, 10, 2266}, /* gray4 */ + {102, 102, 102, 2272}, /* gray40 */ + {105, 105, 105, 2279}, /* gray41 */ + {107, 107, 107, 2286}, /* gray42 */ + {110, 110, 110, 2293}, /* gray43 */ + {112, 112, 112, 2300}, /* gray44 */ + {115, 115, 115, 2307}, /* gray45 */ + {117, 117, 117, 2314}, /* gray46 */ + {120, 120, 120, 2321}, /* gray47 */ + {122, 122, 122, 2328}, /* gray48 */ + {125, 125, 125, 2335}, /* gray49 */ + {13, 13, 13, 2342}, /* gray5 */ + {127, 127, 127, 2348}, /* gray50 */ + {130, 130, 130, 2355}, /* gray51 */ + {133, 133, 133, 2362}, /* gray52 */ + {135, 135, 135, 2369}, /* gray53 */ + {138, 138, 138, 2376}, /* gray54 */ + {140, 140, 140, 2383}, /* gray55 */ + {143, 143, 143, 2390}, /* gray56 */ + {145, 145, 145, 2397}, /* gray57 */ + {148, 148, 148, 2404}, /* gray58 */ + {150, 150, 150, 2411}, /* gray59 */ + {15, 15, 15, 2418}, /* gray6 */ + {153, 153, 153, 2424}, /* gray60 */ + {156, 156, 156, 2431}, /* gray61 */ + {158, 158, 158, 2438}, /* gray62 */ + {161, 161, 161, 2445}, /* gray63 */ + {163, 163, 163, 2452}, /* gray64 */ + {166, 166, 166, 2459}, /* gray65 */ + {168, 168, 168, 2466}, /* gray66 */ + {171, 171, 171, 2473}, /* gray67 */ + {173, 173, 173, 2480}, /* gray68 */ + {176, 176, 176, 2487}, /* gray69 */ + {18, 18, 18, 2494}, /* gray7 */ + {179, 179, 179, 2500}, /* gray70 */ + {181, 181, 181, 2507}, /* gray71 */ + {184, 184, 184, 2514}, /* gray72 */ + {186, 186, 186, 2521}, /* gray73 */ + {189, 189, 189, 2528}, /* gray74 */ + {191, 191, 191, 2535}, /* gray75 */ + {194, 194, 194, 2542}, /* gray76 */ + {196, 196, 196, 2549}, /* gray77 */ + {199, 199, 199, 2556}, /* gray78 */ + {201, 201, 201, 2563}, /* gray79 */ + {20, 20, 20, 2570}, /* gray8 */ + {204, 204, 204, 2576}, /* gray80 */ + {207, 207, 207, 2583}, /* gray81 */ + {209, 209, 209, 2590}, /* gray82 */ + {212, 212, 212, 2597}, /* gray83 */ + {214, 214, 214, 2604}, /* gray84 */ + {217, 217, 217, 2611}, /* gray85 */ + {219, 219, 219, 2618}, /* gray86 */ + {222, 222, 222, 2625}, /* gray87 */ + {224, 224, 224, 2632}, /* gray88 */ + {227, 227, 227, 2639}, /* gray89 */ + {23, 23, 23, 2646}, /* gray9 */ + {229, 229, 229, 2652}, /* gray90 */ + {232, 232, 232, 2659}, /* gray91 */ + {235, 235, 235, 2666}, /* gray92 */ + {237, 237, 237, 2673}, /* gray93 */ + {240, 240, 240, 2680}, /* gray94 */ + {242, 242, 242, 2687}, /* gray95 */ + {245, 245, 245, 2694}, /* gray96 */ + {247, 247, 247, 2701}, /* gray97 */ + {250, 250, 250, 2708}, /* gray98 */ + {252, 252, 252, 2715}, /* gray99 */ + {0, 255, 0, 2722}, /* green */ + {173, 255, 47, 2728}, /* green yellow */ + {0, 255, 0, 2741}, /* green1 */ + {0, 238, 0, 2748}, /* green2 */ + {0, 205, 0, 2755}, /* green3 */ + {0, 139, 0, 2762}, /* green4 */ + {173, 255, 47, 2769}, /* GreenYellow */ + {190, 190, 190, 2781}, /* grey */ + {0, 0, 0, 2786}, /* grey0 */ + {3, 3, 3, 2792}, /* grey1 */ + {26, 26, 26, 2798}, /* grey10 */ + {255, 255, 255, 2805}, /* grey100 */ + {28, 28, 28, 2813}, /* grey11 */ + {31, 31, 31, 2820}, /* grey12 */ + {33, 33, 33, 2827}, /* grey13 */ + {36, 36, 36, 2834}, /* grey14 */ + {38, 38, 38, 2841}, /* grey15 */ + {41, 41, 41, 2848}, /* grey16 */ + {43, 43, 43, 2855}, /* grey17 */ + {46, 46, 46, 2862}, /* grey18 */ + {48, 48, 48, 2869}, /* grey19 */ + {5, 5, 5, 2876}, /* grey2 */ + {51, 51, 51, 2882}, /* grey20 */ + {54, 54, 54, 2889}, /* grey21 */ + {56, 56, 56, 2896}, /* grey22 */ + {59, 59, 59, 2903}, /* grey23 */ + {61, 61, 61, 2910}, /* grey24 */ + {64, 64, 64, 2917}, /* grey25 */ + {66, 66, 66, 2924}, /* grey26 */ + {69, 69, 69, 2931}, /* grey27 */ + {71, 71, 71, 2938}, /* grey28 */ + {74, 74, 74, 2945}, /* grey29 */ + {8, 8, 8, 2952}, /* grey3 */ + {77, 77, 77, 2958}, /* grey30 */ + {79, 79, 79, 2965}, /* grey31 */ + {82, 82, 82, 2972}, /* grey32 */ + {84, 84, 84, 2979}, /* grey33 */ + {87, 87, 87, 2986}, /* grey34 */ + {89, 89, 89, 2993}, /* grey35 */ + {92, 92, 92, 3000}, /* grey36 */ + {94, 94, 94, 3007}, /* grey37 */ + {97, 97, 97, 3014}, /* grey38 */ + {99, 99, 99, 3021}, /* grey39 */ + {10, 10, 10, 3028}, /* grey4 */ + {102, 102, 102, 3034}, /* grey40 */ + {105, 105, 105, 3041}, /* grey41 */ + {107, 107, 107, 3048}, /* grey42 */ + {110, 110, 110, 3055}, /* grey43 */ + {112, 112, 112, 3062}, /* grey44 */ + {115, 115, 115, 3069}, /* grey45 */ + {117, 117, 117, 3076}, /* grey46 */ + {120, 120, 120, 3083}, /* grey47 */ + {122, 122, 122, 3090}, /* grey48 */ + {125, 125, 125, 3097}, /* grey49 */ + {13, 13, 13, 3104}, /* grey5 */ + {127, 127, 127, 3110}, /* grey50 */ + {130, 130, 130, 3117}, /* grey51 */ + {133, 133, 133, 3124}, /* grey52 */ + {135, 135, 135, 3131}, /* grey53 */ + {138, 138, 138, 3138}, /* grey54 */ + {140, 140, 140, 3145}, /* grey55 */ + {143, 143, 143, 3152}, /* grey56 */ + {145, 145, 145, 3159}, /* grey57 */ + {148, 148, 148, 3166}, /* grey58 */ + {150, 150, 150, 3173}, /* grey59 */ + {15, 15, 15, 3180}, /* grey6 */ + {153, 153, 153, 3186}, /* grey60 */ + {156, 156, 156, 3193}, /* grey61 */ + {158, 158, 158, 3200}, /* grey62 */ + {161, 161, 161, 3207}, /* grey63 */ + {163, 163, 163, 3214}, /* grey64 */ + {166, 166, 166, 3221}, /* grey65 */ + {168, 168, 168, 3228}, /* grey66 */ + {171, 171, 171, 3235}, /* grey67 */ + {173, 173, 173, 3242}, /* grey68 */ + {176, 176, 176, 3249}, /* grey69 */ + {18, 18, 18, 3256}, /* grey7 */ + {179, 179, 179, 3262}, /* grey70 */ + {181, 181, 181, 3269}, /* grey71 */ + {184, 184, 184, 3276}, /* grey72 */ + {186, 186, 186, 3283}, /* grey73 */ + {189, 189, 189, 3290}, /* grey74 */ + {191, 191, 191, 3297}, /* grey75 */ + {194, 194, 194, 3304}, /* grey76 */ + {196, 196, 196, 3311}, /* grey77 */ + {199, 199, 199, 3318}, /* grey78 */ + {201, 201, 201, 3325}, /* grey79 */ + {20, 20, 20, 3332}, /* grey8 */ + {204, 204, 204, 3338}, /* grey80 */ + {207, 207, 207, 3345}, /* grey81 */ + {209, 209, 209, 3352}, /* grey82 */ + {212, 212, 212, 3359}, /* grey83 */ + {214, 214, 214, 3366}, /* grey84 */ + {217, 217, 217, 3373}, /* grey85 */ + {219, 219, 219, 3380}, /* grey86 */ + {222, 222, 222, 3387}, /* grey87 */ + {224, 224, 224, 3394}, /* grey88 */ + {227, 227, 227, 3401}, /* grey89 */ + {23, 23, 23, 3408}, /* grey9 */ + {229, 229, 229, 3414}, /* grey90 */ + {232, 232, 232, 3421}, /* grey91 */ + {235, 235, 235, 3428}, /* grey92 */ + {237, 237, 237, 3435}, /* grey93 */ + {240, 240, 240, 3442}, /* grey94 */ + {242, 242, 242, 3449}, /* grey95 */ + {245, 245, 245, 3456}, /* grey96 */ + {247, 247, 247, 3463}, /* grey97 */ + {250, 250, 250, 3470}, /* grey98 */ + {252, 252, 252, 3477}, /* grey99 */ + {240, 255, 240, 3484}, /* honeydew */ + {240, 255, 240, 3493}, /* honeydew1 */ + {224, 238, 224, 3503}, /* honeydew2 */ + {193, 205, 193, 3513}, /* honeydew3 */ + {131, 139, 131, 3523}, /* honeydew4 */ + {255, 105, 180, 3533}, /* hot pink */ + {255, 105, 180, 3542}, /* HotPink */ + {255, 110, 180, 3550}, /* HotPink1 */ + {238, 106, 167, 3559}, /* HotPink2 */ + {205, 96, 144, 3568}, /* HotPink3 */ + {139, 58, 98, 3577}, /* HotPink4 */ + {205, 92, 92, 3586}, /* indian red */ + {205, 92, 92, 3597}, /* IndianRed */ + {255, 106, 106, 3607}, /* IndianRed1 */ + {238, 99, 99, 3618}, /* IndianRed2 */ + {205, 85, 85, 3629}, /* IndianRed3 */ + {139, 58, 58, 3640}, /* IndianRed4 */ + {75, 0, 130, 3651}, /* indigo */ + {255, 255, 240, 3658}, /* ivory */ + {255, 255, 240, 3664}, /* ivory1 */ + {238, 238, 224, 3671}, /* ivory2 */ + {205, 205, 193, 3678}, /* ivory3 */ + {139, 139, 131, 3685}, /* ivory4 */ + {240, 230, 140, 3692}, /* khaki */ + {255, 246, 143, 3698}, /* khaki1 */ + {238, 230, 133, 3705}, /* khaki2 */ + {205, 198, 115, 3712}, /* khaki3 */ + {139, 134, 78, 3719}, /* khaki4 */ + {230, 230, 250, 3726}, /* lavender */ + {255, 240, 245, 3735}, /* lavender blush */ + {255, 240, 245, 3750}, /* LavenderBlush */ + {255, 240, 245, 3764}, /* LavenderBlush1 */ + {238, 224, 229, 3779}, /* LavenderBlush2 */ + {205, 193, 197, 3794}, /* LavenderBlush3 */ + {139, 131, 134, 3809}, /* LavenderBlush4 */ + {124, 252, 0, 3824}, /* lawn green */ + {124, 252, 0, 3835}, /* LawnGreen */ + {255, 250, 205, 3845}, /* lemon chiffon */ + {255, 250, 205, 3859}, /* LemonChiffon */ + {255, 250, 205, 3872}, /* LemonChiffon1 */ + {238, 233, 191, 3886}, /* LemonChiffon2 */ + {205, 201, 165, 3900}, /* LemonChiffon3 */ + {139, 137, 112, 3914}, /* LemonChiffon4 */ + {173, 216, 230, 3928}, /* light blue */ + {240, 128, 128, 3939}, /* light coral */ + {224, 255, 255, 3951}, /* light cyan */ + {238, 221, 130, 3962}, /* light goldenrod */ + {250, 250, 210, 3978}, /* light goldenrod yellow */ + {211, 211, 211, 4001}, /* light gray */ + {144, 238, 144, 4012}, /* light green */ + {211, 211, 211, 4024}, /* light grey */ + {255, 182, 193, 4035}, /* light pink */ + {255, 160, 122, 4046}, /* light salmon */ + {32, 178, 170, 4059}, /* light sea green */ + {135, 206, 250, 4075}, /* light sky blue */ + {132, 112, 255, 4090}, /* light slate blue */ + {119, 136, 153, 4107}, /* light slate gray */ + {119, 136, 153, 4124}, /* light slate grey */ + {176, 196, 222, 4141}, /* light steel blue */ + {255, 255, 224, 4158}, /* light yellow */ + {173, 216, 230, 4171}, /* LightBlue */ + {191, 239, 255, 4181}, /* LightBlue1 */ + {178, 223, 238, 4192}, /* LightBlue2 */ + {154, 192, 205, 4203}, /* LightBlue3 */ + {104, 131, 139, 4214}, /* LightBlue4 */ + {240, 128, 128, 4225}, /* LightCoral */ + {224, 255, 255, 4236}, /* LightCyan */ + {224, 255, 255, 4246}, /* LightCyan1 */ + {209, 238, 238, 4257}, /* LightCyan2 */ + {180, 205, 205, 4268}, /* LightCyan3 */ + {122, 139, 139, 4279}, /* LightCyan4 */ + {238, 221, 130, 4290}, /* LightGoldenrod */ + {255, 236, 139, 4305}, /* LightGoldenrod1 */ + {238, 220, 130, 4321}, /* LightGoldenrod2 */ + {205, 190, 112, 4337}, /* LightGoldenrod3 */ + {139, 129, 76, 4353}, /* LightGoldenrod4 */ + {250, 250, 210, 4369}, /* LightGoldenrodYellow */ + {211, 211, 211, 4390}, /* LightGray */ + {144, 238, 144, 4400}, /* LightGreen */ + {211, 211, 211, 4411}, /* LightGrey */ + {255, 182, 193, 4421}, /* LightPink */ + {255, 174, 185, 4431}, /* LightPink1 */ + {238, 162, 173, 4442}, /* LightPink2 */ + {205, 140, 149, 4453}, /* LightPink3 */ + {139, 95, 101, 4464}, /* LightPink4 */ + {255, 160, 122, 4475}, /* LightSalmon */ + {255, 160, 122, 4487}, /* LightSalmon1 */ + {238, 149, 114, 4500}, /* LightSalmon2 */ + {205, 129, 98, 4513}, /* LightSalmon3 */ + {139, 87, 66, 4526}, /* LightSalmon4 */ + {32, 178, 170, 4539}, /* LightSeaGreen */ + {135, 206, 250, 4553}, /* LightSkyBlue */ + {176, 226, 255, 4566}, /* LightSkyBlue1 */ + {164, 211, 238, 4580}, /* LightSkyBlue2 */ + {141, 182, 205, 4594}, /* LightSkyBlue3 */ + {96, 123, 139, 4608}, /* LightSkyBlue4 */ + {132, 112, 255, 4622}, /* LightSlateBlue */ + {119, 136, 153, 4637}, /* LightSlateGray */ + {119, 136, 153, 4652}, /* LightSlateGrey */ + {176, 196, 222, 4667}, /* LightSteelBlue */ + {202, 225, 255, 4682}, /* LightSteelBlue1 */ + {188, 210, 238, 4698}, /* LightSteelBlue2 */ + {162, 181, 205, 4714}, /* LightSteelBlue3 */ + {110, 123, 139, 4730}, /* LightSteelBlue4 */ + {255, 255, 224, 4746}, /* LightYellow */ + {255, 255, 224, 4758}, /* LightYellow1 */ + {238, 238, 209, 4771}, /* LightYellow2 */ + {205, 205, 180, 4784}, /* LightYellow3 */ + {139, 139, 122, 4797}, /* LightYellow4 */ + {0, 255, 0, 4810}, /* lime */ + {50, 205, 50, 4815}, /* lime green */ + {50, 205, 50, 4826}, /* LimeGreen */ + {250, 240, 230, 4836}, /* linen */ + {255, 0, 255, 4842}, /* magenta */ + {255, 0, 255, 4850}, /* magenta1 */ + {238, 0, 238, 4859}, /* magenta2 */ + {205, 0, 205, 4868}, /* magenta3 */ + {139, 0, 139, 4877}, /* magenta4 */ + {176, 48, 96, 4886}, /* maroon */ + {255, 52, 179, 4893}, /* maroon1 */ + {238, 48, 167, 4901}, /* maroon2 */ + {205, 41, 144, 4909}, /* maroon3 */ + {139, 28, 98, 4917}, /* maroon4 */ + {102, 205, 170, 4925}, /* medium aquamarine */ + {0, 0, 205, 4943}, /* medium blue */ + {186, 85, 211, 4955}, /* medium orchid */ + {147, 112, 219, 4969}, /* medium purple */ + {60, 179, 113, 4983}, /* medium sea green */ + {123, 104, 238, 5000}, /* medium slate blue */ + {0, 250, 154, 5018}, /* medium spring green */ + {72, 209, 204, 5038}, /* medium turquoise */ + {199, 21, 133, 5055}, /* medium violet red */ + {102, 205, 170, 5073}, /* MediumAquamarine */ + {0, 0, 205, 5090}, /* MediumBlue */ + {186, 85, 211, 5101}, /* MediumOrchid */ + {224, 102, 255, 5114}, /* MediumOrchid1 */ + {209, 95, 238, 5128}, /* MediumOrchid2 */ + {180, 82, 205, 5142}, /* MediumOrchid3 */ + {122, 55, 139, 5156}, /* MediumOrchid4 */ + {147, 112, 219, 5170}, /* MediumPurple */ + {171, 130, 255, 5183}, /* MediumPurple1 */ + {159, 121, 238, 5197}, /* MediumPurple2 */ + {137, 104, 205, 5211}, /* MediumPurple3 */ + {93, 71, 139, 5225}, /* MediumPurple4 */ + {60, 179, 113, 5239}, /* MediumSeaGreen */ + {123, 104, 238, 5254}, /* MediumSlateBlue */ + {0, 250, 154, 5270}, /* MediumSpringGreen */ + {72, 209, 204, 5288}, /* MediumTurquoise */ + {199, 21, 133, 5304}, /* MediumVioletRed */ + {25, 25, 112, 5320}, /* midnight blue */ + {25, 25, 112, 5334}, /* MidnightBlue */ + {245, 255, 250, 5347}, /* mint cream */ + {245, 255, 250, 5358}, /* MintCream */ + {255, 228, 225, 5368}, /* misty rose */ + {255, 228, 225, 5379}, /* MistyRose */ + {255, 228, 225, 5389}, /* MistyRose1 */ + {238, 213, 210, 5400}, /* MistyRose2 */ + {205, 183, 181, 5411}, /* MistyRose3 */ + {139, 125, 123, 5422}, /* MistyRose4 */ + {255, 228, 181, 5433}, /* moccasin */ + {255, 222, 173, 5442}, /* navajo white */ + {255, 222, 173, 5455}, /* NavajoWhite */ + {255, 222, 173, 5467}, /* NavajoWhite1 */ + {238, 207, 161, 5480}, /* NavajoWhite2 */ + {205, 179, 139, 5493}, /* NavajoWhite3 */ + {139, 121, 94, 5506}, /* NavajoWhite4 */ + {0, 0, 128, 5519}, /* navy */ + {0, 0, 128, 5524}, /* navy blue */ + {0, 0, 128, 5534}, /* NavyBlue */ + {253, 245, 230, 5543}, /* old lace */ + {253, 245, 230, 5552}, /* OldLace */ + {128, 128, 0, 5560}, /* olive */ + {107, 142, 35, 5566}, /* olive drab */ + {107, 142, 35, 5577}, /* OliveDrab */ + {192, 255, 62, 5587}, /* OliveDrab1 */ + {179, 238, 58, 5598}, /* OliveDrab2 */ + {154, 205, 50, 5609}, /* OliveDrab3 */ + {105, 139, 34, 5620}, /* OliveDrab4 */ + {255, 165, 0, 5631}, /* orange */ + {255, 69, 0, 5638}, /* orange red */ + {255, 165, 0, 5649}, /* orange1 */ + {238, 154, 0, 5657}, /* orange2 */ + {205, 133, 0, 5665}, /* orange3 */ + {139, 90, 0, 5673}, /* orange4 */ + {255, 69, 0, 5681}, /* OrangeRed */ + {255, 69, 0, 5691}, /* OrangeRed1 */ + {238, 64, 0, 5702}, /* OrangeRed2 */ + {205, 55, 0, 5713}, /* OrangeRed3 */ + {139, 37, 0, 5724}, /* OrangeRed4 */ + {218, 112, 214, 5735}, /* orchid */ + {255, 131, 250, 5742}, /* orchid1 */ + {238, 122, 233, 5750}, /* orchid2 */ + {205, 105, 201, 5758}, /* orchid3 */ + {139, 71, 137, 5766}, /* orchid4 */ + {238, 232, 170, 5774}, /* pale goldenrod */ + {152, 251, 152, 5789}, /* pale green */ + {175, 238, 238, 5800}, /* pale turquoise */ + {219, 112, 147, 5815}, /* pale violet red */ + {238, 232, 170, 5831}, /* PaleGoldenrod */ + {152, 251, 152, 5845}, /* PaleGreen */ + {154, 255, 154, 5855}, /* PaleGreen1 */ + {144, 238, 144, 5866}, /* PaleGreen2 */ + {124, 205, 124, 5877}, /* PaleGreen3 */ + {84, 139, 84, 5888}, /* PaleGreen4 */ + {175, 238, 238, 5899}, /* PaleTurquoise */ + {187, 255, 255, 5913}, /* PaleTurquoise1 */ + {174, 238, 238, 5928}, /* PaleTurquoise2 */ + {150, 205, 205, 5943}, /* PaleTurquoise3 */ + {102, 139, 139, 5958}, /* PaleTurquoise4 */ + {219, 112, 147, 5973}, /* PaleVioletRed */ + {255, 130, 171, 5987}, /* PaleVioletRed1 */ + {238, 121, 159, 6002}, /* PaleVioletRed2 */ + {205, 104, 137, 6017}, /* PaleVioletRed3 */ + {139, 71, 93, 6032}, /* PaleVioletRed4 */ + {255, 239, 213, 6047}, /* papaya whip */ + {255, 239, 213, 6059}, /* PapayaWhip */ + {255, 218, 185, 6070}, /* peach puff */ + {255, 218, 185, 6081}, /* PeachPuff */ + {255, 218, 185, 6091}, /* PeachPuff1 */ + {238, 203, 173, 6102}, /* PeachPuff2 */ + {205, 175, 149, 6113}, /* PeachPuff3 */ + {139, 119, 101, 6124}, /* PeachPuff4 */ + {205, 133, 63, 6135}, /* peru */ + {255, 192, 203, 6140}, /* pink */ + {255, 181, 197, 6145}, /* pink1 */ + {238, 169, 184, 6151}, /* pink2 */ + {205, 145, 158, 6157}, /* pink3 */ + {139, 99, 108, 6163}, /* pink4 */ + {221, 160, 221, 6169}, /* plum */ + {255, 187, 255, 6174}, /* plum1 */ + {238, 174, 238, 6180}, /* plum2 */ + {205, 150, 205, 6186}, /* plum3 */ + {139, 102, 139, 6192}, /* plum4 */ + {176, 224, 230, 6198}, /* powder blue */ + {176, 224, 230, 6210}, /* PowderBlue */ + {160, 32, 240, 6221}, /* purple */ + {155, 48, 255, 6228}, /* purple1 */ + {145, 44, 238, 6236}, /* purple2 */ + {125, 38, 205, 6244}, /* purple3 */ + {85, 26, 139, 6252}, /* purple4 */ + {102, 51, 153, 6260}, /* rebecca purple */ + {102, 51, 153, 6275}, /* RebeccaPurple */ + {255, 0, 0, 6289}, /* red */ + {255, 0, 0, 6293}, /* red1 */ + {238, 0, 0, 6298}, /* red2 */ + {205, 0, 0, 6303}, /* red3 */ + {139, 0, 0, 6308}, /* red4 */ + {188, 143, 143, 6313}, /* rosy brown */ + {188, 143, 143, 6324}, /* RosyBrown */ + {255, 193, 193, 6334}, /* RosyBrown1 */ + {238, 180, 180, 6345}, /* RosyBrown2 */ + {205, 155, 155, 6356}, /* RosyBrown3 */ + {139, 105, 105, 6367}, /* RosyBrown4 */ + {65, 105, 225, 6378}, /* royal blue */ + {65, 105, 225, 6389}, /* RoyalBlue */ + {72, 118, 255, 6399}, /* RoyalBlue1 */ + {67, 110, 238, 6410}, /* RoyalBlue2 */ + {58, 95, 205, 6421}, /* RoyalBlue3 */ + {39, 64, 139, 6432}, /* RoyalBlue4 */ + {139, 69, 19, 6443}, /* saddle brown */ + {139, 69, 19, 6456}, /* SaddleBrown */ + {250, 128, 114, 6468}, /* salmon */ + {255, 140, 105, 6475}, /* salmon1 */ + {238, 130, 98, 6483}, /* salmon2 */ + {205, 112, 84, 6491}, /* salmon3 */ + {139, 76, 57, 6499}, /* salmon4 */ + {244, 164, 96, 6507}, /* sandy brown */ + {244, 164, 96, 6519}, /* SandyBrown */ + {46, 139, 87, 6530}, /* sea green */ + {46, 139, 87, 6540}, /* SeaGreen */ + {84, 255, 159, 6549}, /* SeaGreen1 */ + {78, 238, 148, 6559}, /* SeaGreen2 */ + {67, 205, 128, 6569}, /* SeaGreen3 */ + {46, 139, 87, 6579}, /* SeaGreen4 */ + {255, 245, 238, 6589}, /* seashell */ + {255, 245, 238, 6598}, /* seashell1 */ + {238, 229, 222, 6608}, /* seashell2 */ + {205, 197, 191, 6618}, /* seashell3 */ + {139, 134, 130, 6628}, /* seashell4 */ + {160, 82, 45, 6638}, /* sienna */ + {255, 130, 71, 6645}, /* sienna1 */ + {238, 121, 66, 6653}, /* sienna2 */ + {205, 104, 57, 6661}, /* sienna3 */ + {139, 71, 38, 6669}, /* sienna4 */ + {192, 192, 192, 6677}, /* silver */ + {135, 206, 235, 6684}, /* sky blue */ + {135, 206, 235, 6693}, /* SkyBlue */ + {135, 206, 255, 6701}, /* SkyBlue1 */ + {126, 192, 238, 6710}, /* SkyBlue2 */ + {108, 166, 205, 6719}, /* SkyBlue3 */ + {74, 112, 139, 6728}, /* SkyBlue4 */ + {106, 90, 205, 6737}, /* slate blue */ + {112, 128, 144, 6748}, /* slate gray */ + {112, 128, 144, 6759}, /* slate grey */ + {106, 90, 205, 6770}, /* SlateBlue */ + {131, 111, 255, 6780}, /* SlateBlue1 */ + {122, 103, 238, 6791}, /* SlateBlue2 */ + {105, 89, 205, 6802}, /* SlateBlue3 */ + {71, 60, 139, 6813}, /* SlateBlue4 */ + {112, 128, 144, 6824}, /* SlateGray */ + {198, 226, 255, 6834}, /* SlateGray1 */ + {185, 211, 238, 6845}, /* SlateGray2 */ + {159, 182, 205, 6856}, /* SlateGray3 */ + {108, 123, 139, 6867}, /* SlateGray4 */ + {112, 128, 144, 6878}, /* SlateGrey */ + {255, 250, 250, 6888}, /* snow */ + {255, 250, 250, 6893}, /* snow1 */ + {238, 233, 233, 6899}, /* snow2 */ + {205, 201, 201, 6905}, /* snow3 */ + {139, 137, 137, 6911}, /* snow4 */ + {0, 255, 127, 6917}, /* spring green */ + {0, 255, 127, 6930}, /* SpringGreen */ + {0, 255, 127, 6942}, /* SpringGreen1 */ + {0, 238, 118, 6955}, /* SpringGreen2 */ + {0, 205, 102, 6968}, /* SpringGreen3 */ + {0, 139, 69, 6981}, /* SpringGreen4 */ + {70, 130, 180, 6994}, /* steel blue */ + {70, 130, 180, 7005}, /* SteelBlue */ + {99, 184, 255, 7015}, /* SteelBlue1 */ + {92, 172, 238, 7026}, /* SteelBlue2 */ + {79, 148, 205, 7037}, /* SteelBlue3 */ + {54, 100, 139, 7048}, /* SteelBlue4 */ + {210, 180, 140, 7059}, /* tan */ + {255, 165, 79, 7063}, /* tan1 */ + {238, 154, 73, 7068}, /* tan2 */ + {205, 133, 63, 7073}, /* tan3 */ + {139, 90, 43, 7078}, /* tan4 */ + {0, 128, 128, 7083}, /* teal */ + {216, 191, 216, 7088}, /* thistle */ + {255, 225, 255, 7096}, /* thistle1 */ + {238, 210, 238, 7105}, /* thistle2 */ + {205, 181, 205, 7114}, /* thistle3 */ + {139, 123, 139, 7123}, /* thistle4 */ + {255, 99, 71, 7132}, /* tomato */ + {255, 99, 71, 7139}, /* tomato1 */ + {238, 92, 66, 7147}, /* tomato2 */ + {205, 79, 57, 7155}, /* tomato3 */ + {139, 54, 38, 7163}, /* tomato4 */ + {64, 224, 208, 7171}, /* turquoise */ + {0, 245, 255, 7181}, /* turquoise1 */ + {0, 229, 238, 7192}, /* turquoise2 */ + {0, 197, 205, 7203}, /* turquoise3 */ + {0, 134, 139, 7214}, /* turquoise4 */ + {238, 130, 238, 7225}, /* violet */ + {208, 32, 144, 7232}, /* violet red */ + {208, 32, 144, 7243}, /* VioletRed */ + {255, 62, 150, 7253}, /* VioletRed1 */ + {238, 58, 140, 7264}, /* VioletRed2 */ + {205, 50, 120, 7275}, /* VioletRed3 */ + {139, 34, 82, 7286}, /* VioletRed4 */ + {128, 128, 128, 7297}, /* web gray */ + {0, 128, 0, 7306}, /* web green */ + {128, 128, 128, 7316}, /* web grey */ + {128, 0, 0, 7325}, /* web maroon */ + {128, 0, 128, 7336}, /* web purple */ + {128, 128, 128, 7347}, /* WebGray */ + {0, 128, 0, 7355}, /* WebGreen */ + {128, 128, 128, 7364}, /* WebGrey */ + {128, 0, 0, 7372}, /* WebMaroon */ + {128, 0, 128, 7382}, /* WebPurple */ + {245, 222, 179, 7392}, /* wheat */ + {255, 231, 186, 7398}, /* wheat1 */ + {238, 216, 174, 7405}, /* wheat2 */ + {205, 186, 150, 7412}, /* wheat3 */ + {139, 126, 102, 7419}, /* wheat4 */ + {255, 255, 255, 7426}, /* white */ + {245, 245, 245, 7432}, /* white smoke */ + {245, 245, 245, 7444}, /* WhiteSmoke */ + {190, 190, 190, 7455}, /* x11 gray */ + {0, 255, 0, 7464}, /* x11 green */ + {190, 190, 190, 7474}, /* x11 grey */ + {176, 48, 96, 7483}, /* x11 maroon */ + {160, 32, 240, 7494}, /* x11 purple */ + {190, 190, 190, 7505}, /* X11Gray */ + {0, 255, 0, 7513}, /* X11Green */ + {190, 190, 190, 7522}, /* X11Grey */ + {176, 48, 96, 7530}, /* X11Maroon */ + {160, 32, 240, 7540}, /* X11Purple */ + {255, 255, 0, 7550}, /* yellow */ + {154, 205, 50, 7557}, /* yellow green */ + {255, 255, 0, 7570}, /* yellow1 */ + {238, 238, 0, 7578}, /* yellow2 */ + {205, 205, 0, 7586}, /* yellow3 */ + {139, 139, 0, 7594}, /* yellow4 */ + {154, 205, 50, 7602}, /* YellowGreen */ +}; + +#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) Bool -OsInitColors(void) +OsLookupColor(int screen, + char *name, + unsigned int len, + unsigned short *pred, + unsigned short *pgreen, unsigned short *pblue) { - FILE *rgb; - char *path; - char line[BUFSIZ]; - char name[BUFSIZ]; - int red, green, blue, lineno = 0; - dbEntryPtr entry; - - static Bool was_here = FALSE; - - if (!was_here) - { -#ifdef NX_TRANS_SOCKET - /* - * Add the trailing '.txt' if a - * 'rgb' file is not found. - */ - - struct stat statbuf; - - path = (char*)ALLOCATE_LOCAL(strlen(_NXGetRgbPath(rgbPath)) + 5); - strcpy(path, _NXGetRgbPath(rgbPath)); - - if (stat(path, &statbuf) != 0) - { - strcat(path, ".txt"); - } -#else - path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); - strcpy(path, rgbPath); - strcat(path, ".txt"); -#endif - if (!(rgb = fopen(path, "r"))) - { -#ifdef NX_TRANS_SOCKET - ErrorF( "Couldn't open RGB_DB '%s'\n", _NXGetRgbPath(rgbPath)); -#else - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); -#endif - DEALLOCATE_LOCAL(path); - return FALSE; - } - - while(fgets(line, sizeof(line), rgb)) - { - lineno++; - if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) - { - if (red >= 0 && red <= 0xff && - green >= 0 && green <= 0xff && - blue >= 0 && blue <= 0xff) - { - if ((entry = lookup(name, strlen(name), TRUE))) - { - entry->red = (red * 65535) / 255; - entry->green = (green * 65535) / 255; - entry->blue = (blue * 65535) / 255; - } - } - else - ErrorF("Value out of range: %s:%d\n", path, lineno); - } - else if (*line && *line != '#' && *line != '!') - ErrorF("Syntax Error: %s:%d\n", path, lineno); - } - - fclose(rgb); - DEALLOCATE_LOCAL(path); - - was_here = TRUE; - } - - return TRUE; -} - - - -Bool -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - dbEntryPtr entry; - - if ((entry = lookup(name, len, FALSE))) - { - *pred = entry->red; - *pgreen = entry->green; - *pblue = entry->blue; - return TRUE; + const BuiltinColor *c; + int low, mid, high; + int r; + + low = 0; + high = NUM_BUILTIN_COLORS - 1; + while (high >= low) { + mid = (low + high) / 2; + c = &BuiltinColors[mid]; + r = strncasecmp(&BuiltinColorNames[c->name], name, len); + if (r == 0 && len == strlen(&BuiltinColorNames[c->name])) { + *pred = c->red * 0x101; + *pgreen = c->green * 0x101; + *pblue = c->blue * 0x101; + return TRUE; + } + if (r < 0) + low = mid + 1; + else + high = mid - 1; } - - return FALSE; + return FALSE; } - -#endif /* USE_RGB_TXT */ diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 59b567356..adafa3cf4 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -88,8 +88,6 @@ int limitStackSpace = -1; int limitNoFile = -1; #endif -Bool OsDelayInitColors = FALSE; - void OsInit(void) { @@ -218,7 +216,6 @@ OsInit(void) if (!SmartScheduleInit ()) SmartScheduleDisable = TRUE; OsInitAllocator(); - if (!OsDelayInitColors) OsInitColors(); } void diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 204494d63..af793454f 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -565,7 +565,6 @@ void UseMsg(void) ErrorF("-c turns off key-click\n"); ErrorF("c # key-click volume (0-100)\n"); ErrorF("-cc int default color visual class\n"); - ErrorF("-co file color database file\n"); #ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS ErrorF("-config file read options from file\n"); #endif @@ -771,13 +770,6 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } - else if ( strcmp( argv[i], "-co") == 0) - { - if(++i < argc) - rgbPath = argv[i]; - else - UseMsg(); - } else if ( strcmp( argv[i], "-core") == 0) CoreDump = TRUE; else if ( strcmp( argv[i], "-dpi") == 0) -- cgit v1.2.3 From b816d361f5c8761ef3ab269402bce506aece14b4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 5 Feb 2017 19:54:40 +0000 Subject: Xserver/hw/nxagent/Font.c: Drop NXAGENT_ALTERNATE_FONT_PATH_4 (pointing to /usr/NX/share/fonts/base) entirely. --- nx-X11/programs/Xserver/hw/nxagent/Font.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 5b9c31106..1213443c9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -73,7 +73,6 @@ is" without express or implied warranty. #define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts" #define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11" #define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/share/fonts" -#define NXAGENT_ALTERNATE_FONT_DIR_4 "/usr/NX/share/fonts" #define NXAGENT_DEFAULT_FONT_PATH \ "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ @@ -99,9 +98,6 @@ is" without express or implied warranty. /usr/share/fonts/100dpi/,/usr/share/fonts/TTF/,\ /usr/NX/share/fonts/base" -#define NXAGENT_ALTERNATE_FONT_PATH_4 \ -"/usr/NX/share/fonts/base" - #undef NXAGENT_FONTCACHE_DEBUG #undef NXAGENT_RECONNECT_FONT_DEBUG #undef NXAGENT_FONTMATCH_DEBUG @@ -1574,32 +1570,6 @@ void nxagentVerifyDefaultFontPath(void) strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_3); } - - if (stat(NXAGENT_ALTERNATE_FONT_DIR_4, &dirStat) == 0 && - S_ISDIR(dirStat.st_mode) != 0) - { - /* - * Let's use the "/usr/NX/share/fonts" path. - */ - - #ifdef TEST - fprintf(stderr, "nxagentVerifyDefaultFontPath: Assuming fonts in directory [%s].\n", - validateString(NXAGENT_ALTERNATE_FONT_DIR_4)); - #endif - - if (*fontPath != '\0') - { - fontPath = realloc(fontPath, strlen(fontPath) + strlen(NXAGENT_ALTERNATE_FONT_PATH_4) + 2); - strcat(fontPath, ","); - } - else - { - fontPath = realloc(fontPath, strlen(fontPath) + strlen(NXAGENT_ALTERNATE_FONT_PATH_4) + 1); - } - - strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_4); - } - if (*fontPath == '\0') { #ifdef WARNING -- cgit v1.2.3 From b11dd91a8e6865f06b06cf5c3a736615829d08ad Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 5 Feb 2017 20:18:13 +0000 Subject: Xserver/hw/nxagent/Font.c: Change (alternative) default font path order to make font path search compliant with latest FHS for X11 fonts (though, prefer /usr/share/nx/fonts as default path). --- nx-X11/programs/Xserver/hw/nxagent/Font.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 1213443c9..b4f5c2274 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -69,15 +69,15 @@ is" without express or implied warranty. #undef TEST #undef DEBUG -#define NXAGENT_DEFAULT_FONT_DIR "/usr/X11R6/lib/X11/fonts" +#define NXAGENT_DEFAULT_FONT_DIR "/usr/share/nx/fonts" #define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts" #define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11" -#define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/share/fonts" +#define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/X11R6/lib/X11/fonts" #define NXAGENT_DEFAULT_FONT_PATH \ -"/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ -/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,\ -/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\ +"/usr/share/nx/fonts/misc/,/usr/share/nx/fonts/Speedo/,\ +/usr/share/nx/fonts/Type1/,/usr/share/nx/fonts/75dpi/,\ +/usr/share/nx/fonts/100dpi/,/usr/share/nx/fonts/TTF/,\ /usr/NX/share/fonts/base" #define NXAGENT_ALTERNATE_FONT_PATH \ @@ -93,9 +93,9 @@ is" without express or implied warranty. /usr/NX/share/fonts/base" #define NXAGENT_ALTERNATE_FONT_PATH_3 \ -"/usr/share/fonts/misc/,/usr/share/fonts/Speedo/,\ -/usr/share/fonts/Type1/,/usr/share/fonts/75dpi/,\ -/usr/share/fonts/100dpi/,/usr/share/fonts/TTF/,\ +"/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ +/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,\ +/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\ /usr/NX/share/fonts/base" #undef NXAGENT_FONTCACHE_DEBUG @@ -1475,7 +1475,7 @@ void nxagentVerifyDefaultFontPath(void) S_ISDIR(dirStat.st_mode) != 0) { /* - * Let's use the old "/usr/X11R6/lib/X11/fonts" style. + * Let's use the old "/usr/share/nx/fonts" style. */ #ifdef TEST @@ -1550,7 +1550,7 @@ void nxagentVerifyDefaultFontPath(void) S_ISDIR(dirStat.st_mode) != 0) { /* - * Let's use the "/usr/share/fonts" path. + * Let's use the "/usr/X11R6/lib/X11/fonts" path. */ #ifdef TEST -- cgit v1.2.3 From 6537f7eceabece2ceb11872644254c22f87a46da Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 5 Feb 2017 20:19:49 +0000 Subject: Xserver/hw/nxagent/Font.c: Drop references to /usr/NX/share/fonts/base as default font path, entirely. --- nx-X11/programs/Xserver/hw/nxagent/Font.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index b4f5c2274..c9b9e3f75 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -77,26 +77,22 @@ is" without express or implied warranty. #define NXAGENT_DEFAULT_FONT_PATH \ "/usr/share/nx/fonts/misc/,/usr/share/nx/fonts/Speedo/,\ /usr/share/nx/fonts/Type1/,/usr/share/nx/fonts/75dpi/,\ -/usr/share/nx/fonts/100dpi/,/usr/share/nx/fonts/TTF/,\ -/usr/NX/share/fonts/base" +/usr/share/nx/fonts/100dpi/,/usr/share/nx/fonts/TTF/" #define NXAGENT_ALTERNATE_FONT_PATH \ "/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/Speedo/,\ /usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/75dpi/,\ -/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/,\ -/usr/NX/share/fonts/base" +/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/" #define NXAGENT_ALTERNATE_FONT_PATH_2 \ "/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Speedo/,\ /usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,\ -/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/,\ -/usr/NX/share/fonts/base" +/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/" #define NXAGENT_ALTERNATE_FONT_PATH_3 \ "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ /usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,\ -/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\ -/usr/NX/share/fonts/base" +/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/" #undef NXAGENT_FONTCACHE_DEBUG #undef NXAGENT_RECONNECT_FONT_DEBUG -- cgit v1.2.3 From d8eac7ccea3dfd61bb2e3a4d0081217efbb89044 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 5 Feb 2017 21:04:46 +0000 Subject: Xserver/dix/main.c: ErrorF requires a string to end with an EOL char. --- nx-X11/programs/Xserver/dix/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index 553ad6c03..7bd41d865 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -388,7 +388,7 @@ main(int argc, char *argv[], char *envp[]) SetFontPath(0, 0, (unsigned char *)defaultFontPath, &error); } else { if (SetDefaultFontPath(defaultFontPath) != Success) - ErrorF("failed to set default font path '%s'", + ErrorF("failed to set default font path '%s'\n", defaultFontPath); } if (!SetDefaultFont(defaultTextFont)) -- cgit v1.2.3 From d981d938dade2967e70322c0bf934efeeb1da716 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 5 Feb 2017 17:06:55 +0000 Subject: {dix/,hw/nxagent/NX}dixfont.{c,h}: Support using builtin-fonts. Makes dependency on X11's misc fonts package obsolete. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This backports a mixture of these X.org commits (only focusing on SetDefaultFontPath() function): commit 03e8bfa1d122f7dea905d48c93cfd54afd991dfd Author: Alan Coopersmith Date: Sat Nov 27 20:09:04 2010 -0800 Convert existing Xprintf style calls to asprintf style Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Reviewed-by: Mikhail Gusarov commit 12e46e83733b47d2704e1509960192365102af46 Author: Tiago Vignatti Date: Fri Mar 25 22:07:31 2011 +0200 dix: fix memory leak in SetDefaultFontPath Signed-off-by: Tiago Vignatti Reviewed-by: Nicolas Peninguy Reviewed-by: Peter Hutterer commit 6592db6bb526f0c43b4c7b55859c629709e039b4 Author: Mikhail Gusarov Date: Fri Jun 4 16:58:58 2010 +0700 Get rid of xstrdup when argument is definitely non-NULL Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith commit f56cbe1ef24415d0142b9a7d0ab0a031069ccb52 Author: Rémi Cardona Date: Mon Sep 14 17:09:59 2009 +0200 dix: append "built-ins" to the font path in SetDefaultFontPath 49b93df8a3002db7196aa3fc1fd8dca1c12a55d6 made the hard dependency on a "fixed" font go away but only Xorg could use the built-ins fonts by default. With this commit, all DDXs get "built-ins" appended to their FontPath, not just Xorg. Tested with Xorg, Xvfb and Xnest. Signed-off-by: Rémi Cardona Signed-off-by: Jon TURNEY Tested-by: Jon TURNEY Signed-off-by: Peter Hutterer commit 49b93df8a3002db7196aa3fc1fd8dca1c12a55d6 Author: Paulo Cesar Pereira de Andrade Date: Wed Jan 7 19:37:03 2009 -0200 Default to use standard bitmap fonts, with builtins as fallback The builtin-fonts configure option was removed, as it at best should have been a runtime option. Instead, now it always register all "font path element" backends, and adds built-ins fonts at the end of the default font path. This should be a more reasonable solution, to "correct" the most common Xorg FAQ (could not open default font 'fixed'), and also don't break by default applications that use only the standard/historical X Font rendering. Backported-to-NX-by: Mike Gabriel Fixes ArcticaProject/nx-libs#84. Fixes ArcticaProject/nx-libs#285. --- nx-X11/programs/Xserver/dix/dixfonts.c | 4 +++ nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 47 +++++++++++++++++++------ nx-X11/programs/Xserver/include/dixfont.h | 5 +++ 3 files changed, 45 insertions(+), 11 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index f7d047c2d..bbce105e3 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1925,7 +1925,11 @@ InitFonts () { patternCache = MakeFontPatternCache(); +#if defined(BUILTIN_FONTS) || defined(NXAGENT_SERVER) + BuiltinRegisterFpeFunctions(); +#else register_fpe_functions(); +#endif } int diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 294a5727d..b3d7cc9d7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -926,6 +926,9 @@ bail: int SetDefaultFontPath(char *path) { + char *temp_path, + *start, + *end; unsigned char *cp, *pp, *nump, @@ -936,20 +939,41 @@ SetDefaultFontPath(char *path) size = 0, bad; - /* get enough for string, plus values -- use up commas */ #ifdef NX_TRANS_SOCKET - len = strlen(_NXGetFontPath(path)) + 1; -#else - len = strlen(path) + 1; -#endif + path = (char *) _NXGetFontPath(path); +#endif /* NX_TRANS_SOCKET */ + + start = path; + + /* ensure temp_path contains "built-ins" */ + while (1) { + start = strstr(start, "built-ins"); + if (start == NULL) + break; + end = start + strlen("built-ins"); + if ((start == path || start[-1] == ',') && (!*end || *end == ',')) + break; + start = end; + } + if (!start) { + if (asprintf(&temp_path, "%s%sbuilt-ins", path, *path ? "," : "") + == -1) + temp_path = NULL; + } + else { + temp_path = strdup(path); + } + if (!temp_path) + return BadAlloc; + + /* get enough for string, plus values -- use up commas */ + len = strlen(temp_path) + 1; nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) + if (!newpath) { + free(temp_path); return BadAlloc; -#ifdef NX_TRANS_SOCKET - pp = (unsigned char *) _NXGetFontPath(path); -#else - pp = (unsigned char *) path; -#endif + } + pp = (unsigned char *) temp_path; cp++; while (*pp) { if (*pp == ',') { @@ -968,6 +992,7 @@ SetDefaultFontPath(char *path) err = SetFontPathElements(num, newpath, &bad, TRUE); DEALLOCATE_LOCAL(newpath); + free(temp_path); return err; } diff --git a/nx-X11/programs/Xserver/include/dixfont.h b/nx-X11/programs/Xserver/include/dixfont.h index 6582be24c..1303d0e0f 100644 --- a/nx-X11/programs/Xserver/include/dixfont.h +++ b/nx-X11/programs/Xserver/include/dixfont.h @@ -150,4 +150,9 @@ extern void InitGlyphCaching(void); extern void SetGlyphCachingMode(int /*newmode*/); +/* + * libXfont/src/builtins/builtin.h + */ +extern _X_EXPORT void BuiltinRegisterFpeFunctions(void); + #endif /* DIXFONT_H */ -- cgit v1.2.3 From bd98ba2d7577584e650492bbcb4ea9dd0a3aa809 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 5 Feb 2017 21:35:33 +0000 Subject: For consistency, apply patch from previous commit (630a7c3) to the original Xserver/dix/dixfonts.c file, although the code is undef'ed when NXAGENT_SERVER is defined. --- nx-X11/programs/Xserver/dix/dixfonts.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index bbce105e3..4ac9fa696 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1824,6 +1824,9 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) int SetDefaultFontPath(char *path) { + char *temp_path, + *start, + *end; unsigned char *cp, *pp, *nump, @@ -1834,12 +1837,36 @@ SetDefaultFontPath(char *path) size = 0, bad; + /* ensure temp_path contains "built-ins" */ + start = path; + while (1) { + start = strstr(start, "built-ins"); + if (start == NULL) + break; + end = start + strlen("built-ins"); + if ((start == path || start[-1] == ',') && (!*end || *end == ',')) + break; + start = end; + } + if (!start) { + if (asprintf(&temp_path, "%s%sbuilt-ins", path, *path ? "," : "") + == -1) + temp_path = NULL; + } + else { + temp_path = strdup(path); + } + if (!temp_path) + return BadAlloc; + /* get enough for string, plus values -- use up commas */ - len = strlen(path) + 1; + len = strlen(temp_path) + 1; nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) + if (!newpath) { + free(temp_path); return BadAlloc; - pp = (unsigned char *) path; + } + pp = (unsigned char *) temp_path; cp++; while (*pp) { if (*pp == ',') { @@ -1858,6 +1885,7 @@ SetDefaultFontPath(char *path) err = SetFontPathElements(num, newpath, &bad, TRUE); DEALLOCATE_LOCAL(newpath); + free(temp_path); return err; } -- cgit v1.2.3 From ec30a857eb0d67b232f8d43e63a6370023f4c4d0 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Thu, 9 Feb 2017 08:55:07 +0100 Subject: dix: use one single function to register fpe fonts In NXAGENT_SERVER we can also fully rely on libXfont for handling fpe internals. Backported from X.org: commit 75536ee80595c79bba95a1fb6844126ee08486d4 Author: Tiago Vignatti Date: Wed Jun 23 15:18:03 2010 +0300 dix: use one single function to register fpe fonts X server doesn't need to understand fpe internals, so use register_fpe_functions from libXfont. It's required to get new version of libXfont, therefore adjust it to be passed to autoconf. Signed-off-by: Tiago Vignatti Reviewed-by: Mikhail Gusarov Reviewed-by: Alex Deucher Signed-off-by: Keith Packard Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/dix/dixfonts.c | 4 ---- nx-X11/programs/Xserver/include/dixfont.h | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index 4ac9fa696..c8e5f6cf0 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1953,11 +1953,7 @@ InitFonts () { patternCache = MakeFontPatternCache(); -#if defined(BUILTIN_FONTS) || defined(NXAGENT_SERVER) - BuiltinRegisterFpeFunctions(); -#else register_fpe_functions(); -#endif } int diff --git a/nx-X11/programs/Xserver/include/dixfont.h b/nx-X11/programs/Xserver/include/dixfont.h index 1303d0e0f..6149d2160 100644 --- a/nx-X11/programs/Xserver/include/dixfont.h +++ b/nx-X11/programs/Xserver/include/dixfont.h @@ -150,9 +150,6 @@ extern void InitGlyphCaching(void); extern void SetGlyphCachingMode(int /*newmode*/); -/* - * libXfont/src/builtins/builtin.h - */ -extern _X_EXPORT void BuiltinRegisterFpeFunctions(void); +extern void register_fpe_functions(void); #endif /* DIXFONT_H */ -- cgit v1.2.3