aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-04 16:54:39 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-04 16:54:39 +0000
commitc329f78971157e037b4d8d126279864e99bf213c (patch)
tree17c684a4f3a042a980cf55b218ab017868a3d40a /tar.c
parentf5f86b0a21aa1af4bd8fdbbeeef23700cec22bb6 (diff)
downloadbusybox-w32-c329f78971157e037b4d8d126279864e99bf213c.tar.gz
busybox-w32-c329f78971157e037b4d8d126279864e99bf213c.tar.bz2
busybox-w32-c329f78971157e037b4d8d126279864e99bf213c.zip
Revert the patch from Konstantin Boldyshev <konst@linuxassembly.org> to never
change permissions on existing directories. This behavior is contrary to SUSv2 and contrary to GNU tar. Thanks to Matt Kraai for pointing this out. I should have been much more careful about accepting such a patch. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2789 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tar.c b/tar.c
index 9e1270cca..f31859e33 100644
--- a/tar.c
+++ b/tar.c
@@ -382,8 +382,6 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
382static int 382static int
383tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag) 383tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag)
384{ 384{
385 int result;
386
387 if (extractFlag==FALSE || tostdoutFlag==TRUE) 385 if (extractFlag==FALSE || tostdoutFlag==TRUE)
388 return( TRUE); 386 return( TRUE);
389 387
@@ -394,15 +392,12 @@ tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag)
394 /* make the final component, just in case it was 392 /* make the final component, just in case it was
395 * omitted by create_path() (which will skip the 393 * omitted by create_path() (which will skip the
396 * directory if it doesn't have a terminating '/') */ 394 * directory if it doesn't have a terminating '/') */
397 result = mkdir(header->name, header->mode); 395 if (mkdir(header->name, header->mode) < 0 && errno != EEXIST) {
398 /* Don't fix permissions on pre-existing directories */
399 if (result == 0) {
400 fixUpPermissions(header);
401 } else if (result < 0 && errno != EEXIST) {
402 perror_msg("%s", header->name); 396 perror_msg("%s", header->name);
403 return FALSE; 397 return FALSE;
404 } 398 }
405 399
400 fixUpPermissions(header);
406 return( TRUE); 401 return( TRUE);
407} 402}
408 403