From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 22277610AA for ; Tue, 20 Oct 2020 09:14:10 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 11476AF4D for ; Tue, 20 Oct 2020 09:13:40 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 5686DAF43 for ; Tue, 20 Oct 2020 09:13:39 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1E8D245DC7 for ; Tue, 20 Oct 2020 09:13:39 +0200 (CEST) Date: Tue, 20 Oct 2020 09:13:32 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20201019141525.5480-1-d.csapak@proxmox.com> In-Reply-To: <20201019141525.5480-1-d.csapak@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1603177890.kgrk7q62n7.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [vzdump.pm, proxmox.com] Subject: Re: [pve-devel] [PATCH manager] partially fix #3056: namespace vzdump tmpdir with vmid X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 07:14:10 -0000 On October 19, 2020 4:15 pm, Dominik Csapak wrote: > this fixes an issue where a rogue running backup would upload the vm > config of a later backup in a backup job >=20 > instead now that directory gets deleted and the config is not > available anymore >=20 > we cannot really keep those directories around until the end of the > backup job, since we temporarily save ct contents there, which could get > large very fast Wolfang made the suggestion yesterday that we could get Qemu to open it=20 directly after being passed the path via QMP, that way vzdump can delete=20 it but Qemu still has a reference to the old (correct) file. might be a=20 good additional followup even with this change? > Signed-off-by: Dominik Csapak > --- > PVE/VZDump.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm > index 542228d6..cdcb658f 100644 > --- a/PVE/VZDump.pm > +++ b/PVE/VZDump.pm > @@ -769,10 +769,11 @@ sub exec_backup_task { > =20 > $task->{vmtype} =3D $vmtype; > =20 > + my $pid =3D $$; > if ($opts->{tmpdir}) { > - $task->{tmpdir} =3D "$opts->{tmpdir}/vzdumptmp$$"; > + $task->{tmpdir} =3D "$opts->{tmpdir}/vzdumptmp${pid}_$vmid/"; > } elsif ($self->{opts}->{pbs}) { > - $task->{tmpdir} =3D "/var/tmp/vzdumptmp$$"; #fixme > + $task->{tmpdir} =3D "/var/tmp/vzdumptmp${pid}_$vmid"; > } else { > # dumpdir is posix? then use it as temporary dir > my $info =3D get_mount_info($opts->{dumpdir}); > @@ -780,7 +781,7 @@ sub exec_backup_task { > grep ($_ eq $info->{fstype}, @posix_filesystems)) { > $task->{tmpdir} =3D "$opts->{dumpdir}/$basename.tmp"; > } else { > - $task->{tmpdir} =3D "/var/tmp/vzdumptmp$$"; > + $task->{tmpdir} =3D "/var/tmp/vzdumptmp${pid}_$vmid"; > debugmsg ('info', "filesystem type on dumpdir is '$info->{fstype}' -" = . > "using $task->{tmpdir} for temporary files", $logfd); > } > --=20 > 2.20.1 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20 =