tar: -x -C symlink fix

* src/misc.c (chdir_do): Don't use O_NOFOLLOW when opening the
argument to -C.  This is for consistency with "tar -c -C FOO", and
matches the new documentation.
* tests/extrac14.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.
This commit is contained in:
Paul Eggert
2010-09-24 13:13:47 -07:00
parent 14efeb9f95
commit c5c196310e
4 changed files with 40 additions and 1 deletions
+2 -1
View File
@@ -736,7 +736,8 @@ chdir_do (int i)
{
if (! IS_ABSOLUTE_FILE_NAME (curr->name))
chdir_do (i - 1);
fd = openat (chdir_fd, curr->name, open_searchdir_flags);
fd = openat (chdir_fd, curr->name,
open_searchdir_flags & ~ O_NOFOLLOW);
if (fd < 0)
open_fatal (curr->name);