[pve-devel] [PATCH firewall 1/2] make group digest stable

Dominik Csapak d.csapak at proxmox.com
Fri Jun 3 15:14:23 CEST 2016


if we had mulitple security groups and wanted to
edit one, we did not have a stable digest,
because perl hashes are not sorted

this patch sorts the keys before hashing

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/API2/Firewall/Groups.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/API2/Firewall/Groups.pm b/src/PVE/API2/Firewall/Groups.pm
index e8f2116..99ea418 100644
--- a/src/PVE/API2/Firewall/Groups.pm
+++ b/src/PVE/API2/Firewall/Groups.pm
@@ -16,7 +16,7 @@ my $get_security_group_list = sub {
     my ($cluster_conf) = @_;
 
     my $res = [];
-    foreach my $group (keys %{$cluster_conf->{groups}}) {
+    foreach my $group (sort keys %{$cluster_conf->{groups}}) {
 	my $data = { 
 	    group => $group,
 	};
-- 
2.1.4




More information about the pve-devel mailing list