← Commit list

e9b3321b9

Denis Vlasenko
Denis Vlasenko
2007-09-24
FAILED Duration: 15s

Subject

tar: add a comment about previous subtle fix

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/tar.c+7 -6
@@ -386,6 +386,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
const char *header_name;
int inputFileFd = -1;
+ /* Strip leading '/' (must be before memorizing hardlink's name) */
header_name = fileName;
while (header_name[0] == '/') {
static smallint warned;
@@ -400,6 +401,12 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
if (header_name[0] == '\0')
return TRUE;
+ /* It is against the rules to archive a socket */
+ if (S_ISSOCK(statbuf->st_mode)) {
+ bb_error_msg("%s: socket ignored", fileName);
+ return TRUE;
+ }
+
/*
* Check to see if we are dealing with a hard link.
* If so -
@@ -414,12 +421,6 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
addHardLinkInfo(&tbInfo->hlInfoHead, statbuf, header_name);
}
- /* It is against the rules to archive a socket */
- if (S_ISSOCK(statbuf->st_mode)) {
- bb_error_msg("%s: socket ignored", fileName);
- return TRUE;
- }
-
/* It is a bad idea to store the archive we are in the process of creating,
* so check the device and inode to be sure that this particular file isn't
* the new tarball */