int XaceHookDispatch(ClientPtr client, int major) { /* Call the extension dispatch hook */ ExtensionEntry *ext = GetExtensionEntry(major); XaceExtAccessRec erec = { client, ext, DixUseAccess, Success }; if (ext) CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); /* On error, pretend extension doesn't exist */ return (erec.status == Success) ? Success : BadRequest; }
const char * LookupMajorName(int major) { if (major < 128) { const char *retval; if (major >= nmajor) return XREGISTRY_UNKNOWN; if (0 >= nminor[major]) return XREGISTRY_UNKNOWN; retval = requests[major][0]; return retval ? retval + sizeof(CORE) : XREGISTRY_UNKNOWN; } else { ExtensionEntry *extEntry = GetExtensionEntry(major); return extEntry ? extEntry->name : XREGISTRY_UNKNOWN; } }
/* Special-cased hook functions. Called by Xserver. */ int XaceHookDispatch(ClientPtr client, int major) { /* Call the audit begin callback, there is no return value. */ XaceAuditRec rec = { client, 0 }; CallCallbacks(&XaceHooks[XACE_AUDIT_BEGIN], &rec); if (major < 128) { /* Call the core dispatch hook */ XaceCoreDispatchRec rec = { client, Success /* default allow */ }; CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec); return rec.status; } else { /* Call the extension dispatch hook */ ExtensionEntry *ext = GetExtensionEntry(major); XaceExtAccessRec rec = { client, ext, DixUseAccess, Success }; if (ext) CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &rec); /* On error, pretend extension doesn't exist */ return (rec.status == Success) ? Success : BadRequest; } }