tsolextension.c revision 851
40N/A#pragma ident "@(#)tsolextension.c 1.42 09/12/05 SMI"
40N/A#include "auditwrite.h"
493N/A#define NEED_REPLIES
40N/A#ifdef HAVE_DIX_CONFIG_H
493N/A#include <dix-config.h>
40N/A#include "inputstr.h"
70N/A#include "extnsionst.h"
70N/A#include "dixstruct.h"
#ifdef PANORAMIX
#include "../Xext/panoramiXsrv.h"
#ifdef XCSECURITY
#include "../Xext/securitysrv.h"
#include "tsolpolicy.h"
#define BadCmapCookie 0
static unsigned char TsolReqCode = 0;
int tsol_mac_enabled;
static int OwnerUIDint;
_X_EXPORT void
TsolExtensionInit(void)
if (is_system_labeled()) {
init_xtsol();
if (serverClient) {
for (i = 0; i < PROCVECTORSIZE; i++) {
static CALLBACK(
switch (rtype) {
case RT_WINDOW:
case RT_PIXMAP:
case RT_GC:
case RT_CURSOR:
case RT_FONT:
case SelectionClientClose:
case SelectionWindowDestroy:
case ClientStateInitial:
case ClientStateRunning:
case ClientStateGone:
int retval;
case X_SetPolyInstInfo:
case X_SetPropLabel:
case X_SetPropUID:
case X_SetResLabel:
case X_SetResUID:
case X_GetClientAttributes:
case X_GetClientLabel:
case X_GetPropAttributes:
case X_GetResAttributes:
case X_MakeTPWindow:
case X_MakeTrustedWindow:
case X_MakeUntrustedWindow:
return (retval);
int retval;
case X_SetPolyInstInfo:
case X_SetPropLabel:
case X_SetPropUID:
case X_SetResLabel:
case X_SetResUID:
case X_GetClientAttributes:
case X_GetClientLabel:
case X_GetPropAttributes:
case X_GetResAttributes:
case X_MakeTPWindow:
case X_MakeTrustedWindow:
case X_MakeUntrustedWindow:
return (retval);
int err_code;
return (BadAccess);
int err_code;
int rc;
return rc;
if (!pWin)
return (BadWindow);
return (BadAtom);
while (pProp)
if (!pProp)
return (BadAtom);
return (BadAccess);
int err_code;
int rc;
return rc;
if (!pWin)
return (BadWindow);
return (BadAtom);
while (pProp)
if (!pProp)
return (BadAtom);
return (BadAccess);
int err_code;
int rc;
return (BadAccess);
case IsWindow:
return rc;
if (pWin)
return (BadWindow);
case IsPixmap:
return rc;
if (pMap)
return (BadPixmap);
return (BadValue);
return rc;
int ScreenNumber;
int err_code;
int rc;
case STRIPEHEIGHT:
return (BadAccess);
case RES_OUID:
return (BadAccess);
case IsWindow:
return rc;
if (pWin)
return (BadWindow);
case IsPixmap:
return rc;
if (pMap)
return (BadPixmap);
return (BadValue);
return (BadAccess);
int err_code;
int rc;
return rc;
return (BadWindow);
int reply_length = 0;
int rc;
int err_code;
return rc;
return (BadWindow);
return (BadAlloc);
int reply_length = 0;
int rc;
return rc;
return (BadAtom);
while (pProp)
if (!pProp)
return (BadAlloc);
int reply_length = 0;
int rc;
return rc;
return rc;
return (BadAlloc);
int rc;
int err_code;
#if defined(PANORAMIX)
if (!noPanoramiXExtension)
== NULL)
return BadWindow;
return rc;
return (BadWindow);
return rc;
return (BadWindow);
int rc;
int err_code;
return rc;
return (BadWindow);
return (BadAccess);
int rc;
int err_code;
return rc;
return (BadWindow);
return (BadAccess);
if (kbdgrab) {
if (ptrgrab) {
if (tsolMultiLevel) {
int errcode;
if (errcode) {
char *temp_inmsg;
struct svc_req r;
memset((char *)&r, 0, sizeof(r));
goto bad1;
goto bad2;
goto bad2;
#ifdef SVR4
goto bad2;
bad2:
bad1:
static Bool
extern int getdomainname(char *, int);
static XID
char audit_ret;
int client_gidlen;
char *fullname;
audit_val = 0;
if (system_audit_on &&
int status;
case AF_INET:
case AF_INET6:
if (!status)
return (auth_token);
static CALLBACK(
static CALLBACK(
#ifndef NO_TSOL_DEBUG_MESSAGES
static CALLBACK(
static CALLBACK(
int reqtype;
switch (reqtype) {
case X_SetSelectionOwner:
if (polySelection) {
if (pSel) {
case X_GetSelectionOwner:
case X_ConvertSelection:
if (polySelection) {
if (pSel) {
#ifndef NO_TSOL_DEBUG_MESSAGES
static CALLBACK(
int reqtype;
int tsol_method;
if (!polyprop) {
while (pProp) {
if (pProp) {
#ifndef NO_TSOL_DEBUG_MESSAGES
static CALLBACK(
#ifdef UNUSED
char *rhost;
return FALSE;
return TRUE;
return FALSE;