tsolextension.c revision 228
98N/A#pragma ident "@(#)tsolextension.c 1.21 07/04/03 SMI"
98N/A#include "auditwrite.h"
98N/A#define NEED_REPLIES
98N/A#ifdef HAVE_DIX_CONFIG_H
98N/A#include <dix-config.h>
159N/A#include "inputstr.h"
98N/A#include "extnsionst.h"
98N/A#ifdef XCSECURITY
98N/A#define _SECURITY_SERVER
98N/A#include "security.h"
98N/A#include "tsolpolicy.h"
98N/A#define BadCmapCookie 0
98N/Aextern void (*ReplySwapVector[]) ();
98N/Aextern void init_xtsol();
98N/Aextern void init_win_privsets();
98N/Aextern void free_win_privsets();
98N/Astatic unsigned char TsolReqCode = 0;
extern unsigned int StripeHeight;
extern int tsolClientPrivateIndex;
extern int tsolWindowPrivateIndex;
extern int tsolPixmapPrivateIndex;
int OwnerUIDint;
extern void LoadTsolConfig();
extern void MakeTSOLAtoms();
extern void UpdateTsolNode();
extern int (*ProcVector[])();
extern int (*SwappedProcVector[])();
if (!is_system_labeled()) {
init_xtsol();
sizeof (TsolInfoRec))) {
sizeof (TsolResRec))) {
sizeof (TsolResRec))) {
for (i = 0; i < PROCVECTORSIZE; i++) {
static pointer
switch (rtype) {
case RT_GC:
switch (access_mode) {
case SecurityReadAccess:
case SecurityWriteAccess:
case SecurityDestroyAccess:
case RT_PIXMAP:
switch (reqtype) {
case X_PolyPoint:
case X_PolyLine:
case X_PolyArc:
case X_FillPoly:
case X_PolyFillRectangle:
case X_PolyFillArc:
case X_PutImage:
case X_PolyText8:
case X_PolyText16:
case X_ImageText8:
case X_ImageText16:
switch (access_mode) {
case SecurityReadAccess:
case SecurityWriteAccess:
case X_ChangeProperty:
case X_DeleteProperty:
case X_GetProperty:
case X_ListProperties:
case X_RotateProperties:
switch (access_mode) {
case SecurityReadAccess:
case SecurityWriteAccess:
return retval;
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 (err_code);
int err_code;
if (!pWin)
return (BadWindow);
return (err_code);
return (BadAtom);
while (pProp)
if (!pProp)
return (BadAtom);
return(BadAlloc);
return (err_code);
int err_code;
if (!pWin)
return (BadWindow);
return (err_code);
return (BadAtom);
while (pProp)
if (!pProp)
return (BadAtom);
return (err_code);
return(BadAlloc);
int err_code;
return (err_code);
return (err_code);
case IsWindow:
if (pWin)
tsolres =
return (BadWindow);
return (err_code);
case IsPixmap:
if (pMap)
tsolres =
return (BadPixmap);
return (err_code);
return (err_code);
int ScreenNumber;
int err_code;
case STRIPEHEIGHT:
return (err_code);
case RES_OUID:
return (err_code);
case IsWindow:
if (pWin)
tsolres =
return (BadWindow);
return (err_code);
case IsPixmap:
if (pMap)
tsolres =
return (BadPixmap);
return (err_code);
return (BadValue);
return (err_code);
int err_code;
return (BadWindow);
return (BadWindow);
return (err_code);
int reply_length;
int err_code;
return (BadWindow);
return (BadWindow);
return (err_code);
return (BadAlloc);
int reply_length;
int extralen;
int err_code;
if (pWin)
return (BadWindow);
return (err_code);
return (BadAtom);
while (pProp)
if (!pProp)
return (BadAtom);
while (tmp_prop)
if (!tsolprop)
return (BadAlloc);
int reply_length;
int extralen;
int err_code;
if (pWin)
return (BadWindow);
return (err_code);
if (pMap)
return (BadPixmap);
return (err_code);
return (BadAlloc);
int err_code;
return (BadWindow);
return (err_code);
int err_code;
return (BadWindow);
return (err_code);
int err_code;
return (BadWindow);
return (err_code);
if (kbdgrab) {
if (ptrgrab) {
if (tsolMultiLevel) {
int errcode;
if (errcode) {
char *inmsg;
int len;
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
char audit_ret;
int client_gidlen;
char *fullname;
extern int getdomainname(char *, int);
audit_val = 0;
if (system_audit_on &&
int status;
case AF_INET:
case AF_INET6:
if (!status)
return (auth_token);
extern void HandleHotKey();
HandleHotKey();
char action;
while (pProp)
return SecurityAllowOperation;
return SecurityIgnoreOperation;
return SecurityAllowOperation;
return SecurityIgnoreOperation;
return SecurityAllowOperation;
return SecurityIgnoreOperation;
return SecurityAllowOperation;
return SecurityAllowOperation;
char *rhost;
return FALSE;
return TRUE;
return FALSE;