summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2008-02-13 19:39:49 -0500
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2008-02-13 20:20:49 -0500
commitae43d835bdaef96c3c73d7cee5b105f07340833d (patch)
tree0bdf9d6a63961a2ac3fd0229f635cf0dce39c3ce
parentba69904148acf755bec8fbda2eb869144f0ef7d4 (diff)
XACE: Change access modes for some device-related requests.
Opening a device is not really "reading" it. Requests that globally configure a device should require "manage" access.
-rw-r--r--Xi/chgdctl.c2
-rw-r--r--Xi/chgfctl.c2
-rw-r--r--Xi/chgkmap.c2
-rw-r--r--Xi/closedev.c2
-rw-r--r--Xi/opendev.c2
-rw-r--r--Xi/setbmap.c2
-rw-r--r--Xi/setmmap.c2
-rw-r--r--dix/devices.c10
-rw-r--r--xkb/xkb.c14
9 files changed, 19 insertions, 19 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index e7d04a781..30174f496 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -111,7 +111,7 @@ ProcXChangeDeviceControl(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
goto out;
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index 696b74a16..3155e87c2 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -444,7 +444,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (rc != Success)
return rc;
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
index df334c11c..3f51648e1 100644
--- a/Xi/chgkmap.c
+++ b/Xi/chgkmap.c
@@ -106,7 +106,7 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
diff --git a/Xi/closedev.c b/Xi/closedev.c
index b2b5f69a6..94b7391fb 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -146,7 +146,7 @@ ProcXCloseDevice(ClientPtr client)
REQUEST(xCloseDeviceReq);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
- rc = dixLookupDevice(&d, stuff->deviceid, client, DixGetAttrAccess);
+ rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
if (rc != Success)
return rc;
diff --git a/Xi/opendev.c b/Xi/opendev.c
index 128b1bd9c..acda38530 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -106,7 +106,7 @@ ProcXOpenDevice(ClientPtr client)
stuff->deviceid == inputInfo.keyboard->id)
return BadDevice;
- status = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
+ status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
if (status == BadDevice) { /* not open */
for (dev = inputInfo.off_devices; dev; dev = dev->next)
if (dev->id == stuff->deviceid)
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index 3035c649e..f05225531 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -109,7 +109,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.status = MappingSuccess;
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index be3d3cb6c..34efde595 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -98,7 +98,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
REQUEST(xSetDeviceModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;
diff --git a/dix/devices.c b/dix/devices.c
index 534a0b9e5..bdcca5aba 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1295,7 +1295,7 @@ DoSetModifierMapping(ClientPtr client, KeyCode *inputMap,
}
}
- rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (rc != Success)
return rc;
@@ -1435,7 +1435,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (rc != Success)
return rc;
}
@@ -1472,7 +1472,7 @@ DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
for (dev = inputInfo.devices; dev; dev = dev->next) {
if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
if (rc != Success)
return rc;
}
@@ -1810,7 +1810,7 @@ ProcChangeKeyboardControl (ClientPtr client)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) &&
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
- ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixSetAttrAccess);
+ ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (ret != Success)
return ret;
}
@@ -1961,7 +1961,7 @@ ProcChangePointerControl(ClientPtr client)
for (mouse = inputInfo.devices; mouse; mouse = mouse->next) {
if ((mouse->coreEvents || mouse == inputInfo.pointer) &&
mouse->ptrfeed && mouse->ptrfeed->CtrlProc) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixManageAccess);
if (rc != Success)
return rc;
}
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 23e1dc76f..26f2812fe 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -211,7 +211,7 @@ ProcXkbSelectEvents(ClientPtr client)
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
- CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess);
+ CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixUseAccess);
if (((stuff->affectWhich&XkbMapNotifyMask)!=0)&&(stuff->affectMap)) {
client->mapNotifyMask&= ~stuff->affectMap;
@@ -694,7 +694,7 @@ ProcXkbSetControls(ClientPtr client)
if (!(client->xkbClientFlags & _XkbClientInitialized))
return BadAccess;
- CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
+ CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask);
for (tmpd = inputInfo.keyboard; tmpd; tmpd = tmpd->next) {
@@ -2304,7 +2304,7 @@ ProcXkbSetMap(ClientPtr client)
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
- CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
+ CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask);
XkbSetCauseXkbReq(&cause,X_kbSetMap,client);
@@ -2618,7 +2618,7 @@ ProcXkbSetCompatMap(ClientPtr client)
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
- CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
+ CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
data = (char *)&stuff[1];
xkbi = dev->key->xkbInfo;
@@ -4844,7 +4844,7 @@ ProcXkbSetGeometry(ClientPtr client)
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
- CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
+ CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_ATOM_OR_NONE(stuff->name);
xkb= dev->key->xkbInfo->desc;
@@ -5126,7 +5126,7 @@ ProcXkbGetKbdByName(ClientPtr client)
Bool geom_changed;
XkbSrvLedInfoPtr old_sli;
XkbSrvLedInfoPtr sli;
- Mask access_mode = DixGetAttrAccess | DixSetAttrAccess;
+ Mask access_mode = DixGetAttrAccess | DixManageAccess;
REQUEST(xkbGetKbdByNameReq);
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
@@ -5997,7 +5997,7 @@ xkbExtensionDeviceNotify ed;
change= stuff->change;
- CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
+ CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_MASK_LEGAL(0x01,change,XkbXI_AllFeaturesMask);
wire= (char *)&stuff[1];