From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 332D220EC98 for ; Tue, 30 Apr 2024 09:53:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2389A1DAF0; Tue, 30 Apr 2024 09:53:47 +0200 (CEST) From: Wolfgang Bumiller To: pve-devel@lists.proxmox.com Date: Tue, 30 Apr 2024 09:53:43 +0200 Message-Id: <20240430075343.39367-2-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430075343.39367-1-w.bumiller@proxmox.com> References: <20240430075343.39367-1-w.bumiller@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.086 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. [plugin.pm] Subject: [pve-devel] [PATCH storage 2/2] fixup error messages in file_size_info 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The assignment happens before the 'die', so the error message would always contain 'undef'. Signed-off-by: Wolfgang Bumiller --- src/PVE/Storage/Plugin.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm index 683190b..b5a54c1 100644 --- a/src/PVE/Storage/Plugin.pm +++ b/src/PVE/Storage/Plugin.pm @@ -974,13 +974,16 @@ sub file_size_info { my ($size, $format, $used, $parent) = $info->@{qw(virtual-size format actual-size backing-filename)}; - ($size) = ($size =~ /^(\d+)$/) or die "size '$size' not an integer\n"; # untaint + ($size) = ($size =~ /^(\d+)$/); # untaint + die "size '$size' not an integer\n" if !defined($size); # coerce back from string $size = int($size); - ($used) = ($used =~ /^(\d+)$/) or die "used '$used' not an integer\n"; # untaint + ($used) = ($used =~ /^(\d+)$/); # untaint + die "used '$used' not an integer\n" if !defined($used); # coerce back from string $used = int($used); - ($format) = ($format =~ /^(\S+)$/) or die "format '$format' includes whitespace\n"; # untaint + ($format) = ($format =~ /^(\S+)$/); # untaint + die "format '$format' includes whitespace\n" if !defined($format); if (defined($parent)) { ($parent) = ($parent =~ /^(\S+)$/); # untaint } -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel