xtsol.patch revision 235
688N/Adiff -urp -x '*~' -x '*.orig' Makefile.am Makefile.am
1265N/A--- Makefile.am 2007-09-20 14:21:57.003122000 -0700
688N/A+++ Makefile.am 2007-09-20 14:22:20.855563000 -0700
688N/A@@ -34,6 +34,10 @@ if DBE
919N/A DBE_DIR=dbe
919N/A endif
919N/A
919N/A+if BUILD_TSOL_MODULE
919N/A+TSOL_DIR=tsol
919N/A+endif
919N/A+
919N/A SUBDIRS = \
919N/A doc \
919N/A include \
919N/A@@ -59,6 +63,7 @@ SUBDIRS = \
919N/A $(COMPOSITE_DIR) \
919N/A $(GLX_DIR) \
919N/A IA \
919N/A+ $(TSOL_DIR) \
919N/A exa \
919N/A hw
688N/A
688N/Adiff -urp -x '*~' -x '*.orig' Xext/Makefile.am Xext/Makefile.am
1265N/A--- Xext/Makefile.am 2007-09-20 14:21:56.845261000 -0700
1265N/A+++ Xext/Makefile.am 2007-09-20 14:22:20.855984000 -0700
1265N/A@@ -149,6 +149,10 @@ if DPMSExtension
1265N/A MODULE_SRCS += $(DPMS_SRCS)
962N/A endif
962N/A
943N/A+# Solaris Trusted Extensions / XACE compatibility
688N/A+TSOL_SRCS = tsolCompat.c
688N/A+BUILTIN_SRCS += $(TSOL_SRCS)
688N/A+
688N/A # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la
688N/A
688N/A libXext_la_SOURCES = $(BUILTIN_SRCS) $(MODULE_SRCS)
688N/Adiff -urp -x '*~' -x '*.orig' Xext/security.c Xext/security.c
688N/A--- Xext/security.c 2006-11-16 09:39:03.000000000 -0800
688N/A+++ Xext/security.c 2007-09-20 14:22:20.858055000 -0700
688N/A@@ -72,10 +72,15 @@ typedef struct {
688N/A ((extnsn)->devPrivates[securityExtnsnPrivateIndex].val)
688N/A #define STATEPTR(client) \
688N/A ((client)->devPrivates[securityClientPrivateIndex].ptr)
688N/A+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
688N/A+#define TRUSTLEVEL(client) ((client)->trustLevel)
688N/A+#define AUTHID(client) ((client)->authId)
688N/A+#else
688N/A #define TRUSTLEVEL(client) \
688N/A (((SecurityClientStateRec*)STATEPTR(client))->trustLevel)
688N/A #define AUTHID(client) \
688N/A (((SecurityClientStateRec*)STATEPTR(client))->authId)
688N/A+#endif
688N/A
688N/A CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */
688N/A
688N/Adiff -urp -x '*~' -x '*.orig' configure.ac configure.ac
688N/A--- configure.ac 2007-09-20 14:21:57.684612000 -0700
688N/A+++ configure.ac 2007-09-20 14:22:20.875351000 -0700
962N/A@@ -127,6 +127,13 @@ AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP
962N/A dnl Find the math libary
688N/A AC_CHECK_LIB(m, sqrt)
962N/A
962N/A+dnl Check for libtsol for Solaris Trusted Extensions module
688N/A+AC_CHECK_LIB(tsol, bsllow, [BUILD_TSOL_MODULE=yes], [BUILD_TSOL_MODULE=no])
688N/A+AM_CONDITIONAL(BUILD_TSOL_MODULE, [test x$BUILD_TSOL_MODULE = xyes])
688N/A+if test "x$BUILD_TSOL_MODULE" = xyes; then
688N/A+ TSOL_LIB='$(top_builddir)/tsol/libxtsol.la -ltsol -ltsnet -lsecdb -lbsm'
688N/A+fi
688N/A+
688N/A AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
688N/A
688N/A dnl AGPGART headers
688N/A@@ -1026,7 +1029,7 @@
688N/A AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
688N/A
688N/A if test "x$XVFB" = xyes; then
688N/A- XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $CWRAP_LIB $OS_LIB $LIBS"
688N/A+ XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $TSOL_LIB $CWRAP_LIB $OS_LIB $LIBS"
688N/A AC_SUBST([XVFB_LIBS])
688N/A fi
688N/A
688N/A@@ -1042,7 +1045,7 @@
688N/A AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
688N/A
688N/A if test "x$XNEST" = xyes; then
688N/A- XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $CWRAP_LIB $OS_LIB $LIBS"
688N/A+ XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $TSOL_LIB $CWRAP_LIB $OS_LIB $LIBS"
688N/A AC_SUBST([XNEST_LIBS])
688N/A fi
688N/A
688N/A@@ -1403,7 +1406,7 @@
688N/A
688N/A if test "x$XPRINT" = xyes; then
688N/A PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau])
688N/A- XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS"
688N/A+ XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $TSOL_LIB"
688N/A XPRINT_LIBS="$XPRINT_LIBS $DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS"
688N/A AC_SUBST([XPRINT_CFLAGS])
688N/A AC_SUBST([XPRINT_LIBS])
688N/A@@ -1562,7 +1565,7 @@
688N/A # dix os fb mi extension glx (NOTYET) damage shadow xpstubs
688N/A #KDRIVE_PURE_LIBS="$DIX_LIB $OS_LIB $FB_LIB $XEXT_LIB $MIEXT_DAMAGE_LIB \
688N/A # $MIEXT_SHADOW_LIB $XPSTUBS_LIB"
688N/A- KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $OS_LIB"
688N/A+ KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $TSOL_LIB $OS_LIB"
688N/A KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
688N/A case $host_os in
688N/A *linux*)
688N/A@@ -1869,3 +1873,6 @@ xorg-server.pc
688N/A
688N/A # Add Sun IA extension
688N/A AC_OUTPUT([IA/Makefile])
688N/A+
688N/A+# Add Sun Trusted Extensions extension
688N/A+AC_OUTPUT([tsol/Makefile])
688N/Adiff -urp -x '*~' -x '*.orig' dix/dispatch.c dix/dispatch.c
688N/A--- dix/dispatch.c 2007-09-20 14:21:56.671742000 -0700
688N/A+++ dix/dispatch.c 2007-09-20 14:22:20.877325000 -0700
688N/A@@ -74,8 +74,8 @@ Equipment Corporation.
688N/A
688N/A ******************************************************************/
688N/A
688N/A-/* XSERVER_DTRACE additions:
688N/A- * Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
688N/A+/*
688N/A+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
688N/A *
688N/A * Permission is hereby granted, free of charge, to any person obtaining a
688N/A * copy of this software and associated documentation files (the
688N/A@@ -188,6 +188,11 @@ static void KillAllClients(void);
688N/A
688N/A static void DeleteClientFromAnySelections(ClientPtr client);
688N/A
688N/A+#ifdef TSOL
688N/A+#include <X11/extensions/security.h>
688N/A+SecurityHookPtr pSecHook = NULL;
688N/A+#endif /* TSOL */
688N/A+
688N/A static int nextFreeClientID; /* always MIN free client ID */
688N/A
688N/A static int nClients; /* number of authorized clients */
688N/A@@ -3563,6 +3568,11 @@ CloseDownClient(register ClientPtr clien
688N/A UngrabServer(client);
688N/A }
688N/A BITCLEAR(grabWaiters, client->index);
688N/A+#ifdef TSOL
688N/A+ if (pSecHook)
688N/A+ (*pSecHook->DeleteClientFromAnySelections)(client);
688N/A+ else
688N/A+#endif
688N/A DeleteClientFromAnySelections(client);
688N/A ReleaseActiveGrabs(client);
688N/A DeleteClientFontStuff(client);
688N/A@@ -3716,6 +3726,11 @@ void InitClient(ClientPtr client, int i,
688N/A }
688N/A #endif
688N/A client->replyBytesRemaining = 0;
688N/A+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
688N/A+ client->trustLevel = XSecurityClientTrusted;
688N/A+ client->CheckAccess = NULL;
688N/A+ client->authId = 0;
688N/A+#endif
688N/A #ifdef XAPPGROUP
688N/A client->appgroup = NULL;
688N/A #endif
688N/A@@ -3761,6 +3776,8 @@ InitClientPrivates(ClientPtr client)
688N/A ppriv->ptr = (pointer)NULL;
688N/A }
688N/A
688N/A+#ifndef TSOL
688N/A+/* Temporarily removed to preserve compatibility with old Xtsol module */
688N/A /* Allow registrants to initialize the serverClient devPrivates */
688N/A if (!client->index && ClientStateCallback)
688N/A {
688N/A@@ -3771,6 +3788,7 @@ InitClientPrivates(ClientPtr client)
688N/A clientinfo.setup = (xConnSetup *) NULL;
688N/A CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
688N/A }
688N/A+#endif /* TSOL */
688N/A return 1;
688N/A }
688N/A
688N/Adiff -urp -x '*~' -x '*.orig' dix/events.c dix/events.c
688N/A--- dix/events.c 2007-09-20 14:21:56.673705000 -0700
688N/A+++ dix/events.c 2007-09-20 14:22:20.879320000 -0700
688N/A@@ -76,7 +76,7 @@ Equipment Corporation.
688N/A
688N/A /*****************************************************************
688N/A
688N/A-Copyright 2003-2005 Sun Microsystems, Inc.
688N/A+Copyright 2007 Sun Microsystems, Inc.
688N/A
688N/A All rights reserved.
688N/A
688N/A@@ -266,7 +266,12 @@ static void DoEnterLeaveEvents(
688N/A int mode
688N/A );
688N/A
688N/A-static WindowPtr XYToWindow(
688N/A+#ifdef TSOL
688N/A+_X_EXPORT
688N/A+#else
688N/A+static
688N/A+#endif
688N/A+WindowPtr XYToWindow(
688N/A int x,
688N/A int y
688N/A );
688N/A@@ -1947,7 +1952,12 @@ PointInBorderSize(WindowPtr pWin, int x,
688N/A return FALSE;
688N/A }
688N/A
688N/A-static WindowPtr
688N/A+#ifdef TSOL
688N/A+_X_EXPORT
688N/A+#else
688N/A+static
688N/A+#endif
688N/A+WindowPtr
688N/A XYToWindow(int x, int y)
1265N/A {
1265N/A register WindowPtr pWin;
1265N/Adiff -urp -x '*~' -x '*.orig' dix/property.c dix/property.c
688N/A--- dix/property.c 2006-10-24 17:25:19.000000000 -0700
688N/A+++ dix/property.c 2007-09-20 14:22:20.880023000 -0700
688N/A@@ -45,6 +45,34 @@ SOFTWARE.
688N/A
688N/A ******************************************************************/
688N/A
688N/A+/* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
688N/A+ *
688N/A+ * Permission is hereby granted, free of charge, to any person obtaining a
688N/A+ * copy of this software and associated documentation files (the
688N/A+ * "Software"), to deal in the Software without restriction, including
688N/A+ * without limitation the rights to use, copy, modify, merge, publish,
688N/A+ * distribute, and/or sell copies of the Software, and to permit persons
688N/A+ * to whom the Software is furnished to do so, provided that the above
688N/A+ * copyright notice(s) and this permission notice appear in all copies of
688N/A+ * the Software and that both the above copyright notice(s) and this
688N/A+ * permission notice appear in supporting documentation.
688N/A+ *
688N/A+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
688N/A+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
688N/A+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
688N/A+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
688N/A+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
688N/A+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
688N/A+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
688N/A+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
688N/A+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
688N/A+ *
688N/A+ * Except as contained in this notice, the name of a copyright holder
688N/A+ * shall not be used in advertising or otherwise to promote the sale, use
688N/A+ * or other dealings in this Software without prior written authorization
688N/A+ * of the copyright holder.
688N/A+ */
688N/A+
688N/A #ifdef HAVE_DIX_CONFIG_H
688N/A #include <dix-config.h>
688N/A #endif
688N/A@@ -62,6 +90,11 @@ SOFTWARE.
688N/A #include "xace.h"
688N/A #endif
688N/A
688N/A+#ifdef TSOL
688N/A+#include "extnsionst.h"
688N/A+extern SecurityHookPtr pSecHook;
688N/A+#endif /* TSOL */
688N/A+
688N/A /*****************************************************************
688N/A * Property Stuff
688N/A *
688N/A@@ -245,6 +278,12 @@ ProcChangeProperty(ClientPtr client)
688N/A }
688N/A #endif
688N/A
688N/A+#ifdef TSOL
688N/A+ if (pSecHook)
688N/A+ err = (*pSecHook->ChangeWindowProperty)(client, pWin, stuff->property,
1265N/A+ stuff->type, (int)format, (int)mode, len, (pointer)&stuff[1], TRUE);
1265N/A+ else
1265N/A+#endif /* TSOL */
688N/A err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format,
688N/A (int)mode, len, (pointer)&stuff[1], TRUE);
688N/A if (err != Success)
688N/A@@ -298,6 +337,9 @@ ChangeWindowProperty(WindowPtr pWin, Ato
688N/A pProp->size = len;
688N/A pProp->next = pWin->optional->userProps;
688N/A pWin->optional->userProps = pProp;
688N/A+#ifdef TSOL
688N/A+ pProp->secPrivate = (pointer)NULL;
688N/A+#endif /* TSOL */
688N/A }
688N/A else
688N/A {
688N/A@@ -400,6 +442,9 @@ DeleteProperty(WindowPtr pWin, Atom prop
688N/A event.u.property.time = currentTime.milliseconds;
688N/A DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
688N/A xfree(pProp->data);
688N/A+#ifdef TSOL
688N/A+ xfree(pProp->secPrivate);
688N/A+#endif /* TSOL */
688N/A xfree(pProp);
688N/A }
688N/A return(Success);
688N/A@@ -422,6 +467,9 @@ DeleteAllWindowProperties(WindowPtr pWin
688N/A DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
688N/A pNextProp = pProp->next;
688N/A xfree(pProp->data);
688N/A+#ifdef TSOL
688N/A+ xfree(pProp->secPrivate);
688N/A+#endif /* TSOL */
688N/A xfree(pProp);
688N/A pProp = pNextProp;
688N/A }
688N/A@@ -675,6 +723,11 @@ ProcDeleteProperty(register ClientPtr cl
688N/A }
688N/A #endif
688N/A
688N/A+#ifdef TSOL
688N/A+ if (pSecHook)
688N/A+ result = (*pSecHook->DeleteProperty)(client, pWin, stuff->property);
688N/A+ else
688N/A+#endif /* TSOL */
688N/A result = DeleteProperty(pWin, stuff->property);
688N/A if (client->noClientException != Success)
688N/A return(client->noClientException);
688N/Adiff -urp -x '*~' -x '*.orig' dix/window.c dix/window.c
688N/A--- dix/window.c 2007-03-17 17:29:16.000000000 -0700
688N/A+++ dix/window.c 2007-09-20 14:22:20.881976000 -0700
688N/A@@ -98,6 +98,33 @@ Equipment Corporation.
688N/A
688N/A ******************************************************************/
688N/A
688N/A+/* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
688N/A+ *
688N/A+ * Permission is hereby granted, free of charge, to any person obtaining a
688N/A+ * copy of this software and associated documentation files (the
688N/A+ * "Software"), to deal in the Software without restriction, including
688N/A+ * without limitation the rights to use, copy, modify, merge, publish,
688N/A+ * distribute, and/or sell copies of the Software, and to permit persons
688N/A+ * to whom the Software is furnished to do so, provided that the above
688N/A+ * copyright notice(s) and this permission notice appear in all copies of
688N/A+ * the Software and that both the above copyright notice(s) and this
688N/A+ * permission notice appear in supporting documentation.
688N/A+ *
688N/A+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
688N/A+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
688N/A+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
688N/A+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
688N/A+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
688N/A+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
688N/A+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
688N/A+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
688N/A+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
688N/A+ *
688N/A+ * Except as contained in this notice, the name of a copyright holder
688N/A+ * shall not be used in advertising or otherwise to promote the sale, use
688N/A+ * or other dealings in this Software without prior written authorization
688N/A+ * of the copyright holder.
688N/A+ */
688N/A
688N/A #ifdef HAVE_DIX_CONFIG_H
688N/A #include <dix-config.h>
688N/A@@ -181,6 +208,11 @@ static Bool TileScreenSaver(int i, int k
688N/A _X_EXPORT int numSaveUndersViewable = 0;
688N/A _X_EXPORT int deltaSaveUndersViewable = 0;
688N/A
688N/A+#ifdef TSOL
688N/A+#include "extnsionst.h"
688N/A+extern SecurityHookPtr pSecHook;
688N/A+#endif /* TSOL */
688N/A+
688N/A #ifdef DEBUG
688N/A /******
688N/A * PrintWindowTree
688N/A@@ -846,6 +878,11 @@ FreeWindowResources(register WindowPtr p
688N/A register ScreenPtr pScreen = pWin->drawable.pScreen;
688N/A
688N/A DeleteWindowFromAnySaveSet(pWin);
688N/A+#ifdef TSOL
688N/A+ if (pSecHook)
688N/A+ (*pSecHook->DeleteWindowFromAnySelections)(pWin);
688N/A+ else
688N/A+#endif
688N/A DeleteWindowFromAnySelections(pWin);
688N/A DeleteWindowFromAnyEvents(pWin, TRUE);
688N/A REGION_UNINIT(pScreen, &pWin->clipList);
688N/A@@ -1929,7 +1966,12 @@ IsSiblingAboveMe(
688N/A return(Below);
688N/A }
688N/A
688N/A-static BoxPtr
688N/A+#ifdef TSOL
688N/A+_X_EXPORT
688N/A+#else
688N/A+static
688N/A+#endif
688N/A+BoxPtr
688N/A WindowExtents(
688N/A register WindowPtr pWin,
688N/A register BoxPtr pBox)
688N/A@@ -1965,7 +2007,12 @@ MakeBoundingRegion (
688N/A return pRgn;
688N/A }
688N/A
688N/A-static Bool
688N/A+#ifdef TSOL
688N/A+_X_EXPORT
688N/A+#else
688N/A+static
688N/A+#endif
688N/A+Bool
688N/A ShapeOverlap (
688N/A WindowPtr pWin,
688N/A BoxPtr pWinBox,
688N/A@@ -2174,7 +2221,12 @@ WhereDoIGoInTheStack(
688N/A }
688N/A }
688N/A
688N/A-static void
688N/A+#ifdef TSOL
688N/A+_X_EXPORT
688N/A+#else
688N/A+static
688N/A+#endif
688N/A+void
688N/A ReflectStackChange(
688N/A register WindowPtr pWin,
688N/A register WindowPtr pSib,
688N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86AutoConfig.c hw/xfree86/common/xf86AutoConfig.c
688N/A--- hw/xfree86/common/xf86AutoConfig.c 2007-09-20 14:21:57.861184000 -0700
688N/A+++ hw/xfree86/common/xf86AutoConfig.c 2007-09-20 14:22:20.882348000 -0700
688N/A@@ -52,6 +52,7 @@
688N/A "\tLoad\t\"record\"\n" \
688N/A "\tLoad\t\"dri\"\n" \
688N/A "\tLoad\t\"IA\"\n" \
688N/A+ "\tLoad\t\"xtsol\"\n" \
688N/A "EndSection\n\n"
688N/A
688N/A #define BUILTIN_DEVICE_NAME \
688N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Config.c hw/xfree86/common/xf86Config.c
688N/A--- hw/xfree86/common/xf86Config.c 2007-09-20 14:21:57.862784000 -0700
688N/A+++ hw/xfree86/common/xf86Config.c 2007-09-20 14:22:20.883535000 -0700
688N/A@@ -298,6 +298,10 @@ xf86ModulelistFromConfig(pointer **optli
688N/A /* Sun addition - IA extension */
688N/A ptr = xf86addNewLoadDirective(ptr, "IA", XF86_LOAD_MODULE, NULL);
688N/A count++;
688N/A+
688N/A+ /* Sun addition - extension for Solaris Trusted Extensions */
688N/A+ ptr = xf86addNewLoadDirective(ptr, "xtsol", XF86_LOAD_MODULE, NULL);
688N/A+ count++;
688N/A }
688N/A
688N/A /*
688N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/dixmods/Makefile.am hw/xfree86/dixmods/Makefile.am
688N/A--- hw/xfree86/dixmods/Makefile.am 2007-09-20 14:21:57.863164000 -0700
688N/A+++ hw/xfree86/dixmods/Makefile.am 2007-09-20 14:22:20.883822000 -0700
688N/A@@ -109,3 +109,11 @@ extsmodule_LTLIBRARIES += libIA.la
688N/A libIA_la_LDFLAGS = -avoid-version
688N/A libIA_la_LIBADD = $(top_builddir)/IA/libIA.la
688N/A libIA_la_SOURCES = iamodule.c
688N/A+
688N/A+if BUILD_TSOL_MODULE
688N/A+# Sun Trusted Extensions extension module additions
688N/A+extsmodule_LTLIBRARIES += libxtsol.la
688N/A+libxtsol_la_LDFLAGS = -avoid-version
688N/A+libxtsol_la_LIBADD = $(top_builddir)/tsol/libxtsol.la
688N/A+libxtsol_la_SOURCES = tsolmodule.c
688N/A+endif
688N/Adiff -urp -x '*~' -x '*.orig' include/dixstruct.h include/dixstruct.h
688N/A--- include/dixstruct.h 2006-10-24 17:25:19.000000000 -0700
688N/A+++ include/dixstruct.h 2007-09-20 14:22:20.884203000 -0700
688N/A@@ -127,7 +127,20 @@ typedef struct _Client {
688N/A unsigned char requestLog[MAX_REQUEST_LOG];
688N/A int requestLogIndex;
688N/A #endif
688N/A+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
688N/A+ int (*pad1)(ClientPtr /*client*/);
688N/A+#endif
688N/A unsigned long replyBytesRemaining;
688N/A+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
688N/A+ XID authId;
688N/A+ unsigned int trustLevel;
688N/A+ pointer (* CheckAccess)(
688N/A+ ClientPtr /*pClient*/,
688N/A+ XID /*id*/,
688N/A+ RESTYPE /*classes*/,
688N/A+ Mask /*access_mode*/,
688N/A+ pointer /*resourceval*/);
688N/A+#endif
688N/A #ifdef XAPPGROUP
688N/A struct _AppGroupRec* appgroup;
688N/A #endif
688N/Adiff -urp -x '*~' -x '*.orig' include/extnsionst.h include/extnsionst.h
688N/A--- include/extnsionst.h 2006-10-24 17:25:19.000000000 -0700
688N/A+++ include/extnsionst.h 2007-09-20 14:22:20.884616000 -0700
688N/A@@ -45,6 +45,34 @@ SOFTWARE.
688N/A
688N/A ******************************************************************/
688N/A
688N/A+/* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
688N/A+ *
688N/A+ * Permission is hereby granted, free of charge, to any person obtaining a
688N/A+ * copy of this software and associated documentation files (the
688N/A+ * "Software"), to deal in the Software without restriction, including
688N/A+ * without limitation the rights to use, copy, modify, merge, publish,
688N/A+ * distribute, and/or sell copies of the Software, and to permit persons
688N/A+ * to whom the Software is furnished to do so, provided that the above
688N/A+ * copyright notice(s) and this permission notice appear in all copies of
688N/A+ * the Software and that both the above copyright notice(s) and this
688N/A+ * permission notice appear in supporting documentation.
688N/A+ *
688N/A+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
688N/A+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
688N/A+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
688N/A+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
688N/A+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
688N/A+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
688N/A+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
688N/A+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
688N/A+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
688N/A+ *
688N/A+ * Except as contained in this notice, the name of a copyright holder
688N/A+ * shall not be used in advertising or otherwise to promote the sale, use
688N/A+ * or other dealings in this Software without prior written authorization
688N/A+ * of the copyright holder.
688N/A+ */
688N/A+
688N/A #ifndef EXTENSIONSTRUCT_H
688N/A #define EXTENSIONSTRUCT_H
688N/A
688N/A@@ -54,6 +82,10 @@ SOFTWARE.
688N/A #include "extension.h"
688N/A #include "gc.h"
688N/A
688N/A+#ifdef TSOL
688N/A+#include "inputstr.h"
688N/A+#endif /* TSOL */
688N/A+
688N/A typedef struct _ExtensionEntry {
688N/A int index;
688N/A void (* CloseDown)( /* called at server shutdown */
@@ -69,6 +101,9 @@ typedef struct _ExtensionEntry {
pointer extPrivate;
unsigned short (* MinorOpcode)( /* called for errors */
ClientPtr /* client */);
+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
+ Bool secure; /* extension visible to untrusted clients? */
+#endif
DevUnion *devPrivates;
} ExtensionEntry;
@@ -146,5 +181,28 @@ extern void DeclareExtensionSecurity(
char * /*extname*/,
Bool /*secure*/);
+#ifdef TSOL
+typedef struct
+{
+ XID (*CheckAuthorization)(unsigned int, char *, unsigned int,
+ char *, ClientPtr , char **);
+ int (*InitWindow)(ClientPtr, WindowPtr);
+ int (*ChangeWindowProperty)(ClientPtr, WindowPtr, Atom, Atom, int, int,
+ unsigned long, pointer, Bool);
+ int (*DeleteProperty)(ClientPtr, WindowPtr, Atom);
+ char (*CheckPropertyAccess)(ClientPtr, WindowPtr, ATOM, Mask);
+ void (*ProcessKeyboard)(xEvent *, KeyClassPtr);
+ void (*DeleteClientFromAnySelections)(ClientPtr);
+ void (*DeleteWindowFromAnySelections)(WindowPtr);
+ void (*AuditStart)(ClientPtr);
+ void (*AuditEnd)(ClientPtr, int);
+} SecurityHook, *SecurityHookPtr;
+
+extern SecurityHookPtr pSecHook;
+
+extern void tsolCompatRegisterHooks(void);
+
+#endif /* TSOL */
+
#endif /* EXTENSIONSTRUCT_H */
diff -urp -x '*~' -x '*.orig' include/propertyst.h include/propertyst.h
--- include/propertyst.h 2006-09-17 23:04:18.000000000 -0700
+++ include/propertyst.h 2007-09-20 14:22:20.884994000 -0700
@@ -45,6 +45,35 @@ 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 PROPERTYSTRUCT_H
#define PROPERTYSTRUCT_H
#include "misc.h"
@@ -60,6 +89,13 @@ typedef struct _Property {
short format; /* format of data for swapping - 8,16,32 */
long size; /* size of data in (format/8) bytes */
pointer data; /* private to client */
+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
+ short pad1; /* previously used by LBX */
+ XID pad2;
+#endif
+#ifdef TSOL
+ pointer secPrivate; /* Security information */
+#endif /* TSOL */
} PropertyRec;
#endif /* PROPERTYSTRUCT_H */
diff -urp -x '*~' -x '*.orig' include/selection.h include/selection.h
--- include/selection.h 2006-09-17 23:04:18.000000000 -0700
+++ include/selection.h 2007-09-20 14:22:20.885346000 -0700
@@ -49,6 +49,34 @@ 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.
+ */
+
#include "dixstruct.h"
/*
*
@@ -61,6 +89,9 @@ typedef struct _Selection {
Window window;
WindowPtr pWin;
ClientPtr client;
+#ifdef TSOL
+ pointer secPrivate; /* Security Information */
+#endif /* TSOL */
} Selection;
#endif /* SELECTION_H */
diff -urp -x '*~' -x '*.orig' mi/miinitext.c mi/miinitext.c
--- mi/miinitext.c 2007-09-20 14:21:57.965252000 -0700
+++ mi/miinitext.c 2007-09-20 14:22:21.276990000 -0700
@@ -86,6 +86,10 @@ SOFTWARE.
#define SolarisIAExtension
+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
+#include "extnsionst.h"
+#endif
+
#if defined(QNX4) /* sleaze for Watcom on QNX4 ... */
#undef GLXEXT
#endif
@@ -221,6 +225,9 @@ extern Bool noXvExtension;
#ifdef SolarisIAExtension
Bool noIAExtension;
#endif
+#ifdef TSOL
+Bool noXTSolExtension;
+#endif
#ifndef XFree86LOADER
#define INITARGS void
@@ -266,6 +273,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 EVI
@@ -396,6 +407,9 @@ extern void CompositeExtensionInit(INITA
#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.
@@ -456,6 +470,9 @@ static ExtensionToggle ExtensionToggleLi
#ifdef XCSECURITY
{ "SECURITY", &noSecurityExtension },
#endif
+#ifdef TSOL
+ { TSOLNAME /* "SUN_TSOL" */, &noXTSolExtension },
+#endif
#ifdef XSYNC
{ "SYNC", &noSyncExtension },
#endif
@@ -681,6 +698,14 @@ InitExtensions(argc, argv)
#ifdef SolarisIAExtension
if (!noIAExtension) IAExtensionInit();
#endif
+#ifdef TSOL
+ if (!noXTSolExtension) {
+ TsolExtensionInit();
+ if (pSecHook) { /* If TSOL security hooks set, add to XACE callbacks */
+ tsolCompatRegisterHooks();
+ }
+ }
+#endif
}
void
@@ -792,6 +817,11 @@ InitExtensions(argc, argv)
(ext->initFunc)();
}
}
+#ifdef TSOL /* Maintaining binary compatibility with Xtsol module */
+ if (pSecHook) { /* If TSOL security hooks set, add to XACE callbacks */
+ tsolCompatRegisterHooks();
+ }
+#endif
}
static void (*__miHookInitVisualsFunction)(miInitVisualsProcPtr *);
diff -urp -x '*~' -x '*.orig' os/connection.c os/connection.c
--- os/connection.c 2007-09-20 14:21:56.995403000 -0700
+++ os/connection.c 2007-09-20 14:22:21.289634000 -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
*
@@ -309,6 +336,11 @@ 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)
{
@@ -711,6 +743,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 */
auth_id = CheckAuthorization (proto_n, auth_proto,
string_n, auth_string, client, &reason);