mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-08-17 06:46:05 +00:00
Fix extracting over symlinks with --dereference
Extraction over symlink to a directory was broken in 75b03fdff4.
See https://savannah.gnu.org/bugs/index.php?68368
* src/tar.c (decode_options): Don't enable RESOLVE_BENEATH mode
if --dereference is given.
* tests/extrac33.at: New test.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Likewise.
* tests/extrac13.at: Add a keyword.
* tests/extrac31.at: Remove --absolute-names keyword: that option
is never used in the testcase. Add CVE-2025-45582 keyword instead.
This commit is contained in:
@@ -2712,7 +2712,7 @@ decode_options (int argc, char **argv)
|
||||
#endif
|
||||
open_searchdir_how.flags = (search_flags | nofollow_flag
|
||||
| O_BINARY | O_CLOEXEC | O_DIRECTORY);
|
||||
if (!absolute_names_option
|
||||
if (!absolute_names_option && !dereference_option
|
||||
&& (subcommand_option == EXTRACT_SUBCOMMAND
|
||||
|| subcommand_option == DIFF_SUBCOMMAND))
|
||||
open_searchdir_how.resolve = RESOLVE_BENEATH;
|
||||
|
||||
Reference in New Issue
Block a user