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.
This commit is contained in:
parent
ba69904148
commit
ae43d835bd
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
14
xkb/xkb.c
14
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];
|
||||
|
|
Loading…
Reference in New Issue
Block a user