xtsol.patch revision 606
481N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
481N/A# Use subject to license terms.
481N/A#
481N/A# Permission is hereby granted, free of charge, to any person obtaining a
481N/A# copy of this software and associated documentation files (the
481N/A# "Software"), to deal in the Software without restriction, including
481N/A# without limitation the rights to use, copy, modify, merge, publish,
481N/A# distribute, and/or sell copies of the Software, and to permit persons
481N/A# to whom the Software is furnished to do so, provided that the above
481N/A# copyright notice(s) and this permission notice appear in all copies of
481N/A# the Software and that both the above copyright notice(s) and this
481N/A# permission notice appear in supporting documentation.
481N/A#
481N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
481N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
481N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
481N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
481N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
481N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
481N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1267N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
481N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
481N/A#
481N/A# Except as contained in this notice, the name of a copyright holder
928N/A# shall not be used in advertising or otherwise to promote the sale, use
931N/A# or other dealings in this Software without prior written authorization
931N/A# of the copyright holder.
481N/A
481N/Adiff -urp -x '*~' -x '*.orig' configure.ac configure.ac
481N/A--- configure.ac 2008-10-17 15:44:58.744720000 -0700
481N/A+++ configure.ac 2008-10-17 15:45:15.246237000 -0700
481N/A@@ -215,6 +215,14 @@ dnl Find the math libary
481N/A AC_CHECK_LIB(m, sqrt)
481N/A AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function]))
481N/A
481N/A+dnl Check for libtsol for Solaris Trusted Extensions module
481N/A+AC_CHECK_LIB(tsol, bsllow, [BUILD_TSOL_MODULE=yes], [BUILD_TSOL_MODULE=no])
481N/A+AM_CONDITIONAL(BUILD_TSOL_MODULE, [test x$BUILD_TSOL_MODULE = xyes])
481N/A+if test "x$BUILD_TSOL_MODULE" = xyes; then
481N/A+ TSOL_LIB='$(top_builddir)/tsol/libxtsol.la'
481N/A+ TSOL_SYS_LIBS='-ltsol -ltsnet -lsecdb -lbsm'
481N/A+fi
481N/A+
481N/A AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
481N/A
481N/A dnl AGPGART headers
481N/A@@ -1227,8 +1235,8 @@ AC_MSG_RESULT([$XVFB])
481N/A AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
481N/A
481N/A if test "x$XVFB" = xyes; then
481N/A- XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_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"
481N/A- XVFB_SYS_LIBS="$XVFBMODULES_LIBS"
481N/A+ XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_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"
481N/A+ XVFB_SYS_LIBS="$XVFBMODULES_LIBS $TSOL_SYS_LIBS"
481N/A AC_SUBST([XVFB_LIBS])
481N/A AC_SUBST([XVFB_SYS_LIBS])
481N/A fi
481N/A@@ -1245,8 +1253,8 @@ AC_MSG_RESULT([$XNEST])
481N/A AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
481N/A
931N/A if test "x$XNEST" = xyes; then
931N/A- XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_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 $DIX_LIB $OS_LIB $CONFIG_LIB $IA_LIB"
931N/A- XNEST_SYS_LIBS="$XNESTMODULES_LIBS"
481N/A+ XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_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 $DIX_LIB $OS_LIB $CONFIG_LIB $IA_LIB $TSOL_LIB"
928N/A+ XNEST_SYS_LIBS="$XNESTMODULES_LIBS $TSOL_SYS_LIBS"
931N/A AC_SUBST([XNEST_LIBS])
931N/A AC_SUBST([XNEST_SYS_LIBS])
481N/A fi
928N/A@@ -1609,8 +1617,8 @@ AC_MSG_RESULT([$XPRINT])
481N/A if test "x$XPRINT" = xyes; then
481N/A PKG_CHECK_MODULES([XPRINTMODULES], [printproto x11 xfont $XDMCP_MODULES xau])
931N/A XPRINT_CFLAGS="$XPRINTMODULES_CFLAGS -DXPRINT"
931N/A- XPRINT_LIBS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $XKB_LIB $XKB_STUB_LIB"
931N/A- XPRINT_SYS_LIBS="$XPRINTMODULES_LIBS"
931N/A+ XPRINT_LIBS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $XKB_LIB $XKB_STUB_LIB $TSOL_LIB"
931N/A+ XPRINT_SYS_LIBS="$XPRINTMODULES_LIBS $TSOL_SYS_LIBS"
931N/A
931N/A xpconfigdir=$libdir/X11/xserver
931N/A AC_SUBST([xpconfigdir])
931N/A@@ -1965,7 +1973,7 @@ if test "$KDRIVE" = yes; then
1267N/A
1267N/A KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
931N/A
931N/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"
931N/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"
928N/A KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
case $host_os in
*linux*)
@@ -2272,3 +2280,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 2008-10-10 11:12:48.000000000 -0700
+++ dix/dispatch.c 2008-10-17 15:45:15.263147000 -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
@@ -177,6 +177,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 */
@@ -789,7 +793,12 @@ ProcCirculateWindow(ClientPtr client)
return(client->noClientException);
}
-static int
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+int
GetGeometry(ClientPtr client, xGetGeometryReply *rep)
{
DrawablePtr pDraw;
@@ -1927,7 +1936,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)
@@ -3400,6 +3414,11 @@ CloseDownClient(ClientPtr client)
UngrabServer(client);
}
BITCLEAR(grabWaiters, client->index);
+#ifdef TSOL
+ if (pSecHook)
+ (*pSecHook->DeleteClientFromAnySelections)(client);
+ else
+#endif
DeleteClientFromAnySelections(client);
ReleaseActiveGrabs(client);
DeleteClientFontStuff(client);
diff -urp -x '*~' -x '*.orig' dix/events.c dix/events.c
--- dix/events.c 2008-10-10 11:12:48.000000000 -0700
+++ dix/events.c 2008-10-17 15:45:15.265785000 -0700
@@ -76,7 +76,7 @@ Equipment Corporation.
/*****************************************************************
-Copyright 2003-2005 Sun Microsystems, Inc.
+Copyright 2007 Sun Microsystems, Inc.
All rights reserved.
@@ -299,7 +299,12 @@ static void DoEnterLeaveEvents(
int mode
);
-static WindowPtr XYToWindow(
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+WindowPtr XYToWindow(
int x,
int y
);
@@ -2142,7 +2147,12 @@ PointInBorderSize(WindowPtr pWin, int x,
*
* @returns the window at the given coordinates.
*/
-static WindowPtr
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+WindowPtr
XYToWindow(int x, int y)
{
WindowPtr pWin;
diff -urp -x '*~' -x '*.orig' dix/property.c dix/property.c
--- dix/property.c 2008-10-10 11:12:48.000000000 -0700
+++ dix/property.c 2008-10-17 15:45:15.358024000 -0700
@@ -45,6 +45,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.
+ */
+
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -60,6 +88,11 @@ SOFTWARE.
#include "swaprep.h"
#include "xace.h"
+#ifdef TSOL
+#include "extnsionst.h"
+extern SecurityHookPtr pSecHook;
+#endif /* TSOL */
+
/*****************************************************************
* Property Stuff
*
@@ -239,6 +272,12 @@ ProcChangeProperty(ClientPtr client)
return(BadAtom);
}
+#ifdef TSOL
+ if (pSecHook)
+ err = (*pSecHook->ChangeWindowProperty)(client, pWin, stuff->property,
+ stuff->type, (int)format, (int)mode, len, (pointer)&stuff[1], TRUE);
+ else
+#endif /* TSOL */
err = dixChangeWindowProperty(client, pWin, stuff->property, stuff->type,
(int)format, (int)mode, len, &stuff[1],
TRUE);
@@ -629,6 +668,11 @@ ProcDeleteProperty(ClientPtr client)
return (BadAtom);
}
+#ifdef TSOL
+ if (pSecHook)
+ result = (*pSecHook->DeleteProperty)(client, pWin, stuff->property);
+ else
+#endif /* TSOL */
result = DeleteProperty(client, pWin, stuff->property);
if (client->noClientException != Success)
return(client->noClientException);
diff -urp -x '*~' -x '*.orig' dix/window.c dix/window.c
--- dix/window.c 2008-10-10 11:12:48.000000000 -0700
+++ dix/window.c 2008-10-17 15:45:15.360112000 -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>
@@ -172,6 +199,11 @@ static Bool TileScreenSaver(int i, int k
_X_EXPORT int numSaveUndersViewable = 0;
_X_EXPORT int deltaSaveUndersViewable = 0;
+#ifdef TSOL
+#include "extnsionst.h"
+extern SecurityHookPtr pSecHook;
+#endif /* TSOL */
+
#ifdef DEBUG
/******
* PrintWindowTree
@@ -820,6 +852,11 @@ FreeWindowResources(WindowPtr pWin)
ScreenPtr pScreen = pWin->drawable.pScreen;
DeleteWindowFromAnySaveSet(pWin);
+#ifdef TSOL
+ if (pSecHook)
+ (*pSecHook->DeleteWindowFromAnySelections)(pWin);
+ else
+#endif
DeleteWindowFromAnySelections(pWin);
DeleteWindowFromAnyEvents(pWin, TRUE);
REGION_UNINIT(pScreen, &pWin->clipList);
@@ -1915,7 +1952,12 @@ IsSiblingAboveMe(
return(Below);
}
-static BoxPtr
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+BoxPtr
WindowExtents(
WindowPtr pWin,
BoxPtr pBox)
@@ -1952,7 +1994,12 @@ MakeBoundingRegion (
return pRgn;
}
-static Bool
+#ifdef TSOL
+_X_EXPORT
+#else
+static
+#endif
+Bool
ShapeOverlap (
WindowPtr pWin,
BoxPtr pWinBox,
@@ -2161,7 +2208,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 2008-10-17 15:44:58.745221000 -0700
+++ hw/dmx/Makefile.am 2008-10-17 15:45:15.360748000 -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 2008-10-17 15:44:58.746569000 -0700
+++ hw/xfree86/common/xf86Config.c 2008-10-17 15:45:15.381539000 -0700
@@ -127,6 +127,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 2008-10-17 15:44:58.747030000 -0700
+++ hw/xfree86/dixmods/Makefile.am 2008-10-17 15:45:15.382121000 -0700
@@ -119,3 +119,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/extnsionst.h include/extnsionst.h
--- include/extnsionst.h 2008-10-02 14:01:26.000000000 -0700
+++ include/extnsionst.h 2008-10-17 15:45:15.383877000 -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' Makefile.am Makefile.am
--- Makefile.am 2008-10-17 15:44:58.741284000 -0700
+++ Makefile.am 2008-10-17 15:45:15.039639000 -0700
@@ -34,6 +34,10 @@ if RECORD
RECORD_DIR=record
endif
+if BUILD_TSOL_MODULE
+TSOL_DIR=tsol
+endif
+
SUBDIRS = \
doc \
include \
@@ -59,6 +63,7 @@ SUBDIRS = \
$(COMPOSITE_DIR) \
$(GLX_DIR) \
IA \
+ $(TSOL_DIR) \
exa \
config \
hw
diff -urp -x '*~' -x '*.orig' mi/miinitext.c mi/miinitext.c
--- mi/miinitext.c 2008-10-17 15:44:58.747720000 -0700
+++ mi/miinitext.c 2008-10-17 15:45:15.384710000 -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
@@ -227,6 +231,9 @@ extern Bool noXvExtension;
#ifdef SolarisIAExtension
Bool noIAExtension;
#endif
+#ifdef TSOL
+Bool noXTSolExtension;
+#endif
#ifndef XFree86LOADER
#define INITARGS void
@@ -272,6 +279,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
@@ -398,6 +409,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.
@@ -458,6 +472,9 @@ static ExtensionToggle ExtensionToggleLi
#ifdef XCSECURITY
{ "SECURITY", &noSecurityExtension },
#endif
+#ifdef TSOL
+ { TSOLNAME /* "SUN_TSOL" */, &noXTSolExtension },
+#endif
#ifdef XSYNC
{ "SYNC", &noSyncExtension },
#endif
@@ -682,6 +699,11 @@ InitExtensions(argc, argv)
#ifdef SolarisIAExtension
if (!noIAExtension) IAExtensionInit();
#endif
+#ifdef TSOL
+ if (!noXTSolExtension) {
+ TsolExtensionInit();
+ }
+#endif
}
void
diff -urp -x '*~' -x '*.orig' os/connection.c os/connection.c
--- os/connection.c 2008-10-17 15:44:58.728705000 -0700
+++ os/connection.c 2008-10-17 15:45:15.387013000 -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
*
@@ -298,6 +325,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)
{
@@ -721,6 +753,12 @@ ClientAuthorized(ClientPtr client,
!strncmp(saddr->sa_data, "/tmp/launch", 11)) goto done;
#endif
+#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);
diff -urp -x '*~' -x '*.orig' Xext/security.c Xext/security.c
--- Xext/security.c 2008-10-17 15:44:58.336824000 -0700
+++ Xext/security.c 2008-10-17 15:45:15.081938000 -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 2008-10-17 15:45:15.082414000 -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 */