From 8abb30ee5eb62135ef7547a1ab815f5fd4691e20 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Thu, 7 Nov 2024 21:08:34 +0200 Subject: [PATCH] Fix file mapping doesn't affect xstat --- changelog.d/+remap-dont-affect.fixed.md | 1 + mirrord/layer/src/file/ops.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelog.d/+remap-dont-affect.fixed.md diff --git a/changelog.d/+remap-dont-affect.fixed.md b/changelog.d/+remap-dont-affect.fixed.md new file mode 100644 index 00000000000..f3bdfb79931 --- /dev/null +++ b/changelog.d/+remap-dont-affect.fixed.md @@ -0,0 +1 @@ +Fix file mapping doesn't affect xstat diff --git a/mirrord/layer/src/file/ops.rs b/mirrord/layer/src/file/ops.rs index 3d6a598606b..352c570257c 100644 --- a/mirrord/layer/src/file/ops.rs +++ b/mirrord/layer/src/file/ops.rs @@ -437,12 +437,13 @@ pub(crate) fn xstat( let (path, fd) = match (rawish_path, fd) { // fstatat (Some(path), Some(fd)) => { - let path = path?; + let mut path = path?; let fd = { if fd == AT_FDCWD { check_relative_paths!(path); - ensure_not_ignored!(remap_path!(path.clone()), false); + path = remap_path!(path); + ensure_not_ignored!(path, false); None } else { Some(get_remote_fd(fd)?)