[pve-devel] [PATCH manager] appliance index: fix precedence in size check for log rotation

Fiona Ebner f.ebner at proxmox.com
Wed Feb 28 13:07:08 CET 2024


In Perl, > takes precedence over ||, see perldoc perlop, so currently
the check will trigger with any size.

Fixes: 805cae93 ("appliance index: rotate update log if bigger than 256 KiB")
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/APLInfo.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/APLInfo.pm b/PVE/APLInfo.pm
index a4acf490..07542743 100644
--- a/PVE/APLInfo.pm
+++ b/PVE/APLInfo.pm
@@ -213,7 +213,7 @@ sub get_apl_sources {
 sub update {
     my ($proxy) = @_;
 
-    if (-s $logfile || 0 > 1024 * 256) {
+    if ((-s $logfile || 0) > 1024 * 256) {
 	rename($logfile, "$logfile.0");
     }
     my $logfd = IO::File->new (">>$logfile");
-- 
2.39.2





More information about the pve-devel mailing list