mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-14 09:25:46 +00:00
Revert "fix #4380: stat() is run when file is executed"
this actually affected the matcher's ability to differentiate between directory
and file patterns, and the alternative would require matching patterns twice
for full coverage, so let's try a different approach altogether.
This reverts commit c8ed10095d
.
This commit is contained in:
parent
c8ed10095d
commit
7d8d4061c5
@ -434,15 +434,6 @@ impl Archiver {
|
|||||||
assert_single_path_component(os_file_name)?;
|
assert_single_path_component(os_file_name)?;
|
||||||
let full_path = self.path.join(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)
|
|
||||||
== Some(MatchType::Exclude)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let stat = match nix::sys::stat::fstatat(
|
let stat = match nix::sys::stat::fstatat(
|
||||||
dir_fd,
|
dir_fd,
|
||||||
file_name.as_c_str(),
|
file_name.as_c_str(),
|
||||||
@ -453,6 +444,15 @@ impl Archiver {
|
|||||||
Err(err) => return Err(err).context(format!("stat failed on {:?}", full_path)),
|
Err(err) => return Err(err).context(format!("stat failed on {:?}", full_path)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let match_path = PathBuf::from("/").join(full_path.clone());
|
||||||
|
if self
|
||||||
|
.patterns
|
||||||
|
.matches(match_path.as_os_str().as_bytes(), Some(stat.st_mode))
|
||||||
|
== Some(MatchType::Exclude)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
self.entry_counter += 1;
|
self.entry_counter += 1;
|
||||||
if self.entry_counter > self.entry_limit {
|
if self.entry_counter > self.entry_limit {
|
||||||
bail!(
|
bail!(
|
||||||
|
Loading…
Reference in New Issue
Block a user