dix: replace XACE_SERVER_ACCESS by direct callback

Move the callbacks directly into DIX, since it's actually core infrastructure.
Also simplifying the whole machinery, by just using a simpel CallbackListPtr.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-09-17 17:24:55 +02:00
committed by Enrico Weigelt
parent bd41233e47
commit 6168868906
13 changed files with 56 additions and 35 deletions

View File

@@ -115,6 +115,7 @@ Equipment Corporation.
#include "dix/resource_priv.h"
#include "dix/screenint_priv.h"
#include "dix/selection_priv.h"
#include "dix/server_priv.h"
#include "dix/window_priv.h"
#include "include/resource.h"
#include "miext/extinit_priv.h"
@@ -172,7 +173,9 @@ static int nextFreeClientID; /* always MIN free client ID */
static int nClients; /* number of authorized clients */
CallbackListPtr ClientStateCallback;
CallbackListPtr ClientStateCallback = NULL;
CallbackListPtr ServerAccessCallback = NULL;
OsTimerPtr dispatchExceptionTimer;
/* dispatchException & isItTimeToYield must be declared volatile since they
@@ -3280,7 +3283,7 @@ ProcListHosts(ClientPtr client)
REQUEST_SIZE_MATCH(xListHostsReq);
/* untrusted clients can't list hosts */
result = XaceHookServerAccess(client, DixReadAccess);
result = dixCallServerAccessCallback(client, DixReadAccess);
if (result != Success)
return result;
@@ -3409,7 +3412,7 @@ ProcGetFontPath(ClientPtr client)
/* REQUEST (xReq); */
REQUEST_SIZE_MATCH(xReq);
int rc = XaceHookServerAccess(client, DixGetAttrAccess);
int rc = dixCallServerAccessCallback(client, DixGetAttrAccess);
if (rc != Success)
return rc;