]> git.proxmox.com Git - pve-container.git/commitdiff
config permission check: also check access for currently configured bridge
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 17 Jul 2023 07:15:17 +0000 (09:15 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 19 Jul 2023 09:54:52 +0000 (11:54 +0200)
Relevant when modifying or removing an existing network device.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/LXC.pm

index a531ea513367b331d40d78d3690dafdb293e4be3..1e9af0fd0e66f0cea3f1cf60a79e37f1e4052867 100644 (file)
@@ -1316,7 +1316,8 @@ sub check_ct_modify_config_perm {
            $rpcenv->check_vm_perm($authuser, $vmid, $pool, ['VM.Config.Memory']);
        } elsif ($opt =~ m/^net\d+$/) {
            $rpcenv->check_vm_perm($authuser, $vmid, $pool, ['VM.Config.Network']);
-           PVE::LXC::check_bridge_access($rpcenv, $authuser, $newconf->{$opt});
+           check_bridge_access($rpcenv, $authuser, $oldconf->{$opt}) if $oldconf->{$opt};
+           check_bridge_access($rpcenv, $authuser, $newconf->{$opt}) if $newconf->{$opt};
        } elsif ($opt eq 'nameserver' || $opt eq 'searchdomain' || $opt eq 'hostname') {
            $rpcenv->check_vm_perm($authuser, $vmid, $pool, ['VM.Config.Network']);
        } elsif ($opt eq 'features') {