From: Dietmar Maurer Date: Mon, 4 Mar 2013 08:00:27 +0000 (+0100) Subject: file upload: fix race condition X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d6c9dc34afc88b1967a8606aae22e20858da5aff;p=pve-storage.git file upload: fix race condition bump version to 2.3-6 --- diff --git a/Makefile b/Makefile index 3c04f4f..f082d56 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.3 VERSION=2.3 PACKAGE=libpve-storage-perl -PKGREL=5 +PKGREL=6 DESTDIR= PREFIX=/usr diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm index fda54bb..0922229 100644 --- a/PVE/API2/Storage/Status.pm +++ b/PVE/API2/Storage/Status.pm @@ -378,7 +378,14 @@ __PACKAGE__->register_method ({ print "finished file import successfully\n"; }; - return $rpcenv->fork_worker('imgcopy', undef, $user, $worker); + my $upid = $rpcenv->fork_worker('imgcopy', undef, $user, $worker); + + # apache removes the temporary file on return, so we need + # to wait here to make sure the worker process starts and + # opens the file before it gets removed. + sleep(1); + + return $upid; }}); 1; diff --git a/changelog.Debian b/changelog.Debian index 2cecccb..9993a33 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,9 @@ +libpve-storage-perl (2.3-6) unstable; urgency=low + + * file upload: fix race condition + + -- Proxmox Support Team Mon, 04 Mar 2013 09:00:05 +0100 + libpve-storage-perl (2.3-5) unstable; urgency=low * Allow removal of backup volumes if the user has