mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-15 03:12:30 +00:00
allow non-root users to set /dev/hwrng as an RNG source
Allow users with the Mapping.Use privilege on the /mapping/hwrng path to configure /dev/hwrng as an entropy source for VirtIO RNG devices. Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
This commit is contained in:
parent
b2a0b6b1f0
commit
6a956f8604
@ -819,7 +819,7 @@ my sub check_rng_perm {
|
|||||||
|
|
||||||
my $device = PVE::JSONSchema::parse_property_string('pve-qm-rng', $value);
|
my $device = PVE::JSONSchema::parse_property_string('pve-qm-rng', $value);
|
||||||
if ($device->{source} && $device->{source} eq '/dev/hwrng') {
|
if ($device->{source} && $device->{source} eq '/dev/hwrng') {
|
||||||
die "only root can set '$opt' config for a non-mapped Hardware RNG device\n";
|
$rpcenv->check_full($authuser, "/mapping/hwrng", ['Mapping.Use']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -6461,7 +6461,7 @@ sub check_mapping_access {
|
|||||||
my $device = PVE::JSONSchema::parse_property_string('pve-qm-rng', $conf->{$opt});
|
my $device = PVE::JSONSchema::parse_property_string('pve-qm-rng', $conf->{$opt});
|
||||||
|
|
||||||
if ($device->{source} && $device->{source} eq '/dev/hwrng') {
|
if ($device->{source} && $device->{source} eq '/dev/hwrng') {
|
||||||
die "only root can set '$opt' config for a non-mapped Hardware RNG device\n";
|
$rpcenv->check_full($user, "/mapping/hwrng", ['Mapping.Use']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user