mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
Fix polkit permission names for storage pools, vols & node devices
The polkit access driver used the wrong permission names for checks on storage pools, volumes and node devices. This led to them always being denied access. The 'dettach' permission was also mis-spelt and should have been 'detach'. While permission names are ABI sensitive, the fact that the code used the wrong object name for checking node device permissions, means that no one could have used the mis-spelt 'dettach' permission. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
f084caae7c
commit
621849383a
@ -248,7 +248,7 @@ virAccessDriverPolkitCheckNodeDevice(virAccessManagerPtr manager,
|
||||
};
|
||||
|
||||
return virAccessDriverPolkitCheck(manager,
|
||||
"nodedevice",
|
||||
"node-device",
|
||||
virAccessPermNodeDeviceTypeToString(perm),
|
||||
attrs);
|
||||
}
|
||||
@ -355,7 +355,7 @@ virAccessDriverPolkitCheckStoragePool(virAccessManagerPtr manager,
|
||||
virUUIDFormat(pool->uuid, uuidstr);
|
||||
|
||||
return virAccessDriverPolkitCheck(manager,
|
||||
"pool",
|
||||
"storage-pool",
|
||||
virAccessPermStoragePoolTypeToString(perm),
|
||||
attrs);
|
||||
}
|
||||
@ -379,7 +379,7 @@ virAccessDriverPolkitCheckStorageVol(virAccessManagerPtr manager,
|
||||
virUUIDFormat(pool->uuid, uuidstr);
|
||||
|
||||
return virAccessDriverPolkitCheck(manager,
|
||||
"vol",
|
||||
"storage-vol",
|
||||
virAccessPermStorageVolTypeToString(perm),
|
||||
attrs);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ VIR_ENUM_IMPL(virAccessPermNodeDevice,
|
||||
VIR_ACCESS_PERM_NODE_DEVICE_LAST,
|
||||
"getattr", "read", "write",
|
||||
"start", "stop",
|
||||
"dettach");
|
||||
"detach");
|
||||
|
||||
VIR_ENUM_IMPL(virAccessPermNWFilter,
|
||||
VIR_ACCESS_PERM_NWFILTER_LAST,
|
||||
|
@ -427,7 +427,7 @@ typedef enum {
|
||||
* @desc: Detach node device
|
||||
* @message: Detaching node device driver requires authorization
|
||||
*/
|
||||
VIR_ACCESS_PERM_NODE_DEVICE_DETTACH,
|
||||
VIR_ACCESS_PERM_NODE_DEVICE_DETACH,
|
||||
|
||||
VIR_ACCESS_PERM_NODE_DEVICE_LAST
|
||||
} virAccessPermNodeDevice;
|
||||
|
@ -3696,19 +3696,19 @@ enum remote_procedure {
|
||||
|
||||
/**
|
||||
* @generate: server
|
||||
* @acl: node_device:dettach
|
||||
* @acl: node_device:detach
|
||||
*/
|
||||
REMOTE_PROC_NODE_DEVICE_DETTACH = 118,
|
||||
|
||||
/**
|
||||
* @generate: server
|
||||
* @acl: node_device:dettach
|
||||
* @acl: node_device:detach
|
||||
*/
|
||||
REMOTE_PROC_NODE_DEVICE_RE_ATTACH = 119,
|
||||
|
||||
/**
|
||||
* @generate: server
|
||||
* @acl: node_device:dettach
|
||||
* @acl: node_device:detach
|
||||
*/
|
||||
REMOTE_PROC_NODE_DEVICE_RESET = 120,
|
||||
|
||||
@ -4929,7 +4929,7 @@ enum remote_procedure {
|
||||
|
||||
/**
|
||||
* @generate: server
|
||||
* @acl: node_device:dettach
|
||||
* @acl: node_device:detach
|
||||
*/
|
||||
REMOTE_PROC_NODE_DEVICE_DETACH_FLAGS = 301,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user