From 0d492b2166c4026b9078ffd86d89a31ebe590be4 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 12 Feb 2008 19:59:10 -0500 Subject: XACE: Move the selection access hook to its own function. --- Xext/xace.c | 18 +++++++----------- Xext/xace.h | 4 ++++ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'Xext') diff --git a/Xext/xace.c b/Xext/xace.c index b2c7e4ab4..e88debc5f 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -63,6 +63,13 @@ int XaceHookPropertyAccess(ClientPtr client, WindowPtr pWin, return rec.status; } +int XaceHookSelectionAccess(ClientPtr client, Atom name, Mask access_mode) +{ + XaceSelectionAccessRec rec = { client, name, access_mode, Success }; + CallCallbacks(&XaceHooks[XACE_SELECTION_ACCESS], &rec); + return rec.status; +} + void XaceHookAuditEnd(ClientPtr ptr, int result) { XaceAuditRec rec = { ptr, result }; @@ -169,17 +176,6 @@ int XaceHook(int hook, ...) prv = &rec.status; break; } - case XACE_SELECTION_ACCESS: { - XaceSelectionAccessRec rec = { - va_arg(ap, ClientPtr), - va_arg(ap, Atom), - va_arg(ap, Mask), - Success /* default allow */ - }; - calldata = &rec; - prv = &rec.status; - break; - } case XACE_SCREEN_ACCESS: case XACE_SCREENSAVER_ACCESS: { XaceScreenAccessRec rec = { diff --git a/Xext/xace.h b/Xext/xace.h index 6f1f267ad..2016ca322 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -69,6 +69,8 @@ extern int XaceHook( extern int XaceHookDispatch(ClientPtr ptr, int major); extern int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr pProp, Mask access_mode); +extern int XaceHookSelectionAccess(ClientPtr ptr, Atom name, + Mask access_mode); extern void XaceHookAuditEnd(ClientPtr ptr, int result); /* Register a callback for a given hook. @@ -106,12 +108,14 @@ extern void XaceCensorImage( #define XaceHook(args...) Success #define XaceHookDispatch(args...) Success #define XaceHookPropertyAccess(args...) Success +#define XaceHookSelectionAccess(args...) Success #define XaceHookAuditEnd(args...) { ; } #define XaceCensorImage(args...) { ; } #else #define XaceHook(...) Success #define XaceHookDispatch(...) Success #define XaceHookPropertyAccess(...) Success +#define XaceHookSelectionAccess(...) Success #define XaceHookAuditEnd(...) { ; } #define XaceCensorImage(...) { ; } #endif -- cgit v1.2.3