public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Herzig <d.herzig@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH storage v2] dirplugin: fix #3986: check for trailing slashes
Date: Fri, 22 Nov 2024 17:35:26 +0100	[thread overview]
Message-ID: <87serjz0oh.fsf@proxmox.com> (raw)
In-Reply-To: <c52b3792-00d4-45b9-860b-5e071573cd3c@proxmox.com> (Thomas Lamprecht's message of "Fri, 22 Nov 2024 15:52:09 +0100")

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


      reply	other threads:[~2024-11-22 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 13:13 Daniel Herzig
2024-11-22 14:52 ` Thomas Lamprecht
2024-11-22 16:35   ` Daniel Herzig [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87serjz0oh.fsf@proxmox.com \
    --to=d.herzig@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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