mirror of
https://git.proxmox.com/git/pve-guest-common
synced 2025-04-28 19:26:51 +00:00
storage tunnel: check just-imported image files
remote migration requires elevated privileges already and can thus only be triggered by trusted sources, but an additional safeguard of checking the image for external references doesn't hurt. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
ef051db594
commit
16ff09f72c
@ -280,6 +280,14 @@ sub handle_query_disk_import {
|
||||
delete $state->{sockets}->{$unix};
|
||||
delete $state->{disk_import};
|
||||
$state->{cleanup}->{volumes}->{$volid} = 1;
|
||||
my $cfg = PVE::Storage::config();
|
||||
my ($storage, $volume) = PVE::Storage::parse_volume_id($volid);
|
||||
my $scfg = PVE::Storage::storage_config($cfg, $storage);
|
||||
# check imported image for bad references
|
||||
if ($scfg->{path}) {
|
||||
my $path = PVE::Storage::path($cfg, $volid);
|
||||
PVE::Storage::file_size_info($path, undef, 1);
|
||||
}
|
||||
return {
|
||||
status => "complete",
|
||||
volid => $volid,
|
||||
|
Loading…
Reference in New Issue
Block a user