Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
tar
bsc1200657.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc1200657.patch of Package tar
From 79d1ac38c19faad64f0e993180bf1ad27f217072 Mon Sep 17 00:00:00 2001 From: James Abbatiello <abbeyj@gmail.com> Date: Fri, 10 Jun 2022 18:25:13 -0700 Subject: tar: fix race condition Problem reported in: https://lists.gnu.org/r/bug-tar/2022-03/msg00000.html * src/extract.c (make_directories): Retry the file creation as long as the directory exists, regardless of whether tar itself created the directory. Copyright-paperwork-exempt: Yes --- src/extract.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) Index: tar-1.27.1/src/extract.c =================================================================== --- tar-1.27.1.orig/src/extract.c +++ tar-1.27.1/src/extract.c @@ -539,10 +539,9 @@ repair_delayed_set_stat (char const *dir /* After a file/link/directory creation has failed due to ENOENT, create all required directories. Return zero if all the required - directories were created, nonzero (issuing a diagnostic) otherwise. - Set *INTERDIR_MADE if at least one directory was created. */ + directories were created, nonzero (issuing a diagnostic) otherwise. */ static int -make_directories (char *file_name, bool *interdir_made) +make_directories (char *file_name) { char *cursor0 = file_name + FILE_SYSTEM_PREFIX_LEN (file_name); char *cursor; /* points into the file name */ @@ -586,7 +585,6 @@ make_directories (char *file_name, bool desired_mode, AT_SYMLINK_NOFOLLOW); print_for_mkdir (file_name, cursor - file_name, desired_mode); - *interdir_made = true; parent_end = NULL; } else @@ -743,8 +741,11 @@ maybe_recoverable (char *file_name, bool case ENOENT: /* Attempt creating missing intermediate directories. */ - if (make_directories (file_name, interdir_made) == 0) - return RECOVER_OK; + if (make_directories (file_name) == 0) + { + *interdir_made = true; + return RECOVER_OK; + } break; default: @@ -1765,12 +1766,11 @@ rename_directory (char *src, char *dst) if (renameat (chdir_fd, src, chdir_fd, dst) != 0) { int e = errno; - bool interdir_made; switch (e) { case ENOENT: - if (make_directories (dst, &interdir_made) == 0) + if (make_directories (dst) == 0) { if (renameat (chdir_fd, src, chdir_fd, dst) == 0) return true;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor