xtsol.patch revision 705
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use subject to license terms.
#
# 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, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
#
# 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
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.
diff -urp -x '*~' -x '*.orig' Makefile.am Makefile.am
--- Makefile.am 2009-05-08 17:43:31.905647000 -0700
+++ Makefile.am 2009-05-08 17:43:40.080197000 -0700
@@ -17,6 +17,10 @@ if RECORD
RECORD_DIR=record
endif
+if BUILD_TSOL_MODULE
+TSOL_DIR=tsol
+endif
+
SUBDIRS = \
doc \
include \
@@ -37,6 +41,7 @@ SUBDIRS = \
$(COMPOSITE_DIR) \
$(GLX_DIR) \
IA \
+ $(TSOL_DIR) \
exa \
config \
hw
diff -urp -x '*~' -x '*.orig' Xext/security.c Xext/security.c
--- Xext/security.c 2009-05-08 17:43:31.396504000 -0700
+++ Xext/security.c 2009-05-08 17:43:40.081858000 -0700
@@ -1148,3 +1148,27 @@ SecurityExtensionInit(INITARGS)
/* Label objects that were created before we could register ourself */
SecurityLabelInitial();
}
+
+/* API needed for Xtsol module to get/set client trustLevel */
+_X_EXPORT unsigned int
+getClientTrustLevel(ClientPtr client)
+{
+ SecurityStateRec *state;
+
+ state = dixLookupPrivate(&client->devPrivates, stateKey);
+
+ return state->trustLevel;
+}
+
+_X_EXPORT unsigned int
+setClientTrustLevel(ClientPtr client, unsigned int newLevel)
+{
+ SecurityStateRec *state;
+ unsigned int oldLevel;
+
+ state = dixLookupPrivate(&client->devPrivates, stateKey);
+ oldLevel = state->trustLevel;
+ state->trustLevel = newLevel;
+
+ return oldLevel;
+}
diff -urp -x '*~' -x '*.orig' Xext/securitysrv.h Xext/securitysrv.h
--- Xext/securitysrv.h 2008-01-04 14:42:34.000000000 -0800
+++ Xext/securitysrv.h 2009-05-08 17:43:40.083180000 -0700
@@ -80,4 +80,8 @@ typedef struct {
/* Give this value or higher to the -audit option to get security messages */
#define SECURITY_AUDIT_LEVEL 4
+/* API needed for Xtsol module to get/set client trustLevel */
+extern unsigned int getClientTrustLevel(ClientPtr client);
+extern unsigned int setClientTrustLevel(ClientPtr client, unsigned int newLevel);
+
#endif /* _SECURITY_SRV_H */
diff -urp -x '*~' -x '*.orig' configure.ac configure.ac
--- configure.ac 2009-05-08 17:43:31.908445000 -0700
+++ configure.ac 2009-05-08 17:43:40.087326000 -0700
@@ -207,6 +207,14 @@ dnl Find the math libary
AC_CHECK_LIB(m, sqrt)
AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function]))
+dnl Check for libtsol for Solaris Trusted Extensions module
+AC_CHECK_LIB(tsol, bsllow, [BUILD_TSOL_MODULE=yes], [BUILD_TSOL_MODULE=no])
+AM_CONDITIONAL(BUILD_TSOL_MODULE, [test x$BUILD_TSOL_MODULE = xyes])
+if test "x$BUILD_TSOL_MODULE" = xyes; then
+ TSOL_LIB='$(top_builddir)/tsol/libxtsol.la'
+ TSOL_SYS_LIBS='-ltsol -ltsnet -lsecdb -lbsm'
+fi
+
AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
dnl AGPGART headers
@@ -1255,8 +1263,8 @@ AC_MSG_RESULT([$XVFB])
AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
if test "x$XVFB" = xyes; then
- XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $IA_LIB"
- XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
+ XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $IA_LIB $TSOL_LIB"
+ XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS $TSOL_SYS_LIBS"
AC_SUBST([XVFB_LIBS])
AC_SUBST([XVFB_SYS_LIBS])
fi
@@ -1273,8 +1281,8 @@ AC_MSG_RESULT([$XNEST])
AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
if test "x$XNEST" = xyes; then
- XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $OS_LIB $CONFIG_LIB $IA_LIB"
- XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
+ XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $OS_LIB $CONFIG_LIB $IA_LIB $TSOL_LIB"
+ XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS $TSOL_SYS_LIBS"
AC_SUBST([XNEST_LIBS])
AC_SUBST([XNEST_SYS_LIBS])
fi
@@ -1776,7 +1784,7 @@ if test "$KDRIVE" = yes; then
KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
- KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $IA_LIB $OS_LIB"
+ KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $IA_LIB $TSOL_LIB $OS_LIB"
KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
case $host_os in
*linux*)
@@ -1936,3 +1944,6 @@ xorg-server.pc
# Add Sun IA extension
AC_OUTPUT([IA/Makefile])
+
+# Add Sun Trusted Extensions extension
+AC_OUTPUT([tsol/Makefile])
diff -urp -x '*~' -x '*.orig' dix/dispatch.c dix/dispatch.c
--- dix/dispatch.c 2009-05-08 17:43:31.282930000 -0700
+++ dix/dispatch.c 2009-05-08 17:43:40.089486000 -0700
@@ -74,8 +74,8 @@ Equipment Corporation.
******************************************************************/
-/* XSERVER_DTRACE additions:
- * Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
@@ -173,6 +173,10 @@ extern int connBlockScreenStart;
static void KillAllClients(void);
+#ifdef TSOL
+SecurityHookPtr pSecHook = NULL;
+#endif /* TSOL */
+
static int nextFreeClientID; /* always MIN free client ID */
static int nClients; /* number of authorized clients */
@@ -767,7 +771,12 @@ ProcCirculateWindow(ClientPtr client)
return(client->noClientException);
}
-static int
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+int
GetGeometry(ClientPtr client, xGetGeometryReply *rep)
{
DrawablePtr pDraw;
@@ -1901,7 +1910,12 @@ ProcPutImage(ClientPtr client)
return (client->noClientException);
}
-static int
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+int
DoGetImage(ClientPtr client, int format, Drawable drawable,
int x, int y, int width, int height,
Mask planemask, xGetImageReply **im_return)
diff -urp -x '*~' -x '*.orig' dix/events.c dix/events.c
--- dix/events.c 2009-04-14 10:14:56.000000000 -0700
+++ dix/events.c 2009-05-08 17:43:40.092405000 -0700
@@ -76,7 +76,7 @@ Equipment Corporation.
/*****************************************************************
-Copyright 2003-2005 Sun Microsystems, Inc.
+Copyright 2007 Sun Microsystems, Inc.
All rights reserved.
@@ -328,7 +328,12 @@ IsKeyboardDevice(DeviceIntPtr dev)
return (dev->key && dev->kbdfeed) && !IsPointerDevice(dev);
}
-static WindowPtr XYToWindow(
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+WindowPtr XYToWindow(
DeviceIntPtr pDev,
int x,
int y
@@ -2477,7 +2482,12 @@ PointInBorderSize(WindowPtr pWin, int x,
*
* @returns the window at the given coordinates.
*/
-static WindowPtr
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+WindowPtr
XYToWindow(DeviceIntPtr pDev, int x, int y)
{
WindowPtr pWin;
diff -urp -x '*~' -x '*.orig' dix/window.c dix/window.c
--- dix/window.c 2009-04-14 10:14:56.000000000 -0700
+++ dix/window.c 2009-05-08 17:43:40.094539000 -0700
@@ -98,6 +98,33 @@ Equipment Corporation.
******************************************************************/
+/* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ *
+ * 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
@@ -180,6 +207,11 @@ static Bool TileScreenSaver(int i, int k
#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
+#ifdef TSOL
+#include "extnsionst.h"
+extern SecurityHookPtr pSecHook;
+#endif /* TSOL */
+
#ifdef DEBUG
/******
* PrintWindowTree
@@ -1881,7 +1913,12 @@ IsSiblingAboveMe(
return(Below);
}
-static BoxPtr
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+BoxPtr
WindowExtents(
WindowPtr pWin,
BoxPtr pBox)
@@ -1917,7 +1954,12 @@ MakeBoundingRegion (
return pRgn;
}
-static Bool
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+Bool
ShapeOverlap (
WindowPtr pWin,
BoxPtr pWinBox,
@@ -2121,7 +2163,12 @@ WhereDoIGoInTheStack(
}
}
-static void
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+void
ReflectStackChange(
WindowPtr pWin,
WindowPtr pSib,
diff -urp -x '*~' -x '*.orig' hw/dmx/Makefile.am hw/dmx/Makefile.am
--- hw/dmx/Makefile.am 2009-05-08 17:43:31.909047000 -0700
+++ hw/dmx/Makefile.am 2009-05-08 17:43:40.095075000 -0700
@@ -87,6 +87,7 @@ XDMX_LIBS = \
input/libdmxinput.a \
config/libdmxconfig.a \
$(top_builddir)/IA/libIA.la \
+ $(top_builddir)/tsol/libxtsol.la
$(XSERVER_LIBS)
Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Config.c hw/xfree86/common/xf86Config.c
--- hw/xfree86/common/xf86Config.c 2009-05-08 17:43:31.911031000 -0700
+++ hw/xfree86/common/xf86Config.c 2009-05-08 17:43:40.153291000 -0700
@@ -122,6 +122,7 @@ static ModuleDefault ModuleDefaults[] =
{.name = "dri2", .toLoad = TRUE, .load_opt=NULL},
#endif
{.name = "ia", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "xtsol", .toLoad = TRUE, .load_opt=NULL},
{.name = NULL, .toLoad = FALSE, .load_opt=NULL}
};
diff -urp -x '*~' -x '*.orig' hw/xfree86/dixmods/Makefile.am hw/xfree86/dixmods/Makefile.am
--- hw/xfree86/dixmods/Makefile.am 2009-05-08 17:43:31.912778000 -0700
+++ hw/xfree86/dixmods/Makefile.am 2009-05-08 17:43:40.161877000 -0700
@@ -73,3 +73,11 @@ extsmodule_LTLIBRARIES += libia.la
libia_la_LDFLAGS = -avoid-version
libia_la_LIBADD = $(top_builddir)/IA/libIA.la
libia_la_SOURCES = iamodule.c
+
+if BUILD_TSOL_MODULE
+# Sun Trusted Extensions extension module additions
+extsmodule_LTLIBRARIES += libxtsol.la
+libxtsol_la_LDFLAGS = -avoid-version
+libxtsol_la_LIBADD = $(top_builddir)/tsol/libxtsol.la
+libxtsol_la_SOURCES = tsolmodule.c
+endif
diff -urp -x '*~' -x '*.orig' include/dix.h include/dix.h
--- include/dix.h 2009-05-08 17:43:31.316827000 -0700
+++ include/dix.h 2009-05-08 17:43:40.162550000 -0700
@@ -171,6 +171,14 @@ extern void MarkClientException(
extern void ddxBeforeReset (void);
+#ifdef TSOL
+extern int DoGetImage(ClientPtr client, int format, Drawable drawable,
+ int x, int y, int width, int height,
+ Mask planemask, xGetImageReply **im_return);
+
+extern int GetGeometry(ClientPtr client, xGetGeometryReply *rep);
+#endif
+
/* dixutils.c */
extern void CopyISOLatin1Lowered(
diff -urp -x '*~' -x '*.orig' include/dixevents.h include/dixevents.h
--- include/dixevents.h 2009-04-14 10:14:57.000000000 -0700
+++ include/dixevents.h 2009-05-08 17:43:40.163000000 -0700
@@ -88,4 +88,8 @@ extern void PostSyntheticMotion(DeviceIn
unsigned long time);
#endif
+#ifdef TSOL
+extern WindowPtr XYToWindow(DeviceIntPtr pDev, int x, int y);
+#endif
+
#endif /* DIXEVENTS_H */
diff -urp -x '*~' -x '*.orig' include/extnsionst.h include/extnsionst.h
--- include/extnsionst.h 2009-04-14 10:14:57.000000000 -0700
+++ include/extnsionst.h 2009-05-08 17:43:40.164856000 -0700
@@ -45,6 +45,34 @@ SOFTWARE.
******************************************************************/
+/* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
#ifndef EXTENSIONSTRUCT_H
#define EXTENSIONSTRUCT_H
@@ -55,6 +83,10 @@ SOFTWARE.
#include "gc.h"
#include "privates.h"
+#ifdef TSOL
+#include "inputstr.h"
+#endif /* TSOL */
+
typedef struct _ExtensionEntry {
int index;
void (* CloseDown)( /* called at server shutdown */
@@ -108,5 +140,21 @@ extern Bool AddExtensionAlias(
extern ExtensionEntry *CheckExtension(const char *extname);
extern ExtensionEntry *GetExtensionEntry(int major);
+#ifdef TSOL
+typedef struct
+{
+ XID (*CheckAuthorization)(unsigned int, char *, unsigned int,
+ char *, ClientPtr , char **);
+ int (*ChangeWindowProperty)(ClientPtr, WindowPtr, Atom, Atom, int, int,
+ unsigned long, pointer, Bool);
+ int (*DeleteProperty)(ClientPtr, WindowPtr, Atom);
+ void (*DeleteClientFromAnySelections)(ClientPtr);
+ void (*DeleteWindowFromAnySelections)(WindowPtr);
+} SecurityHook, *SecurityHookPtr;
+
+extern SecurityHookPtr pSecHook;
+
+#endif /* TSOL */
+
#endif /* EXTENSIONSTRUCT_H */
diff -urp -x '*~' -x '*.orig' include/window.h include/window.h
--- include/window.h 2009-04-14 10:14:57.000000000 -0700
+++ include/window.h 2009-05-08 17:43:40.165637000 -0700
@@ -269,4 +269,9 @@ extern void DisableMapUnmapEvents(
extern void EnableMapUnmapEvents(
WindowPtr /* pWin */ );
+#ifdef TSOL
+# include "validate.h" /* needed for VTKind enum definition */
+extern void ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind);
+#endif
+
#endif /* WINDOW_H */
diff -urp -x '*~' -x '*.orig' mi/miinitext.c mi/miinitext.c
--- mi/miinitext.c 2009-05-08 17:43:31.913906000 -0700
+++ mi/miinitext.c 2009-05-08 17:43:40.166609000 -0700
@@ -155,6 +155,9 @@ extern Bool noGEExtension;
#ifdef SolarisIAExtension
Bool noIAExtension;
#endif
+#ifdef TSOL
+Bool noXTSolExtension;
+#endif
#ifndef XFree86LOADER
#define INITARGS void
@@ -193,6 +196,10 @@ typedef void (*InitExtension)(INITARGS);
#ifdef SolarisIAExtension
#include <X11/extensions/interactive.h>
#endif
+#ifdef TSOL
+#define _XTSOL_SERVER
+#include <X11/extensions/Xtsol.h>
+#endif
/* FIXME: this whole block of externs should be from the appropriate headers */
#ifdef MITSHM
@@ -282,6 +289,9 @@ extern void GEExtensionInit(INITARGS);
#ifdef SolarisIAExtension
extern void IAExtensionInit(void);
#endif
+#ifdef TSOL
+extern void TsolExtensionInit(void);
+#endif
/* The following is only a small first step towards run-time
* configurable extensions.
@@ -331,6 +341,9 @@ static ExtensionToggle ExtensionToggleLi
#ifdef SolarisIAExtension
{ IANAME /* "SolarisIA" */, &noIAExtension },
#endif
+#ifdef TSOL
+ { TSOLNAME /* "SUN_TSOL" */, &noXTSolExtension },
+#endif
#ifdef RES
{ "X-Resource", &noResExtension },
#endif
@@ -493,6 +506,11 @@ InitExtensions(int argc, char *argv[])
#ifdef SolarisIAExtension
if (!noIAExtension) IAExtensionInit();
#endif
+#ifdef TSOL
+ if (!noXTSolExtension) {
+ TsolExtensionInit();
+ }
+#endif
}
#else /* XFree86LOADER */
diff -urp -x '*~' -x '*.orig' os/connection.c os/connection.c
--- os/connection.c 2009-05-08 17:43:31.889578000 -0700
+++ os/connection.c 2009-05-08 17:43:40.167673000 -0700
@@ -44,6 +44,33 @@ ARISING OUT OF OR IN CONNECTION WITH THE
SOFTWARE.
******************************************************************/
+/* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ *
+ * 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
/*****************************************************************
* Stuff to create connections --- OS dependent
*
@@ -261,6 +288,11 @@ static int ListenTransCount;
static void ErrorConnMax(XtransConnInfo /* trans_conn */);
+#ifdef TSOL
+#include "extnsionst.h"
+extern SecurityHookPtr pSecHook;
+#endif /* TSOL */
+
static XtransConnInfo
lookup_trans_conn (int fd)
{
@@ -671,6 +703,12 @@ ClientAuthorized(ClientPtr client,
priv = (OsCommPtr)client->osPrivate;
trans_conn = priv->trans_conn;
+#ifdef TSOL
+ if (pSecHook)
+ auth_id = (*pSecHook->CheckAuthorization) (proto_n, auth_proto,
+ string_n, auth_string, client, &reason);
+ else
+#endif /* TSOL */
/* Allow any client to connect without authorization on a launchd socket,
because it is securely created -- this prevents a race condition on launch */
if(trans_conn->flags & TRANS_NOXAUTH) {