tar: fix race condition

Problem reported by James Abbatiello in:
https://lists.gnu.org/r/bug-tar/2022-03/msg00000.html
* src/extract.c (make_directories): Do not assume that when
mkdirat fails with errno == EEXIST that there is an existing file
that can be statted.  It could be a dangling symlink.  Instead,
wait until the end and stat it.
This commit is contained in:
Paul Eggert
2022-06-09 22:09:34 -07:00
parent 7a37621e5b
commit 79a442d7b0
2 changed files with 43 additions and 23 deletions

5
NEWS
View File

@@ -1,4 +1,4 @@
GNU tar NEWS - User visible changes. 2022-06-09
GNU tar NEWS - User visible changes. 2022-06-10
Please send GNU tar bug reports to <bug-tar@gnu.org>
version 1.34.90 (git)
@@ -28,6 +28,9 @@ version 1.34.90 (git)
** Fix --atime-preserve=replace to not fail if there was no need to replace,
either because we did not read the file, or the atime did not change.
** Fix race when creating a parent directory while another process is
also doing so.
** Fix handling of prefix keywords not followed by "." in pax headers.
** Fix handling of out-of-range sparse entries in pax headers.