public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATH proxmox-backup] fix #4380: stat() is run when file is executed
Date: Fri, 04 Aug 2023 10:35:57 +0200	[thread overview]
Message-ID: <1691138073.b6vh7u0nd0.astroid@yuna.none> (raw)
In-Reply-To: <51bf8073-33b4-a484-10cc-0768a984bbaa@proxmox.com>

On August 4, 2023 10:20 am, Fiona Ebner wrote:
> Am 04.08.23 um 09:54 schrieb Gabriel Goller:
>> On 8/4/23 09:42, Fiona Ebner wrote:
>> 
>>> Am 03.08.23 um 17:22 schrieb Gabriel Goller:
>>>> diff --git a/pbs-client/src/pxar/create.rs
>>>> b/pbs-client/src/pxar/create.rs
>>>> index 2577cf98..c573c2a3 100644
>>>> --- a/pbs-client/src/pxar/create.rs
>>>> +++ b/pbs-client/src/pxar/create.rs
>>>> @@ -434,6 +434,15 @@ impl Archiver {
>>>>               assert_single_path_component(os_file_name)?;
>>>>               let full_path = self.path.join(os_file_name);
>>>>   +            let match_path =
>>>> PathBuf::from("/").join(full_path.clone());
>>>> +            if self
>>>> +                .patterns
>>>> +                .matches(match_path.as_os_str().as_bytes(), None)
>>> Is it fine to call matches() without the file mode in all cases? Can't
>>> it make a difference for directory matching? If it's okay, please
>>> explain why in the commit message.
>> 
>> I think so, because we get the `patterns` (at least those with
>> MatchType::Exclude) only from the `.pxarexclude` file or from the
>> command line argument `--exclude`. Both do not allow to specify the file
>> mode.
>> 
> 
> But the MatchFlag::MATCH_DIRECTORIES flag is set for the pattern with a
> trailing slash in match_list.rs's parse_pattern_do() in the pathpatterns
> create during construction. My concern is that now a file 'foo' will
> match the pattern 'foo/' when it previously didn't (but I didn't test it).

I did test (see my other reply), and reverted this for now again.
Gabriel will try the "special case readable, but inaccessible
directories" approach.

if that doesn't work out, we can either mark this as WONTFIX, switch to
coarse matching via dir entry type, or coarse matching before, and full
matching after stat..




  reply	other threads:[~2023-08-04  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 15:22 Gabriel Goller
2023-08-04  7:42 ` Fiona Ebner
     [not found]   ` <d4bf032e-42c0-a0d7-5702-07aa9e230690@proxmox.com>
2023-08-04  8:20     ` Fiona Ebner
2023-08-04  8:35       ` Fabian Grünbichler [this message]
2023-08-04  8:21   ` Fabian Grünbichler
2023-08-04  8:52     ` Fiona Ebner
2023-08-04 12:08       ` Wolfgang Bumiller
2023-08-04  7:59 ` [pbs-devel] applied: " Fabian Grünbichler

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=1691138073.b6vh7u0nd0.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=g.goller@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal