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 [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B826F1FF164 for <inbox@lore.proxmox.com>; Fri, 22 Nov 2024 17:35:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F116D177F8; Fri, 22 Nov 2024 17:35:30 +0100 (CET) From: Daniel Herzig <d.herzig@proxmox.com> To: Thomas Lamprecht <t.lamprecht@proxmox.com> In-Reply-To: <c52b3792-00d4-45b9-860b-5e071573cd3c@proxmox.com> (Thomas Lamprecht's message of "Fri, 22 Nov 2024 15:52:09 +0100") References: <20241122131305.59062-1-d.herzig@proxmox.com> <c52b3792-00d4-45b9-860b-5e071573cd3c@proxmox.com> Date: Fri, 22 Nov 2024 17:35:26 +0100 Message-ID: <87serjz0oh.fsf@proxmox.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.057 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 Subject: Re: [pve-devel] [PATCH storage v2] dirplugin: fix #3986: check for trailing slashes 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> Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> Thomas Lamprecht <t.lamprecht@proxmox.com> writes: > Am 22.11.24 um 14:13 schrieb Daniel Herzig: >> diff --git a/src/PVE/Storage/DirPlugin.pm b/src/PVE/Storage/DirPlugin.pm >> index fb23e0a..c72c321 100644 >> --- a/src/PVE/Storage/DirPlugin.pm >> +++ b/src/PVE/Storage/DirPlugin.pm >> @@ -245,6 +245,8 @@ sub check_config { >> if ($opts->{path} !~ m|^/[-/a-zA-Z0-9_.@]+$|) { >> die "illegal path for directory storage: $opts->{path}\n"; >> } >> + # remove trailing slashes from path >> + $opts->{path} =~ s|(.*[^/])/+$|$1|; > > If we want to use the always available File::Spec module, like Max wanted to > in a recent series, this could be changed to > > $opts->{path} = File::Spec->canonpath($opts->{path}); > Thanks! Well, this would look the cleanest to me, I did not have this module on my radar yet. Will use it in v3! >> return $opts; >> } >> _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel