Xres: XResQueryClientIds: enable security filtering

Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-04-17 17:54:33 +02:00
parent 750b65de69
commit 098008879b

View File

@ -545,7 +545,9 @@ ConstructClientIds(ClientPtr client,
if (specs[specIdx].client == 0) { if (specs[specIdx].client == 0) {
int c; int c;
for (c = 0; c < currentMaxClients; ++c) { for (c = 0; c < currentMaxClients; ++c) {
if (clients[c]) { if (clients[c] &&
(XaceHookClientAccess(client, clients[c], DixReadAccess)
!= Success)) {
if (!ConstructClientIdValue(client, clients[c], if (!ConstructClientIdValue(client, clients[c],
specs[specIdx].mask, ctx)) { specs[specIdx].mask, ctx)) {
return BadAlloc; return BadAlloc;
@ -555,7 +557,9 @@ ConstructClientIds(ClientPtr client,
} else { } else {
int clientID = CLIENT_ID(specs[specIdx].client); int clientID = CLIENT_ID(specs[specIdx].client);
if ((clientID < currentMaxClients) && clients[clientID]) { if ((clientID < currentMaxClients) && clients[clientID] &&
(XaceHookClientAccess(client, clients[clientID], DixReadAccess)
!= Success)) {
if (!ConstructClientIdValue(client, clients[clientID], if (!ConstructClientIdValue(client, clients[clientID],
specs[specIdx].mask, ctx)) { specs[specIdx].mask, ctx)) {
return BadAlloc; return BadAlloc;