From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
by lore.proxmox.com (Postfix) with ESMTPS id 6BD8C1FF16F
for <inbox@lore.proxmox.com>; Fri, 15 Nov 2024 12:47:50 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
by firstgate.proxmox.com (Proxmox) with ESMTP id 49D7D11D04;
Fri, 15 Nov 2024 12:47:51 +0100 (CET)
Message-ID: <6ba61d41-2ea3-406e-baff-99d7a3b2f8f6@proxmox.com>
Date: Fri, 15 Nov 2024 12:47:47 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird Beta
To: Fiona Ebner <f.ebner@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20241114093226.814530-1-d.csapak@proxmox.com>
<20241114093226.814530-3-d.csapak@proxmox.com>
<3d2ed5bd-e00c-4452-a60e-eb7a8cbf8ce1@proxmox.com>
Content-Language: en-US
From: Dominik Csapak <d.csapak@proxmox.com>
In-Reply-To: <3d2ed5bd-e00c-4452-a60e-eb7a8cbf8ce1@proxmox.com>
X-SPAM-LEVEL: Spam detection results: 0
AWL 0.016 Adjusted score from AWL reputation of From: address
BAYES_00 -1.9 Bayes spam probability is 0 to 1%
DMARC_MISSING 0.1 Missing DMARC policy
KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
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. [ovf.pm]
Subject: Re: [pve-devel] [PATCH storage v5 02/12] plugin: dir: implement
import content type
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>,
<mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>,
<mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>
On 11/15/24 12:16, Fiona Ebner wrote:
> On 14.11.24 10:32 AM, Dominik Csapak wrote:
>> in DirPlugin and not Plugin (because of cyclic dependency of
>> Plugin -> OVF -> Storage -> Plugin otherwise)
>>
>> only ovf is currently supported (though ova will be shown in import
>> listing), expects the files to not be in a subdir, and adjacent to the
>> ovf file.
>>
>> listed will be all ovf/qcow2/raw/vmdk files.
>> ovf because it can be imported, and the rest because they can be used
>> in the 'import-from' part of qemu-server.
>>
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>
> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
>
>> diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm
>> index 3950289..29dfaad 100644
>> --- a/src/PVE/GuestImport/OVF.pm
>> +++ b/src/PVE/GuestImport/OVF.pm
>> @@ -221,6 +221,8 @@ ovf:Item[rasd:InstanceID='%s']/rasd:ResourceType", $controller_id);
>> }
>>
>> ($backing_file_path) = $backing_file_path =~ m|^(/.*)|; # untaint
>> + ($filepath) = $filepath =~ m|^(${PVE::Storage::SAFE_CHAR_CLASS_RE}+)$|; # untaint & check no sub/parent dirs
>
> Nit: you could have ".." or "." by itself, but I guess those are
> unproblematic?
you're right for this patch, that should be checked,
but this check get's changed in a later patch
(ovf: improve and simplify path checking code)
i can fix it here too and rebase, not sure if it's necesary?
>
>> + die "invalid path\n" if !$filepath;
>>
>> my $virtual_size = PVE::Storage::file_size_info($backing_file_path);
>> die "error parsing $backing_file_path, cannot determine file size\n"
>
> ---snip---
>
>> +
>> + my ($vtype, $name, undef, undef, undef, undef, $fmt) = $class->parse_volname($volname);
>> + die "invalid content type '$vtype'\n" if $vtype ne 'import';
>> + die "invalid format\n" if $fmt ne 'ova' && $fmt ne 'ovf';
>
> The $IMPORT_EXT_RE_1 regex doesn't include 'ova' anymore. Is it still
> wanted here?
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel