From: Weixie Cui <[email protected]>

Use fstat(origfd) instead of fstat(parentfd) when verifying the
alternatively-opened directory; parentfd is invalid in this branch.
---
 src/create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/create.c b/src/create.c
index a962ed75..71f183a5 100644
--- a/src/create.c
+++ b/src/create.c
@@ -1588,7 +1588,7 @@ restore_parent_fd (struct tar_stat_info const *st)
                        : openat (f.fd, f.base, open_searchdir_how.flags));
          if (0 <= origfd)
            {
-             if (fstat (parentfd, &parentstat) < 0
+             if (fstat (origfd, &parentstat) < 0
                  || !psame_inode (&parent->stat, &parentstat))
                close (origfd);
              else
-- 
2.39.5 (Apple Git-154)


Reply via email to