From 6a89106e9c963a495fd40427d242ba0abd44f764 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Mon, 19 Mar 2007 16:51:29 -0400 Subject: [PATCH] xselinux + security: remove confusing CALLBACK macro. --- Xext/security.c | 43 ++++++++++++++++++++++++++++++------------- Xext/xselinux.c | 32 ++++++++++++++++++++------------ 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/Xext/security.c b/Xext/security.c index 7202d3947..98e91ad48 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -83,9 +83,6 @@ RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */ static RESTYPE RTEventClient; -#define CALLBACK(name) static void \ -name(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) - /* SecurityAudit * * Arguments: @@ -779,7 +776,9 @@ SecurityDetermineEventPropogationLimits( * An audit message is generated if access is denied. */ -CALLBACK(SecurityCheckDeviceAccess) +static void +SecurityCheckDeviceAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceDeviceAccessRec *rec = (XaceDeviceAccessRec*)calldata; ClientPtr client = rec->client; @@ -955,7 +954,9 @@ SecurityAuditResourceIDAccess( * Disallowed resource accesses are audited. */ -CALLBACK(SecurityCheckResourceIDAccess) +static void +SecurityCheckResourceIDAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceResourceAccessRec *rec = (XaceResourceAccessRec*)calldata; ClientPtr client = rec->client; @@ -1114,7 +1115,9 @@ CALLBACK(SecurityCheckResourceIDAccess) * if it is now zero, the timer for this authorization is started. */ -CALLBACK(SecurityClientStateCallback) +static void +SecurityClientStateCallback(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { NewClientInfoRec *pci = (NewClientInfoRec *)calldata; ClientPtr client = pci->client; @@ -1171,7 +1174,9 @@ CALLBACK(SecurityClientStateCallback) } } /* SecurityClientStateCallback */ -CALLBACK(SecurityCheckDrawableAccess) +static void +SecurityCheckDrawableAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceDrawableAccessRec *rec = (XaceDrawableAccessRec*)calldata; @@ -1179,7 +1184,9 @@ CALLBACK(SecurityCheckDrawableAccess) rec->rval = FALSE; } -CALLBACK(SecurityCheckMapAccess) +static void +SecurityCheckMapAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceMapAccessRec *rec = (XaceMapAccessRec*)calldata; WindowPtr pWin = rec->pWin; @@ -1193,7 +1200,9 @@ CALLBACK(SecurityCheckMapAccess) rec->rval = FALSE; } -CALLBACK(SecurityCheckBackgrndAccess) +static void +SecurityCheckBackgrndAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceMapAccessRec *rec = (XaceMapAccessRec*)calldata; @@ -1201,7 +1210,9 @@ CALLBACK(SecurityCheckBackgrndAccess) rec->rval = FALSE; } -CALLBACK(SecurityCheckExtAccess) +static void +SecurityCheckExtAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceExtAccessRec *rec = (XaceExtAccessRec*)calldata; @@ -1211,7 +1222,9 @@ CALLBACK(SecurityCheckExtAccess) rec->rval = FALSE; } -CALLBACK(SecurityCheckHostlistAccess) +static void +SecurityCheckHostlistAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceHostlistAccessRec *rec = (XaceHostlistAccessRec*)calldata; @@ -1227,7 +1240,9 @@ CALLBACK(SecurityCheckHostlistAccess) } } -CALLBACK(SecurityDeclareExtSecure) +static void +SecurityDeclareExtSecure(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XaceDeclareExtSecureRec *rec = (XaceDeclareExtSecureRec*)calldata; @@ -1692,7 +1707,9 @@ SecurityMatchString( #endif -CALLBACK(SecurityCheckPropertyAccess) +static void +SecurityCheckPropertyAccess(CallbackListPtr *pcbl, pointer unused, + pointer calldata) { XacePropertyAccessRec *rec = (XacePropertyAccessRec*)calldata; ClientPtr client = rec->client; diff --git a/Xext/xselinux.c b/Xext/xselinux.c index ab4827e09..74d4c6067 100644 --- a/Xext/xselinux.c +++ b/Xext/xselinux.c @@ -503,8 +503,6 @@ FreeClientState(ClientPtr client) #define IDPERM(client, req, field, class, perm) \ (REQUEST_SIZE_CHECK(client,req) && \ IDPerm(client, SwapXID(client,((req*)stuff)->field), class, perm)) -#define CALLBACK(name) static void \ -name(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) static int CheckSendEventPerms(ClientPtr client) @@ -632,7 +630,8 @@ CheckSetSelectionOwnerPerms(ClientPtr client) return rval; } -CALLBACK(XSELinuxCoreDispatch) +static void +XSELinuxCoreDispatch(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceCoreDispatchRec *rec = (XaceCoreDispatchRec*)calldata; ClientPtr client = rec->client; @@ -1017,7 +1016,8 @@ CALLBACK(XSELinuxCoreDispatch) rec->rval = FALSE; } -CALLBACK(XSELinuxExtDispatch) +static void +XSELinuxExtDispatch(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceExtAccessRec *rec = (XaceExtAccessRec*)calldata; ClientPtr client = rec->client; @@ -1058,7 +1058,8 @@ CALLBACK(XSELinuxExtDispatch) ErrorF("No client state in extension dispatcher!\n"); } /* XSELinuxExtDispatch */ -CALLBACK(XSELinuxProperty) +static void +XSELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XacePropertyAccessRec *rec = (XacePropertyAccessRec*)calldata; WindowPtr pWin = rec->pWin; @@ -1106,7 +1107,8 @@ CALLBACK(XSELinuxProperty) sidput(propsid); } /* XSELinuxProperty */ -CALLBACK(XSELinuxResLookup) +static void +XSELinuxResLookup(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceResourceAccessRec *rec = (XaceResourceAccessRec*)calldata; ClientPtr client = rec->client; @@ -1147,7 +1149,8 @@ CALLBACK(XSELinuxResLookup) rec->rval = FALSE; } /* XSELinuxResLookup */ -CALLBACK(XSELinuxMap) +static void +XSELinuxMap(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceMapAccessRec *rec = (XaceMapAccessRec*)calldata; if (!IDPerm(rec->client, rec->pWin->drawable.id, @@ -1155,7 +1158,8 @@ CALLBACK(XSELinuxMap) rec->rval = FALSE; } /* XSELinuxMap */ -CALLBACK(XSELinuxBackgrnd) +static void +XSELinuxBackgrnd(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceMapAccessRec *rec = (XaceMapAccessRec*)calldata; if (!IDPerm(rec->client, rec->pWin->drawable.id, @@ -1163,7 +1167,8 @@ CALLBACK(XSELinuxBackgrnd) rec->rval = FALSE; } /* XSELinuxBackgrnd */ -CALLBACK(XSELinuxDrawable) +static void +XSELinuxDrawable(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceDrawableAccessRec *rec = (XaceDrawableAccessRec*)calldata; if (!IDPerm(rec->client, rec->pDraw->id, @@ -1171,7 +1176,8 @@ CALLBACK(XSELinuxDrawable) rec->rval = FALSE; } /* XSELinuxDrawable */ -CALLBACK(XSELinuxHostlist) +static void +XSELinuxHostlist(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceHostlistAccessRec *rec = (XaceHostlistAccessRec*)calldata; access_vector_t perm = (rec->access_mode == DixReadAccess) ? @@ -1182,7 +1188,8 @@ CALLBACK(XSELinuxHostlist) } /* XSELinuxHostlist */ /* Extension callbacks */ -CALLBACK(XSELinuxClientState) +static void +XSELinuxClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) { NewClientInfoRec *pci = (NewClientInfoRec *)calldata; ClientPtr client = pci->client; @@ -1209,7 +1216,8 @@ CALLBACK(XSELinuxClientState) } /* XSELinuxClientState */ /* Labeling callbacks */ -CALLBACK(XSELinuxWindowInit) +static void +XSELinuxWindowInit(CallbackListPtr *pcbl, pointer unused, pointer calldata) { XaceWindowRec *rec = (XaceWindowRec*)calldata; security_context_t ctx;