diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-04 16:54:39 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-04 16:54:39 +0000 |
commit | c329f78971157e037b4d8d126279864e99bf213c (patch) | |
tree | 17c684a4f3a042a980cf55b218ab017868a3d40a /tar.c | |
parent | f5f86b0a21aa1af4bd8fdbbeeef23700cec22bb6 (diff) | |
download | busybox-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.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -382,8 +382,6 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
382 | static int | 382 | static int |
383 | tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag) | 383 | tarExtractDirectory(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 | ||