summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/Makefile.am12
-rw-r--r--os/WaitFor.c3
-rw-r--r--os/access.c9
-rw-r--r--os/connection.c37
-rw-r--r--os/io.c6
-rw-r--r--os/log.c3
-rw-r--r--os/oscolor.c11
-rw-r--r--os/osdep.h2
-rw-r--r--os/osinit.c2
-rw-r--r--os/rpcauth.c16
-rw-r--r--os/strlcat.c3
-rw-r--r--os/strlcpy.c3
-rw-r--r--os/utils.c26
13 files changed, 33 insertions, 100 deletions
diff --git a/os/Makefile.am b/os/Makefile.am
index c5e7b0397..d2a989782 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -3,9 +3,9 @@ noinst_LTLIBRARIES = libos.la libcwrapper.la
AM_CFLAGS = $(DIX_CFLAGS)
# FIXME: Add support for these in configure.ac
-SECURERPC_SRCS = rpcauth.c
INTERNALMALLOC_SRCS = xalloc.c
+SECURERPC_SRCS = rpcauth.c
XCSECURITY_SRCS = secauth.c
XDMCP_SRCS = xdmcp.c
STRLCAT_SRCS = strlcat.c strlcpy.c
@@ -28,6 +28,10 @@ libos_la_SOURCES = \
xprintf.c \
$(XORG_SRCS)
+if SECURE_RPC
+libos_la_SOURCES += $(SECURERPC_SRCS)
+endif
+
if XCSECURITY
libos_la_SOURCES += $(XCSECURITY_SRCS)
endif
@@ -59,5 +63,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
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 4a606ac7d..ec1592c01 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.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"
diff --git a/os/access.c b/os/access.c
index 2de0ead43..e194bb8e6 100644
--- a/os/access.c
+++ b/os/access.c
@@ -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;
diff --git a/os/connection.c b/os/connection.c
index cb3443c5b..d975f87d2 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -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");
diff --git a/os/io.c b/os/io.c
index 4e83e682b..835af54d9 100644
--- a/os/io.c
+++ b/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;
diff --git a/os/log.c b/os/log.c
index e8aa3fa01..0860847ec 100644
--- a/os/log.c
+++ b/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);
diff --git a/os/oscolor.c b/os/oscolor.c
index d53e4d8ff..e1756926d 100644
--- a/os/oscolor.c
+++ b/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 &&
diff --git a/os/osdep.h b/os/osdep.h
index 04e88ea49..965436df5 100644
--- a/os/osdep.h
+++ b/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/os/osinit.c b/os/osinit.c
index 9a1c1133a..1f09f068e 100644
--- a/os/osinit.c
+++ b/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/os/rpcauth.c b/os/rpcauth.c
index 603844aee..3451ac18b 100644
--- a/os/rpcauth.c
+++ b/os/rpcauth.c
@@ -39,7 +39,7 @@ from The Open Group.
#ifdef SECURE_RPC
#include <X11/X.h>
-#include "Xauth.h"
+#include <X11/Xauth.h>
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
@@ -135,7 +135,7 @@ CheckNetName (
static char rpc_error[MAXNETNAMELEN+50];
-XID
+_X_HIDDEN XID
SecureRPCCheck (unsigned short data_length, char *data,
ClientPtr client, char **reason)
{
@@ -159,14 +159,14 @@ SecureRPCCheck (unsigned short data_length, char *data,
return (XID) ~0L;
}
-void
+_X_HIDDEN void
SecureRPCInit (void)
{
if (rpc_id == ~0L)
AddAuthorization (9, "SUN-DES-1", 0, (char *) 0);
}
-int
+_X_HIDDEN int
SecureRPCAdd (unsigned short data_length, char *data, XID id)
{
if (data_length)
@@ -175,26 +175,26 @@ SecureRPCAdd (unsigned short data_length, char *data, XID id)
return 1;
}
-int
+_X_HIDDEN int
SecureRPCReset (void)
{
rpc_id = (XID) ~0L;
return 1;
}
-XID
+_X_HIDDEN XID
SecureRPCToID (unsigned short data_length, char *data)
{
return rpc_id;
}
-int
+_X_HIDDEN int
SecureRPCFromID (XID id, unsigned short *data_lenp, char **datap)
{
return 0;
}
-int
+_X_HIDDEN int
SecureRPCRemove (unsigned short data_length, char *data)
{
return 0;
diff --git a/os/strlcat.c b/os/strlcat.c
index 28e2338f9..b57fcc563 100644
--- a/os/strlcat.c
+++ b/os/strlcat.c
@@ -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
diff --git a/os/strlcpy.c b/os/strlcpy.c
index 42442cc30..989d0385e 100644
--- a/os/strlcpy.c
+++ b/os/strlcpy.c
@@ -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>
diff --git a/os/utils.c b/os/utils.c
index dd5acd34b..3bb7dbeba 100644
--- a/os/utils.c
+++ b/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,13 +386,11 @@ 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 */
/*