summaryrefslogtreecommitdiff
path: root/dix/dispatch.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-16 10:36:05 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-16 10:36:05 -0400
commitb82557c9fb60f11fd2696c8fb2ae17b9dfd915ed (patch)
treed21b202f1b12078d2ca46e7b2de2445fc4df38d0 /dix/dispatch.c
parent568ae737d1d5d476a0bf85659d88910c4e0ef5e0 (diff)
xace: add hooks + new access codes: core protocol screensaver requests
Diffstat (limited to 'dix/dispatch.c')
-rw-r--r--dix/dispatch.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 0bf92de3c..2dc32a525 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3244,10 +3244,17 @@ ProcQueryBestSize (ClientPtr client)
int
ProcSetScreenSaver (ClientPtr client)
{
- int blankingOption, exposureOption;
+ int rc, i, blankingOption, exposureOption;
REQUEST(xSetScreenSaverReq);
-
REQUEST_SIZE_MATCH(xSetScreenSaverReq);
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i],
+ DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ }
+
blankingOption = stuff->preferBlank;
if ((blankingOption != DontPreferBlanking) &&
(blankingOption != PreferBlanking) &&
@@ -3301,8 +3308,16 @@ int
ProcGetScreenSaver(ClientPtr client)
{
xGetScreenSaverReply rep;
-
+ int rc, i;
REQUEST_SIZE_MATCH(xReq);
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i],
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ }
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -3523,6 +3538,7 @@ ProcChangeCloseDownMode(ClientPtr client)
int ProcForceScreenSaver(ClientPtr client)
{
+ int rc;
REQUEST(xForceScreenSaverReq);
REQUEST_SIZE_MATCH(xForceScreenSaverReq);
@@ -3533,7 +3549,9 @@ int ProcForceScreenSaver(ClientPtr client)
client->errorValue = stuff->mode;
return BadValue;
}
- SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode);
+ rc = SaveScreens(client, SCREEN_SAVER_FORCER, (int)stuff->mode);
+ if (rc != Success)
+ return rc;
return client->noClientException;
}