diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-24 19:32:53 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-24 19:32:53 +0000 |
commit | e9b3321b9f4c85acd13db6fc5a6de821e597b6f9 (patch) | |
tree | 1dc1c93515fceb76f45c2f08ee307afda03f330b /archival | |
parent | 86e0a22ec602f929b1f3b1bd7d7b2f41cc86638c (diff) | |
download | busybox-w32-e9b3321b9f4c85acd13db6fc5a6de821e597b6f9.tar.gz busybox-w32-e9b3321b9f4c85acd13db6fc5a6de821e597b6f9.tar.bz2 busybox-w32-e9b3321b9f4c85acd13db6fc5a6de821e597b6f9.zip |
tar: add a comment about previous subtle fix
Diffstat (limited to 'archival')
-rw-r--r-- | archival/tar.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/archival/tar.c b/archival/tar.c index bbda52d14..18b626701 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -386,6 +386,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, | |||
386 | const char *header_name; | 386 | const char *header_name; |
387 | int inputFileFd = -1; | 387 | int inputFileFd = -1; |
388 | 388 | ||
389 | /* Strip leading '/' (must be before memorizing hardlink's name) */ | ||
389 | header_name = fileName; | 390 | header_name = fileName; |
390 | while (header_name[0] == '/') { | 391 | while (header_name[0] == '/') { |
391 | static smallint warned; | 392 | static smallint warned; |
@@ -400,6 +401,12 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, | |||
400 | if (header_name[0] == '\0') | 401 | if (header_name[0] == '\0') |
401 | return TRUE; | 402 | return TRUE; |
402 | 403 | ||
404 | /* It is against the rules to archive a socket */ | ||
405 | if (S_ISSOCK(statbuf->st_mode)) { | ||
406 | bb_error_msg("%s: socket ignored", fileName); | ||
407 | return TRUE; | ||
408 | } | ||
409 | |||
403 | /* | 410 | /* |
404 | * Check to see if we are dealing with a hard link. | 411 | * Check to see if we are dealing with a hard link. |
405 | * If so - | 412 | * If so - |
@@ -414,12 +421,6 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, | |||
414 | addHardLinkInfo(&tbInfo->hlInfoHead, statbuf, header_name); | 421 | addHardLinkInfo(&tbInfo->hlInfoHead, statbuf, header_name); |
415 | } | 422 | } |
416 | 423 | ||
417 | /* It is against the rules to archive a socket */ | ||
418 | if (S_ISSOCK(statbuf->st_mode)) { | ||
419 | bb_error_msg("%s: socket ignored", fileName); | ||
420 | return TRUE; | ||
421 | } | ||
422 | |||
423 | /* It is a bad idea to store the archive we are in the process of creating, | 424 | /* It is a bad idea to store the archive we are in the process of creating, |
424 | * so check the device and inode to be sure that this particular file isn't | 425 | * so check the device and inode to be sure that this particular file isn't |
425 | * the new tarball */ | 426 | * the new tarball */ |