tsolpolicy.c revision 606
#pragma ident "@(#)tsolpolicy.c 1.23 09/01/14 SMI"
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#define NEED_REPLIES
#define NEED_EVENTS
#include <stdio.h>
#include <unistd.h>
#include "auditwrite.h"
#include "dix.h"
#include "misc.h"
#include "scrnintstr.h"
#include "os.h"
#include "regionstr.h"
#include "validate.h"
#include "windowstr.h"
#include "propertyst.h"
#include "input.h"
#include "inputstr.h"
#include "resource.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "dixstruct.h"
#include "selection.h"
#include "gcstruct.h"
#include "servermd.h"
#include <syslog.h>
#include "extnsionst.h"
#include "registry.h"
#ifdef PANORAMIX
#include "../Xext/panoramiXsrv.h"
#include "tsol.h"
#include "tsolinfo.h"
#include "tsolpolicy.h"
extern int tsolMultiLevel;
#ifdef DEBUG
int status = 0;
int audit_status = 0;
audit_status = 0;
if (!logopened)
#ifdef DEBUG
if (do_audit)
return (status);
return (PASSED);
return PASSED;
if (do_audit)
return (ret_stat);
return PASSED;
if (do_audit)
return (ret_stat);
return (PASSED);
return (err_code);
if (do_audit)
return (ret_stat);
return (err_code);
if (do_audit)
return (ret_stat);
int obj_code = 0;
return (err_code);
if (do_audit)
return (ret_stat);
int obj_code = 0;
#if defined(PANORAMIX)
#if defined(PANORAMIX)
if (!noPanoramiXExtension)
if (panres)
return (PASSED);
#if defined(PANORAMIX)
if (!noPanoramiXExtension)
if (panres)
return (PASSED);
return (err_code);
if (do_audit)
return (ret_stat);
if (do_audit)
return (ret_stat);
if (do_audit)
return (ret_stat);
if (do_audit)
return (ret_stat);
return (BadValue);
return (PASSED);
return (BadValue);
if (do_audit)
return (ret_stat);
if (priv_win_config)
return (PASSED);
if (do_audit)
return (ret_stat);
return (BadValue);
return (BadValue);
if (do_audit)
return (ret_stat);
#if TBD
priv =
if (do_audit)
return (ret_stat);
return (PASSED);
if (priv_win_colormap)
return (PASSED);
if (priv_win_colormap)
return (PASSED);
#ifdef TBD
if (priv_win_colormap)
return (PASSED);
return (PASSED);
return (PASSED);
return (PASSED);
return (PASSED);
return (PASSED);
if (priv_win_colormap)
return (PASSED);
return (ret_stat);
int object_code = 0;
switch (res_type) {
case RT_PIXMAP:
case RT_FONT:
case RT_GC:
case RT_CURSOR:
case RT_COLORMAP:
if (!tsolinfo)
return (err_code);
if (do_audit)
return (ret_stat);
if (priv_win_fontpath)
return (PASSED);
if (do_audit)
return (ret_stat);
if (priv_win_devices)
return (PASSED);
if (do_audit)
return (ret_stat);
if (priv_win_devices)
return (PASSED);
if (do_audit)
return (ret_stat);
if (priv_win_config)
return (PASSED);
if (do_audit)
return (ret_stat);
return PASSED;
int i, status;
#ifdef DEBUG
if (do_audit)
return (ret_stat);
return(BadAlloc);
if (do_audit)
return (ret_stat);
return(BadAlloc);
if (do_audit)
return (ret_stat);
return(BadAlloc);
if (do_audit)
return (ret_stat);
return (PASSED);
if (do_audit)
return (ret_stat);
return (PASSED);
if (do_audit)
return (ret_stat);
if (priv_win_config)
return (PASSED);
if (priv_win_config)
return (PASSED);
if (do_audit)
return (ret_stat);
return (NULL);
return slstring;
if (do_audit)
return (ret_stat);
return (PASSED);
if (do_audit)
return (ret_stat);
if (grab)
return (err_code);
if (do_audit)
return (ret_stat);
return (PASSED);
if (do_audit)
return (ret_stat);
#ifdef DEBUG
method);
if (isstring)
return (PASSED);
if (do_audit)
return (ret_stat);
* requires win_upgrade/downgrade_sl privs
if (priv_win_config)
return (ret_stat);
#ifdef DEBUG
if (do_audit)
return (ret_stat);
#ifdef DEBUG
#ifdef DEBUG
if (do_audit)
return (ret_stat);
return (PASSED);
if (do_audit)
return (ret_stat);
return (err_code);
return (PASSED);
return (err_code);
return (PASSED);
#ifdef DEBUG
if (do_audit)
return (ret_stat);
#ifdef DEBUG
if (do_audit)
return (ret_stat);
return (PASSED);
return BadAccess;
return PASSED;
return BadAccess;
#ifdef DEBUG
return (PASSED);
typedef int (*XTSOL_policy_func)
static const XTSOL_policy_func
struct xpolicy_cache {
void *resource;
void *subject;
int ret_value;
int count;
int res_type;
int ret_value;
return ret_value;
static priv_set_t *
return pset;
init_win_privsets(void)
free_win_privsets(void)