]> git.ipfire.org Git - thirdparty/tar.git/commit
Fix the --no-overwrite-dir option
authorSergey Poznyakoff <gray@gnu.org>
Sat, 8 Feb 2020 11:01:47 +0000 (13:01 +0200)
committerSergey Poznyakoff <gray@gnu.org>
Sat, 8 Feb 2020 11:08:20 +0000 (13:08 +0200)
commit14d8fc718f0c872274b90991ee634b0cd8e1a6f0
treeeaaaec66bc7609724e9a5d9ac0d57835550b9355
parent883cc555df870e45599fd5ed951843c332fcdafc
Fix the --no-overwrite-dir option

Given this option, tar failed to preserve permissions of empty directories
and to create files under directories owned by the current user that did
not have the S_IWUSR bit set.

* src/extract.c (fd_chmod): Rename to fd_i_chmod.
(fd_chmod): New function.
(safe_dir_mode): New function.
(extract_dir): Special handling for existing directories in
--no-overwrite-dir mode.
* tests/extrac23.at: New file.
* tests/Makefile.am: Add new test case.
* tests/testsuite.at: Likewise.
src/extract.c
tests/Makefile.am
tests/extrac23.at [new file with mode: 0644]
tests/testsuite.at