fix #2226: ignore broken symlinks in *_list
Broken symlinks (and other files without a size) will now show up as 0 byte instead of causing a format validation error in the API. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
ea02de000f
commit
5f73686fd3
@ -800,7 +800,7 @@ sub snippets_list {
|
||||
push @{$res->{$sid}}, {
|
||||
volid => "$sid:snippets/". basename($fn),
|
||||
format => 'snippet',
|
||||
size => -s $fn,
|
||||
size => -s $fn // 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -867,7 +867,7 @@ sub template_list {
|
||||
$info = { volid => "$sid:backup/$1", format => $2 };
|
||||
}
|
||||
|
||||
$info->{size} = -s $fn;
|
||||
$info->{size} = -s $fn // 0;
|
||||
|
||||
push @{$res->{$sid}}, $info;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user