From: Filip Schauer <f.schauer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v4 9/9] ui: let non-root users configure VirtIO RNG devices
Date: Tue, 18 Feb 2025 12:11:02 +0100 [thread overview]
Message-ID: <20250218111102.40055-10-f.schauer@proxmox.com> (raw)
In-Reply-To: <20250218111102.40055-1-f.schauer@proxmox.com>
Allow non-root users with the VM.Config.HWType privilege to configure
/dev/urandom & /dev/random as an entropy source for a VirtIO RNG device.
Users with the Mapping.Use privilege on the /mapping/hwrng ACL path may
also configure /dev/hwrng as an entropy source.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
www/manager6/qemu/HardwareView.js | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index c6d193fc..af6df8cd 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -315,8 +315,8 @@ Ext.define('PVE.qemu.HardwareView', {
rows.rng0 = {
group: 45,
tdCls: 'pve-itype-icon-die',
- editor: caps.nodes['Sys.Console'] ? 'PVE.qemu.RNGEdit' : undefined,
- never_delete: !caps.nodes['Sys.Console'],
+ editor: caps.vms['VM.Config.HWType'] || caps.mapping.hwrng['Mapping.Use'] ? 'PVE.qemu.RNGEdit' : undefined,
+ never_delete: !caps.vms['VM.Config.HWType'] && !caps.mapping.hwrng['Mapping.Use'],
header: gettext("VirtIO RNG"),
};
@@ -588,7 +588,6 @@ Ext.define('PVE.qemu.HardwareView', {
});
// heuristic only for disabling some stuff, the backend has the final word.
- const noSysConsolePerm = !caps.nodes['Sys.Console'];
const noHWPerm = !caps.nodes['Sys.Console'] && !caps.mapping['Mapping.Use'];
const noVMConfigHWTypePerm = !caps.vms['VM.Config.HWType'];
const noVMConfigNetPerm = !caps.vms['VM.Config.Network'];
@@ -601,7 +600,7 @@ Ext.define('PVE.qemu.HardwareView', {
me.down('#addAudio').setDisabled(noVMConfigHWTypePerm || isAtLimit('audio'));
me.down('#addSerial').setDisabled(noVMConfigHWTypePerm || isAtLimit('serial'));
me.down('#addNet').setDisabled(noVMConfigNetPerm || isAtLimit('net'));
- me.down('#addRng').setDisabled(noSysConsolePerm || isAtLimit('rng'));
+ me.down('#addRng').setDisabled(noVMConfigHWTypePerm || isAtLimit('rng'));
efidisk_menuitem.setDisabled(noVMConfigDiskPerm || isAtLimit('efidisk'));
me.down('#addTpmState').setDisabled(noVMConfigDiskPerm || isAtLimit('tpmstate'));
me.down('#addCloudinitDrive').setDisabled(noVMConfigCDROMPerm || noVMConfigCloudinitPerm || hasCloudInit);
@@ -745,7 +744,7 @@ Ext.define('PVE.qemu.HardwareView', {
text: gettext("VirtIO RNG"),
itemId: 'addRng',
iconCls: 'pve-itype-icon-die',
- disabled: !caps.nodes['Sys.Console'],
+ disabled: !caps.vms['VM.Config.HWType'] && !caps.mapping.hwrng['Mapping.Use'],
handler: editorFactory('RNGEdit'),
},
],
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-02-18 11:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 11:10 [pve-devel] [PATCH manager/qemu-server v4 0/9] fix #5657: allow configuring RNG device as non-root user Filip Schauer
2025-02-18 11:10 ` [pve-devel] [PATCH qemu-server v4 1/9] remove outdated /dev/random entropy-starvation warnings Filip Schauer
2025-02-18 11:10 ` [pve-devel] [PATCH qemu-server v4 2/9] refactor: move rng related code into its own module Filip Schauer
2025-02-18 11:10 ` [pve-devel] [PATCH qemu-server v4 3/9] add helpers for VirtIO RNG command line arguments Filip Schauer
2025-02-18 11:10 ` [pve-devel] [PATCH qemu-server v4 4/9] refactor: check_mapping_access: move root user check to the top Filip Schauer
2025-02-18 11:10 ` [pve-devel] [PATCH qemu-server v4 5/9] allow non-root users to set /dev/u?random as an RNG source Filip Schauer
2025-02-18 11:10 ` [pve-devel] [PATCH qemu-server v4 6/9] allow non-root users to set /dev/hwrng " Filip Schauer
2025-02-18 11:11 ` [pve-devel] [PATCH manager v4 7/9] ui: remove warning about entropy starvation of /dev/random Filip Schauer
2025-02-18 11:11 ` [pve-devel] [PATCH manager v4 8/9] ui: permissions: add ACL path for hardware RNG Filip Schauer
2025-02-18 11:11 ` Filip Schauer [this message]
2025-04-04 9:21 ` [pve-devel] applied-series: [PATCH manager/qemu-server v4 0/9] fix #5657: allow configuring RNG device as non-root user Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250218111102.40055-10-f.schauer@proxmox.com \
--to=f.schauer@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.