[pmg-devel] [PATCH pmg-api] quarantine: userlists: sort result

Stoiko Ivanov s.ivanov at proxmox.com
Thu Feb 22 22:07:30 CET 2024


probably just cosmetic - but I noticed it while testing the patch that
fixes the sync of an empty userlist.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/Quarantine.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PMG/Quarantine.pm b/src/PMG/Quarantine.pm
index e19e96f..d06a88d 100644
--- a/src/PMG/Quarantine.pm
+++ b/src/PMG/Quarantine.pm
@@ -59,8 +59,8 @@ sub add_to_blackwhite {
 	    }
 	}
 
-	my $wlist = $dbh->quote(encode('UTF-8', join (',', keys %{$list->{WL}})) || '');
-	my $blist = $dbh->quote(encode('UTF-8', join (',', keys %{$list->{BL}})) || '');
+	my $wlist = $dbh->quote(encode('UTF-8', join (',', sort keys %{$list->{WL}})) || '');
+	my $blist = $dbh->quote(encode('UTF-8', join (',', sort keys %{$list->{BL}})) || '');
 
 	if (!$delete) {
 	    my $maxlen = 200000;
@@ -81,7 +81,7 @@ sub add_to_blackwhite {
 	$dbh->do($queries);
     }
 
-    my $values =  [ keys %{$list->{$name}} ];
+    my $values =  [ sort keys %{$list->{$name}} ];
 
     return $values;
 }
-- 
2.39.2





More information about the pmg-devel mailing list