943N/A/* Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
499N/A *
499N/A * Permission is hereby granted, free of charge, to any person obtaining a
919N/A * copy of this software and associated documentation files (the "Software"),
919N/A * to deal in the Software without restriction, including without limitation
919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A * and/or sell copies of the Software, and to permit persons to whom the
919N/A * Software is furnished to do so, subject to the following conditions:
499N/A *
919N/A * The above copyright notice and this permission notice (including the next
919N/A * paragraph) shall be included in all copies or substantial portions of the
919N/A * Software.
499N/A *
919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A * DEALINGS IN THE SOFTWARE.
499N/A */
499N/A
499N/A
499N/A#ifndef _XTSOL_H_
499N/A#define _XTSOL_H_
499N/A
499N/A#include <sys/types.h>
499N/A#include <bsm/audit.h>
499N/A#include <X11/Xmd.h>
499N/A#include <tsol/label.h>
499N/A
499N/A#ifndef _XTSOL_SERVER
499N/A#include <X11/Xlib.h>
499N/A#endif /* _XTSOL_SERVER */
499N/A
499N/A#include <X11/Xfuncproto.h>
499N/A
499N/A_XFUNCPROTOBEGIN
499N/A
499N/Atypedef enum { IsWindow, IsPixmap, IsColormap } ResourceType;
499N/A
499N/A/*
499N/A * Name of the Trusted Solaris extension
499N/A */
499N/A#define TSOLNAME "SUN_TSOL"
499N/A
499N/A/*
499N/A * Resource value masks
499N/A * The following resource masks are obsolete:
499N/A * RES_IL 2 # information label
499N/A * RES_IIL 4 # input info label
499N/A */
499N/A
499N/A#define RES_SL 1 /* sensitivity label */
499N/A#define RES_UID 8 /* user id */
499N/A#define RES_OUID 16 /* owner uid */
499N/A#define RES_STRIPE 32 /* screen stripe */
499N/A#define RES_LABEL (RES_SL)
499N/A#define RES_ALL (RES_SL|RES_UID|RES_OUID)
499N/A
499N/A
499N/Atypedef struct _XTsolResAttributes {
499N/A CARD32 ouid; /* owner uid */
499N/A CARD32 uid;
499N/A m_label_t *sl; /* sensitivity label */
499N/A} XTsolResAttributes;
499N/A
499N/Atypedef struct _XTsolPropAttributes {
499N/A CARD32 uid;
499N/A m_label_t *sl; /* sensitivity label */
499N/A} XTsolPropAttributes;
499N/A
499N/A/*
499N/A * Client Attributes
499N/A */
499N/Atypedef struct _XTsolClientAttributes {
499N/A int trustflag; /* true, if client masked as trusted */
499N/A uid_t uid; /* owner uid */
499N/A gid_t gid; /* group id */
499N/A pid_t pid; /* process id */
499N/A u_long sessionid; /* session id */
499N/A au_id_t auditid; /* audit id */
499N/A u_long iaddr; /* internet addr */
499N/A} XTsolClientAttributes;
499N/A
499N/A/*
499N/A * Trusted X Server Interfaces
499N/A * Status value 0 means failure, else success
499N/A * Status is defined in Xlib.h for user includes.
499N/A */
499N/A
499N/A#ifndef Status
499N/A#define Status int
499N/A#endif
499N/A
499N/A#ifndef _XTSOL_SERVER
499N/A
499N/Aextern Bool XTSOLIsWindowTrusted(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetPolyInstInfo(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A m_label_t *sl,
499N/A uid_t *uidp,
499N/A int enabled
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetPropLabel(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win,
499N/A Atom property,
499N/A m_label_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetPropUID(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win,
499N/A Atom property,
499N/A uid_t *uidp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetResLabel(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID object,
499N/A ResourceType resourceFlag,
499N/A m_label_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetResUID(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID object,
499N/A ResourceType resourceFlag,
499N/A uid_t *uidp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetSSHeight(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A int screen_num,
499N/A int newHeight
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetSSHeight(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A int screen_num,
499N/A int *newHeight
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetSessionHI(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A bclear_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetSessionLO(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A m_label_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLsetWorkstationOwner(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A uid_t *uidp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetClientAttributes(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID xid,
499N/A XTsolClientAttributes *clientattr
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetClientLabel(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID xid,
499N/A m_label_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetPropAttributes(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window window,
499N/A Atom property,
499N/A XTsolPropAttributes *propattrp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetPropLabel(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win,
499N/A Atom property,
499N/A m_label_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetPropUID(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win,
499N/A Atom property,
499N/A uid_t *uidp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetResAttributes(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID object,
499N/A ResourceType resourceFlag,
499N/A XTsolResAttributes *resattrp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetResLabel(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID object,
499N/A ResourceType resourceFlag,
499N/A m_label_t *sl
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetResUID(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A XID object,
499N/A ResourceType resourceFlag,
499N/A uid_t *uidp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLgetWorkstationOwner(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A uid_t *uidp
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLMakeTPWindow(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLMakeTrustedWindow(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win
499N/A#endif
499N/A);
499N/A
499N/Aextern Status XTSOLMakeUntrustedWindow(
499N/A#if NeedFunctionPrototypes
499N/A Display *dpy,
499N/A Window win
499N/A#endif
499N/A);
499N/A
499N/A#endif /* _XTSOL_SERVER */
499N/A
499N/A_XFUNCPROTOEND
499N/A
499N/A#endif /* _XTSOL_H_ */