diff --git a/Xext/xace.c b/Xext/xace.c index 82cc6d2b536bffda77a8cdacd7234cfe5d003d50..f0c70553e401c136427ef34ba0277a8f88af6f0d 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -101,13 +101,19 @@ int XaceHookClientAccess(ClientPtr client, ClientPtr target, Mask access_mode) return rec.status; } +int XaceHookExtAccess(ClientPtr client, ExtensionEntry *ext) +{ + XaceExtAccessRec rec = { client, ext, DixGetAttrAccess, Success }; + CallCallbacks(&XaceHooks[XACE_EXT_ACCESS], &rec); + return rec.status; +} + /* Entry point for hook functions. Called by Xserver. */ int XaceHook(int hook, ...) { union { - XaceExtAccessRec ext; XaceServerAccessRec server; XaceScreenAccessRec screen; XaceAuthAvailRec auth; @@ -127,14 +133,6 @@ XaceHook(int hook, ...) * sets calldata directly to a single argument (with no return result) */ switch (hook) { - case XACE_EXT_ACCESS: - u.ext.client = va_arg(ap, ClientPtr); - - u.ext.ext = va_arg(ap, ExtensionEntry *); - u.ext.access_mode = DixGetAttrAccess; - u.ext.status = Success; /* default allow */ - prv = &u.ext.status; - break; case XACE_SERVER_ACCESS: u.server.client = va_arg(ap, ClientPtr); u.server.access_mode = va_arg(ap, Mask); diff --git a/Xext/xace.h b/Xext/xace.h index 9227794a01d031e3a285eafd3bba1c1df19fb057..1a88cab92da07f370ebef631b6b868404bfc47c8 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -25,6 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define XACE_MAJOR_VERSION 2 #define XACE_MINOR_VERSION 0 +#include "extnsionst.h" #include "pixmap.h" #include "region.h" #include "window.h" @@ -88,6 +89,7 @@ int XaceHookSendAccess(ClientPtr client, DeviceIntPtr dev, WindowPtr win, xEventPtr ev, int count); int XaceHookReceiveAccess(ClientPtr client, WindowPtr win, xEventPtr ev, int count); int XaceHookClientAccess(ClientPtr client, ClientPtr target, Mask access_mode); +int XaceHookExtAccess(ClientPtr client, ExtensionEntry *ext); /* Register a callback for a given hook. diff --git a/dix/extension.c b/dix/extension.c index dbe6c0a971781a9cb0dac98692cefceafc7f40c3..e8a373de3aaccfa1b8ce2133999e76a9d94237d4 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -215,7 +215,7 @@ CloseDownExtensions(void) static Bool ExtensionAvailable(ClientPtr client, ExtensionEntry *ext) { - if (XaceHook(XACE_EXT_ACCESS, client, ext) != Success) + if (XaceHookExtAccess(client, ext) != Success) return FALSE; if (!ext->base) return FALSE;