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 64B021FF137 for ; Tue, 17 Mar 2026 16:09:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E713311D65; Tue, 17 Mar 2026 16:09:54 +0100 (CET) Message-ID: Date: Tue, 17 Mar 2026 16:09:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup v3] fix #7382: correctly anchor nested paths for include/exclude patterns. To: Christian Ebner , pbs-devel@lists.proxmox.com References: <20260316142342.67535-1-m.federanko@proxmox.com> <4cff6bc2-1fcb-48aa-9597-e89d12505d04@proxmox.com> Content-Language: en-US From: Manuel Federanko In-Reply-To: <4cff6bc2-1fcb-48aa-9597-e89d12505d04@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773760119355 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.334 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JWI3VUMBDMAQZUNIJNPHUXRHBJE6HCMN X-Message-ID-Hash: JWI3VUMBDMAQZUNIJNPHUXRHBJE6HCMN X-MailFrom: m.federanko@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 >> 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.