* [PATCH container] fix #8237: delete read restricted options: fix calls to check_vm_perm
@ 2026-10-29 10:30 Fiona Ebner
2026-10-29 14:05 ` applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2026-10-29 10:30 UTC (permalink / raw)
To: pve-devel
The checks are supposed to pass $noerr=1, but instead passed $any=1.
Therefore, GET requests for '/config' and '/pending' by a user without
'VM.Config.Options' would fail for containers with 'env' set instead
of deleting the key from the result.
Fixes: 9ec1a04 ("api: config: censor env property for users without VM.Config.Options")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/LXC.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 44ae4fa..4afa391 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1639,7 +1639,7 @@ sub delete_read_restricted_options {
for my ($restricted_key, $required_priv) ($options_with_restricted_read->%*) {
my $has_no_access = 0;
if (exists($conf->{$restricted_key})) {
- if (!$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], 1)) {
+ if (!$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], undef, 1)) {
$has_no_access = 1;
delete $conf->{$restricted_key};
}
@@ -1647,7 +1647,7 @@ sub delete_read_restricted_options {
if (exists($conf->{pending}) && exists($conf->{pending}->{$restricted_key})) {
if (
$has_no_access
- || !$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], 1)
+ || !$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], undef, 1)
) {
delete $conf->{pending}->{$restricted_key};
}
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-29 14:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 10:30 [PATCH container] fix #8237: delete read restricted options: fix calls to check_vm_perm Fiona Ebner
2026-10-29 14:05 ` applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox