]> Dogcows Code - chaz/tar/commitdiff
tar: use more-accurate diagnostic when intermediate mkdir fails
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 16 Oct 2010 05:26:14 +0000 (22:26 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 16 Oct 2010 05:26:43 +0000 (22:26 -0700)
Without this change, if tar tried to extract a file A/B/C, noticed
that A/B didn't exist, attempted to mkdir A/B, and the mkdir
failed, it did not diagnose the mkdir failure, but simply reported
the failure to open A/B/C.  This sometimes led to confusion
because it wasn't clear what tar was trying to do, in particular
that tar tried to mkdir A/B.  With this patch, tar issues two
diagnostics in this case: one for A/B and the other for A/B/C.
Problem reported by Hauke Laging in
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
* gnulib.modules: Remove faccessat.
* src/extract.c (make_directories): New arg INTERDIR_MADE.
Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
as opposed to nonzero iff some directory was created.  All callers
changed.  Simplify the code when mkdir fails, by checking whether
the desired file exists unless errno==EEXIST: this is more robust.
* tests/extrac15.at: New test, to check this.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.


No differences found
This page took 0.022998 seconds and 4 git commands to generate.