From: Manuel Federanko <m.federanko@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup v3] fix #7382: correctly anchor nested paths for include/exclude patterns.
Date: Tue, 17 Mar 2026 16:09:20 +0100 [thread overview]
Message-ID: <aea1f899-5964-4d68-8bbc-f8e01330dfe4@proxmox.com> (raw)
In-Reply-To: <4cff6bc2-1fcb-48aa-9597-e89d12505d04@proxmox.com>
On 2026-03-17 4:02 PM, Christian Ebner wrote:
> On 3/16/26 3:23 PM, Manuel Federanko wrote:
>> A pattern in a subdirectory would be built by just prepending the parent
>> directory. This could break anchored patterns, which wouldn't match if
>> the parent directory didn't start with a slash.
>> Fixed this by explicitly checking if the base path starts with a slash
>> and prepending it if it does not exist.
>>
>> It worked for anchored patterns in the root backup directory because
>> here the pattern is "" + "/exclude".
>>
>> old:
>> match_path = /level0/level1/exclude
>> pattern = level0/level1/exclude
>>
>> new:
>> match_path = /level0/level1/exclude
>> pattern = /level0/level1/exclude
>>
>> Tested by creating a directory structure as described in the bug ticket
>> and verifying the behavior.
>>
>> Signed-off-by: Manuel Federanko <m.federanko@proxmox.com>
>> Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7382
>> ---
>
> Thanks a lot for the patch, looks good to me!
>
> Although one question came up during review:
>
> Will the `Archiver` path ever start with a '/' at all?
>
> As far as I could see it is set to be empty on instantiation (which is
> equal to the pxar source root), and only filenames from dir entries are
> pushed or popped from the path. So it seems the additional check for
> `!path_bytes.starts_with(b"/")` is not strictly required? Or am I
> missing it?
>
> But leaving this in place as additional check for robustness is probably
> fine.
I was considering this, but didn't want to leave it up to chance
considering further developments. Seeing as the the !path_bytes.is_empty()
is required anyways I left it in.
next prev parent reply other threads:[~2026-03-17 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 14:23 Manuel Federanko
2026-03-17 15:02 ` Christian Ebner
2026-03-17 15:09 ` Manuel Federanko [this message]
2026-03-17 15:54 ` Christian Ebner
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=aea1f899-5964-4d68-8bbc-f8e01330dfe4@proxmox.com \
--to=m.federanko@proxmox.com \
--cc=c.ebner@proxmox.com \
--cc=pbs-devel@lists.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