mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-04-26 03:20:40 +00:00
Fix wrong fd in restore_parent_fd fallback path
Use fstat(origfd) instead of fstat(parentfd) when verifying the alternatively-opened directory; parentfd is invalid in this branch. Copyright-paperwork-exempt: yes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user