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

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Mar 7 11:50:19 CET 2018


applied

On 2/28/18 11:12 AM, Fabian Grünbichler wrote:
> 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];
>  	}
>      }
> 






More information about the pve-devel mailing list