From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 0C42769203 for ; Thu, 12 Nov 2020 13:06:18 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E89BCF1D3 for ; Thu, 12 Nov 2020 13:05:47 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 1F553F1C8 for ; Thu, 12 Nov 2020 13:05:47 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D45B142155 for ; Thu, 12 Nov 2020 13:05:46 +0100 (CET) Date: Thu, 12 Nov 2020 13:05:45 +0100 From: Wolfgang Bumiller To: Fabian Ebner Cc: pbs-devel@lists.proxmox.com Message-ID: <20201112120545.23sm3ldmvzt5qcox@olga.proxmox.com> References: <20201112113806.8083-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201112113806.8083-1-f.ebner@proxmox.com> User-Agent: NeoMutt/20180716 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [create.rs, proxmox.com] Subject: [pbs-devel] applied: [PATCH proxmox-backup] pxar: avoid including archive root's exclude patterns in .pxarexclude-cli X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2020 12:06:18 -0000 applied On Thu, Nov 12, 2020 at 12:38:06PM +0100, Fabian Ebner wrote: > The patterns from the archive root's .pxarexclude file are already present in > self.patterns when encode_pxarexclude_cli is called. Pass along the number of > CLI patterns and slice accordingly. > > Suggested-By: Wolfgang Bumiller > Signed-off-by: Fabian Ebner > --- > > Follow-up for: > https://lists.proxmox.com/pipermail/pbs-devel/2020-November/001509.html > > src/pxar/create.rs | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/pxar/create.rs b/src/pxar/create.rs > index c907a8e0..cc28a79d 100644 > --- a/src/pxar/create.rs > +++ b/src/pxar/create.rs > @@ -255,7 +255,7 @@ impl<'a, 'b> Archiver<'a, 'b> { > let file_name = file_entry.name.to_bytes(); > > if is_root && file_name == b".pxarexclude-cli" { > - self.encode_pxarexclude_cli(encoder, &file_entry.name)?; > + self.encode_pxarexclude_cli(encoder, &file_entry.name, old_patterns_count)?; > continue; > } > > @@ -387,8 +387,9 @@ impl<'a, 'b> Archiver<'a, 'b> { > &mut self, > encoder: &mut Encoder, > file_name: &CStr, > + patterns_count: usize, > ) -> Result<(), Error> { > - let content = generate_pxar_excludes_cli(&self.patterns); > + let content = generate_pxar_excludes_cli(&self.patterns[..patterns_count]); > > if let Some(ref mut catalog) = self.catalog { > catalog.add_file(file_name, content.len() as u64, 0)?; > -- > 2.20.1