mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-29 21:46:40 +00:00
Merge branch 'master' into XACE-SELINUX
Conflicts: dix/devices.c dix/property.c include/dix.h
This commit is contained in:
commit
e34fcd2bf4
755 changed files with 15820 additions and 5805 deletions
|
|
@ -59,5 +59,9 @@ noinst_PROGRAMS = os.O
|
|||
|
||||
os.O: dtrace.o $(am_libos_la_OBJECTS)
|
||||
ld -r -o $@ dtrace.o .libs/*.o
|
||||
|
||||
endif
|
||||
|
||||
os.c:
|
||||
touch $@
|
||||
|
||||
CLEANFILES = os.c
|
||||
|
|
|
|||
|
|
@ -67,9 +67,6 @@ SOFTWARE.
|
|||
#include <X11/X.h>
|
||||
#include "misc.h"
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t)
|
||||
#endif
|
||||
#include "osdep.h"
|
||||
#include <X11/Xpoll.h>
|
||||
#include "dixstruct.h"
|
||||
|
|
|
|||
|
|
@ -1193,9 +1193,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)
|
||||
{
|
||||
|
|
@ -1206,10 +1203,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]);
|
||||
|
|
@ -1825,7 +1818,7 @@ ConvertAddr (
|
|||
switch (saddr->sa_family)
|
||||
{
|
||||
case AF_UNSPEC:
|
||||
#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)
|
||||
#if defined(UNIXCONN) || defined(LOCALCONN)
|
||||
case AF_UNIX:
|
||||
#endif
|
||||
return FamilyLocal;
|
||||
|
|
|
|||
|
|
@ -107,11 +107,6 @@ SOFTWARE.
|
|||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t)
|
||||
extern __const__ int _nfiles;
|
||||
#endif
|
||||
|
||||
#if defined(TCPCONN) || defined(STREAMSCONN)
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
|
|
@ -124,21 +119,17 @@ extern __const__ int _nfiles;
|
|||
# ifdef CSRG_BASED
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# ifndef __UNIXOS2__
|
||||
# include <netinet/tcp.h>
|
||||
# endif
|
||||
# include <netinet/tcp.h>
|
||||
# endif
|
||||
# endif
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__UNIXOS2__)
|
||||
#ifndef Lynx
|
||||
#include <sys/uio.h>
|
||||
#else
|
||||
#include <uio.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
#include "misc.h" /* for typedef of pointer */
|
||||
#include "osdep.h"
|
||||
|
|
@ -171,8 +162,10 @@ extern __const__ int _nfiles;
|
|||
#ifdef XSERVER_DTRACE
|
||||
# include <sys/types.h>
|
||||
typedef const char *string;
|
||||
# ifndef HAS_GETPEERUCRED
|
||||
# define zoneid_t int
|
||||
# endif
|
||||
# include "../dix/Xserver-dtrace.h"
|
||||
# include <ucred.h>
|
||||
#endif
|
||||
|
||||
static int lastfdesc; /* maximum file descriptor */
|
||||
|
|
@ -192,9 +185,6 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */
|
|||
static 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;
|
||||
|
||||
|
|
@ -327,8 +317,6 @@ InitConnectionLimits(void)
|
|||
|
||||
#ifndef __CYGWIN__
|
||||
|
||||
#ifndef __UNIXOS2__
|
||||
|
||||
#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX)
|
||||
lastfdesc = sysconf(_SC_OPEN_MAX) - 1;
|
||||
#endif
|
||||
|
|
@ -343,10 +331,6 @@ InitConnectionLimits(void)
|
|||
lastfdesc = _NFILE - 1;
|
||||
#endif
|
||||
|
||||
#else /* __UNIXOS2__ */
|
||||
lastfdesc = _nfiles - 1;
|
||||
#endif
|
||||
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
/* This is the fallback */
|
||||
|
|
@ -462,15 +446,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);
|
||||
|
|
@ -563,6 +538,8 @@ AuthAudit (ClientPtr client, Bool letin,
|
|||
char client_uid_string[64];
|
||||
#ifdef HAS_GETPEERUCRED
|
||||
ucred_t *peercred = NULL;
|
||||
#endif
|
||||
#if defined(HAS_GETPEERUCRED) || defined(XSERVER_DTRACE)
|
||||
pid_t client_pid = -1;
|
||||
zoneid_t client_zid = -1;
|
||||
#endif
|
||||
|
|
@ -573,7 +550,7 @@ AuthAudit (ClientPtr client, Bool letin,
|
|||
switch (saddr->sa_family)
|
||||
{
|
||||
case AF_UNSPEC:
|
||||
#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)
|
||||
#if defined(UNIXCONN) || defined(LOCALCONN)
|
||||
case AF_UNIX:
|
||||
#endif
|
||||
strcpy(out, "local host");
|
||||
|
|
|
|||
6
os/io.c
6
os/io.c
|
|
@ -70,7 +70,7 @@ SOFTWARE.
|
|||
#include <X11/Xtrans/Xtrans.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <errno.h>
|
||||
#if !defined(__UNIXOS2__) && !defined(WIN32)
|
||||
#if !defined(WIN32)
|
||||
#ifndef Lynx
|
||||
#include <sys/uio.h>
|
||||
#else
|
||||
|
|
@ -98,7 +98,6 @@ static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped);
|
|||
/* 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)
|
||||
|
|
@ -112,9 +111,6 @@ static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped);
|
|||
#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
|
||||
|
||||
static Bool CriticalOutputPending;
|
||||
static int timesThisConnection = 0;
|
||||
|
|
|
|||
3
os/log.c
3
os/log.c
|
|
@ -182,9 +182,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);
|
||||
|
|
|
|||
11
os/oscolor.c
11
os/oscolor.c
|
|
@ -225,16 +225,9 @@ OsInitColors(void)
|
|||
|
||||
if (!was_here)
|
||||
{
|
||||
#ifndef __UNIXOS2__
|
||||
path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5);
|
||||
strcpy(path, rgbPath);
|
||||
strcat(path, ".txt");
|
||||
#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")))
|
||||
{
|
||||
ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath );
|
||||
|
|
@ -245,11 +238,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 &&
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* $OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
*
|
||||
|
|
@ -15,7 +13,6 @@
|
|||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
/* $XFree86$ */
|
||||
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
*
|
||||
|
|
@ -15,7 +13,6 @@
|
|||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
/* $XFree86$ */
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
|
|
|
|||
26
os/utils.c
26
os/utils.c
|
|
@ -297,9 +297,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"
|
||||
|
|
@ -309,10 +307,6 @@ OsSignal(sig, handler)
|
|||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
#define link rename
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#ifndef Lynx
|
||||
#include <sys/param.h>
|
||||
|
|
@ -351,14 +345,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) :
|
||||
|
|
@ -399,12 +386,10 @@ LockServer(void)
|
|||
FatalError("Could not create lock file in %s\n", tmp);
|
||||
(void) sprintf(pid_str, "%10ld\n", (long)getpid());
|
||||
(void) write(lfd, pid_str, 11);
|
||||
#ifndef __UNIXOS2__
|
||||
#ifndef USE_CHMOD
|
||||
(void) fchmod(lfd, 0444);
|
||||
#else
|
||||
(void) chmod(tmp, 0444);
|
||||
#endif
|
||||
#endif
|
||||
(void) close(lfd);
|
||||
|
||||
|
|
@ -484,9 +469,6 @@ UnlockServer(void)
|
|||
|
||||
if (!StillLocking){
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
(void) chmod(LockFile,S_IREAD|S_IWRITE);
|
||||
#endif /* __UNIXOS2__ */
|
||||
(void) unlink(LockFile);
|
||||
}
|
||||
}
|
||||
|
|
@ -914,7 +896,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
|
||||
|
|
@ -1246,7 +1228,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
|
||||
|
|
@ -1677,7 +1659,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.
|
||||
|
|
@ -1952,7 +1934,7 @@ Fclose(pointer iop)
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif /* !WIN32 && !__UNIXOS2__ */
|
||||
#endif /* !WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue