From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7D6071FF168 for <inbox@lore.proxmox.com>; Tue, 18 Feb 2025 12:12:10 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 555189B76; Tue, 18 Feb 2025 12:11:43 +0100 (CET) From: Filip Schauer <f.schauer@proxmox.com> To: pve-devel@lists.proxmox.com Date: Tue, 18 Feb 2025 12:10:59 +0100 Message-Id: <20250218111102.40055-7-f.schauer@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250218111102.40055-1-f.schauer@proxmox.com> References: <20250218111102.40055-1-f.schauer@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.170 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server v4 6/9] allow non-root users to set /dev/hwrng as an RNG source X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> 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> --- PVE/API2/Qemu.pm | 2 +- PVE/QemuServer.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 2e99bf05..4d6a738d 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -812,7 +812,7 @@ my sub check_rng_perm { my $device = PVE::JSONSchema::parse_property_string('pve-qm-rng', $value); 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; diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 007ff2fc..1d495fa8 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -6404,7 +6404,7 @@ sub check_mapping_access { my $device = PVE::JSONSchema::parse_property_string('pve-qm-rng', $conf->{$opt}); 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']); } } } -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel