[pve-devel] [PATCH manager] VZDump: handle timelocal year correctly

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Feb 28 11:12:01 CET 2018


while this is unlikely to cause any problems, it is unnecessary to
substract 1900 here - timelocal handles 4-digit years perfectly well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
saw this while grepping for timelocal/timegm because of #1682

 PVE/VZDump.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index b7779de8..3d34f9fc 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -729,7 +729,7 @@ sub get_backup_file_list {
 	next if $exclude_fn && $fn eq $exclude_fn;
 	if ($fn =~ m!/(${bkname}-(\d{4})_(\d{2})_(\d{2})-(\d{2})_(\d{2})_(\d{2})\.(tgz|((tar|vma)(\.(gz|lzo))?)))$!) {
 	    $fn = "$dir/$1"; # untaint
-	    my $t = timelocal ($7, $6, $5, $4, $3 - 1, $2 - 1900);
+	    my $t = timelocal ($7, $6, $5, $4, $3 - 1, $2);
 	    push @$bklist, [$fn, $t];
 	}
     }
-- 
2.14.2





More information about the pve-devel mailing list