diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-06-09 20:51:50 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-06-09 20:51:50 +0000 |
commit | 0c6a970eb26edf7e77e7c173d478b94100969fc4 (patch) | |
tree | 2c26d1f87e2a4c9e3a47a3980a29dfa4667fb613 | |
parent | b3d235f63b11effbc88d07ec812f90dbb3f4b798 (diff) | |
download | busybox-w32-0c6a970eb26edf7e77e7c173d478b94100969fc4.tar.gz busybox-w32-0c6a970eb26edf7e77e7c173d478b94100969fc4.tar.bz2 busybox-w32-0c6a970eb26edf7e77e7c173d478b94100969fc4.zip |
* Fixed a small bug that could cause tar to emit warning messages
and not extract the first file in a directory in some cases
of nested directories. Thanks to Kevin Traas <kevin@netmaster.com>
for helping track this one down.
-Erik
-rw-r--r-- | Changelog | 4 | ||||
-rw-r--r-- | archival/tar.c | 7 | ||||
-rw-r--r-- | tar.c | 7 |
3 files changed, 14 insertions, 4 deletions
@@ -67,6 +67,10 @@ | |||
67 | Pavel Roskin | 67 | Pavel Roskin |
68 | * Syslogd will not go to background if "-n" is given. Better help | 68 | * Syslogd will not go to background if "-n" is given. Better help |
69 | and argument checking -- Pavel Roskin | 69 | and argument checking -- Pavel Roskin |
70 | * Fixed a small bug that could cause tar to emit warning messages | ||
71 | and not extract the first file in a directory in some cases | ||
72 | of nested directories. Thanks to Kevin Traas <kevin@netmaster.com> | ||
73 | for helping track this one down. | ||
70 | * More doc updates | 74 | * More doc updates |
71 | 75 | ||
72 | 76 | ||
diff --git a/archival/tar.c b/archival/tar.c index 7d440f451..86f996576 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -300,11 +300,14 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
300 | 300 | ||
301 | /* Open the file to be written, if a file is supposed to be written */ | 301 | /* Open the file to be written, if a file is supposed to be written */ |
302 | if (extractFlag==TRUE && tostdoutFlag==FALSE) { | 302 | if (extractFlag==TRUE && tostdoutFlag==FALSE) { |
303 | if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, header->mode & ~S_IFMT)) < 0) | ||
304 | errorMsg(io_error, header->name, strerror(errno)); | ||
305 | /* Create the path to the file, just in case it isn't there... | 303 | /* Create the path to the file, just in case it isn't there... |
306 | * This should not screw up path permissions or anything. */ | 304 | * This should not screw up path permissions or anything. */ |
307 | createPath(header->name, 0777); | 305 | createPath(header->name, 0777); |
306 | if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, | ||
307 | header->mode & ~S_IFMT)) < 0) { | ||
308 | errorMsg(io_error, header->name, strerror(errno)); | ||
309 | return( FALSE); | ||
310 | } | ||
308 | } | 311 | } |
309 | 312 | ||
310 | /* Write out the file, if we are supposed to be doing that */ | 313 | /* Write out the file, if we are supposed to be doing that */ |
@@ -300,11 +300,14 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
300 | 300 | ||
301 | /* Open the file to be written, if a file is supposed to be written */ | 301 | /* Open the file to be written, if a file is supposed to be written */ |
302 | if (extractFlag==TRUE && tostdoutFlag==FALSE) { | 302 | if (extractFlag==TRUE && tostdoutFlag==FALSE) { |
303 | if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, header->mode & ~S_IFMT)) < 0) | ||
304 | errorMsg(io_error, header->name, strerror(errno)); | ||
305 | /* Create the path to the file, just in case it isn't there... | 303 | /* Create the path to the file, just in case it isn't there... |
306 | * This should not screw up path permissions or anything. */ | 304 | * This should not screw up path permissions or anything. */ |
307 | createPath(header->name, 0777); | 305 | createPath(header->name, 0777); |
306 | if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, | ||
307 | header->mode & ~S_IFMT)) < 0) { | ||
308 | errorMsg(io_error, header->name, strerror(errno)); | ||
309 | return( FALSE); | ||
310 | } | ||
308 | } | 311 | } |
309 | 312 | ||
310 | /* Write out the file, if we are supposed to be doing that */ | 313 | /* Write out the file, if we are supposed to be doing that */ |