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 98F79786ED for ; Tue, 28 Jun 2022 13:53:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8A112AB98 for ; Tue, 28 Jun 2022 13:52:52 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 75631AB8D for ; Tue, 28 Jun 2022 13:52:51 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 48038436B4 for ; Tue, 28 Jun 2022 13:52:51 +0200 (CEST) Date: Tue, 28 Jun 2022 13:52:50 +0200 From: Wolfgang Bumiller To: Dominik Csapak Cc: pbs-devel@lists.proxmox.com Message-ID: <20220628115250.whm4abuv4wh5ybr7@casey.proxmox.com> References: <20220628111318.2648586-1-d.csapak@proxmox.com> <20220628111318.2648586-4-d.csapak@proxmox.com> <20220628114923.lrhsdhmq2mckm22r@casey.proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220628114923.lrhsdhmq2mckm22r@casey.proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.302 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [hierarchy.rs] Subject: Re: [pbs-devel] [PATCH proxmox-backup 2/2] partially fix #2915: 'stat' in case ReadDirEntry does not contain type 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: Tue, 28 Jun 2022 11:53:22 -0000 On Tue, Jun 28, 2022 at 01:49:23PM +0200, Wolfgang Bumiller wrote: > On Tue, Jun 28, 2022 at 01:13:18PM +0200, Dominik Csapak wrote: > > diff --git a/pbs-datastore/src/hierarchy.rs b/pbs-datastore/src/hierarchy.rs > > index d5007b07..a97a1d2a 100644 > > --- a/pbs-datastore/src/hierarchy.rs > > +++ b/pbs-datastore/src/hierarchy.rs > > @@ -9,6 +9,16 @@ use pbs_api_types::{BackupNamespace, BackupType, BACKUP_DATE_REGEX, BACKUP_ID_RE > > use crate::backup_info::{BackupDir, BackupGroup}; > > use crate::DataStore; > > > > +fn dir_entry_is_path(entry: &proxmox_sys::fs::ReadDirEntry) -> Result { > > + let stat = nix::sys::stat::fstatat( > > + entry.parent_fd(), > > + entry.file_name(), > > + nix::fcntl::AtFlags::AT_SYMLINK_NOFOLLOW, > > + )?; > > + let is_dir = stat.st_mode & libc::S_IFDIR > 0; > > Should be `(stat.st_mode & libc::S_IFMT) != libc::S_IFDIR`. I meant `==` here ;-)