tar: fix bug with -C and extracting directories

Problem reported by Denis Excoffier in
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.

* src/extract.c (extract_dir): Use mkdirat, not mkdir.
* tests/extrac16.at: New file, to test for this bug.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.

This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist.  Run make ChangeLog if you wish to create it earlier.
This commit is contained in:
Paul Eggert
2010-10-25 20:21:06 -07:00
parent 983113b140
commit acb77ac5bd
4 changed files with 39 additions and 1 deletions
+1 -1
View File
@@ -777,7 +777,7 @@ extract_dir (char *file_name, int typeflag)
for (;;)
{
status = mkdir (file_name, mode);
status = mkdirat (chdir_fd, file_name, mode);
if (status == 0)
{
current_mode = mode & ~ current_umask;