summaryrefslogtreecommitdiff
path: root/Xext/xace.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-04-29 14:22:52 -0400
committerAdam Jackson <ajax@redhat.com>2016-06-10 13:26:19 -0400
commit6cb34816afa95d9214199c363f9b4bb5ecbae77b (patch)
treee238564ed4559eb1b504cf0912075f587296a29f /Xext/xace.c
parentda9fec4eddd554b4b709ba58b4436aef5a76cd51 (diff)
xace: Remove the audit hooks and tune dispatch
There are no in-tree consumers of the audit hooks, and they are in any case redundant with the dtrace dispatch hooks. Neither is there any in-tree user of the core request dispatch hook. The extension hook is only used for non-default security cases, but in the absence of LTO we always have to take the function call into XaceHookDispatch to find out that there's no callback registered. Cc: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext/xace.c')
-rw-r--r--Xext/xace.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/Xext/xace.c b/Xext/xace.c
index fcb38db8c..91c74d591 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -33,28 +33,17 @@ _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
/* Special-cased hook functions. Called by Xserver.
*/
+#undef XaceHookDispatch
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 drec = { client, Success /* default allow */ };
- CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec);
- return drec.status;
- }
- else {
- /* 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;
- }
+ /* 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;
}
int
@@ -74,14 +63,6 @@ XaceHookSelectionAccess(ClientPtr client, Selection ** ppSel, Mask access_mode)
return rec.status;
}
-void
-XaceHookAuditEnd(ClientPtr ptr, int result)
-{
- XaceAuditRec rec = { ptr, result };
- /* call callbacks, there is no return value. */
- CallCallbacks(&XaceHooks[XACE_AUDIT_END], &rec);
-}
-
/* Entry point for hook functions. Called by Xserver.
*/
int