X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=blobdiff_plain;f=src%2FPVE%2FAPI2%2FFirewall%2FGroups.pm;fp=src%2FPVE%2FAPI2%2FFirewall%2FGroups.pm;h=dfc181c90a2724c8ae19043e366fa4d427036108;hp=99ea41877cc6196bb504e5945f13bbaff045b41a;hb=5da1a22976974c6ffde189206f2a03760e8854d8;hpb=5c53cde45212f584ba3362f732508a5c2f169dc1 diff --git a/src/PVE/API2/Firewall/Groups.pm b/src/PVE/API2/Firewall/Groups.pm index 99ea418..dfc181c 100644 --- a/src/PVE/API2/Firewall/Groups.pm +++ b/src/PVE/API2/Firewall/Groups.pm @@ -101,6 +101,11 @@ __PACKAGE__->register_method({ raise_param_exc({ group => "Security group '$param->{rename}' does not exists" }) if !$cluster_conf->{groups}->{$param->{rename}}; + # prevent overwriting an existing group + raise_param_exc({ group => "Security group '$param->{group}' does already exist" }) + if $cluster_conf->{groups}->{$param->{group}} && + $param->{group} ne $param->{rename}; + my $data = delete $cluster_conf->{groups}->{$param->{rename}}; $cluster_conf->{groups}->{$param->{group}} = $data; if (my $comment = delete $cluster_conf->{group_comments}->{$param->{rename}}) {