public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage 1/2] don't bail on whitespaces in backing devices
@ 2024-04-30  7:53 Wolfgang Bumiller
  2024-04-30  7:53 ` [pve-devel] [PATCH storage 2/2] fixup error messages in file_size_info Wolfgang Bumiller
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wolfgang Bumiller @ 2024-04-30  7:53 UTC (permalink / raw)
  To: pve-devel

This prevents importing from vmdks with whitespaces in file names.
Further, some operations that include file sizes (like listing disks)
would potentially fail entirely if a custom disk with a badly name
backing device exists in a VM images directory since they don't expect
this. Specifically, since we don't necessarily know the actual naming
scheme of the current storage in the plain Plugin.pm version, we don't
check the full name anyway, so why bother with whitespaces...

See-also: https://forum.proxmox.com/threads/new-import-wizard-available-for-migrating-vmware-esxi-based-virtual-machines.144023/page-16#post-658697
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 src/PVE/Storage/Plugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index 22a9729..683190b 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -982,7 +982,7 @@ sub file_size_info {
     $used = int($used);
     ($format) = ($format =~ /^(\S+)$/) or die "format '$format' includes whitespace\n"; # untaint
     if (defined($parent)) {
-	($parent) = ($parent =~ /^(\S+)$/) or die "parent '$parent' includes whitespace\n"; # untaint
+	($parent) = ($parent =~ /^(\S+)$/); # untaint
     }
     return wantarray ? ($size, $format, $used, $parent, $st->ctime) : $size;
 }
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-30  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30  7:53 [pve-devel] [PATCH storage 1/2] don't bail on whitespaces in backing devices Wolfgang Bumiller
2024-04-30  7:53 ` [pve-devel] [PATCH storage 2/2] fixup error messages in file_size_info Wolfgang Bumiller
2024-04-30  8:14 ` [pve-devel] [PATCH storage 1/2] don't bail on whitespaces in backing devices Fiona Ebner
2024-04-30  8:38   ` Wolfgang Bumiller
2024-04-30  9:13     ` Fiona Ebner
2024-04-30  9:23       ` Wolfgang Bumiller
2024-04-30  9:45       ` Dominik Csapak
2024-04-30  8:22 ` [pve-devel] applied-series: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal