Revision 1.5 2006/11/08 22:22:25 twittner
- up to 1.3.1
- added BR: e2fsprogs-devel
-- added -CVE-2006-5680.patch agains entering in infinite
+- added -CVE-2006-5680.patch against entering an infinite
loop in corrupt archives
- added bsdtar package (bsdtar is included now in libarchive
sources)
Revision 1.5 2006/11/08 22:22:25 twittner
- up to 1.3.1
- added BR: e2fsprogs-devel
-- added -CVE-2006-5680.patch agains entering in infinite
+- added -CVE-2006-5680.patch against entering an infinite
loop in corrupt archives
- added bsdtar package (bsdtar is included now in libarchive
sources)
-ODP: [Bug-tar] GNU tar, star and BSD tar speed comparision +new script
+ODP: [Bug-tar] GNU tar, star and BSD tar speed comparison +new script
Jan Psota
Thu, 25 Oct 2007 06:51:13 -0700
#!/bin/sh
-# tar comparision program
+# tar comparison program
# 2007-10-25 Jan Psota
n=3 # number of repetitions
-TAR="bsdtar gnutar star" # TApeArchivers to compare
+TAR="bsdtar gnutar star" # Tape archivers to compare
OPT=("" "--seek" "-no-fsync")
pax="--format=pax" # comment out for defaults
OPN=(create list extract compare) # operations
[where_to_extract_it]
TCP, version $version
-TCP stands for Tar Comparision Program here.
+TCP stands for Tar Comparison Program here.
It currently compares: BSD tar (bsdtar), GNU tar (gnutar) and star in archive
-creation, listing, extraction and archive-to-extracted comparision.
+creation, listing, extraction and archive-to-extracted comparison.
Tcp prints out best time of n=$n repetitions.
Tcp creates temporary archive named tcp.tar with $pax and some native
* pass __FILE__, __LINE__ directly into the function instead of using
* this hook. I suspect this machinery is used so rarely that we
* would be better off just removing it entirely. That would simplify
- * the code here noticably.
+ * the code here noticeably.
*/
static const char *skipping_filename;
static int skipping_line;
}
/*
- * Try to succesfully run the program; this requires that
+ * Try to successfully run the program; this requires that
* we know some option that will succeed.
*/
if (0 == systemf("%s --version >" DEV_NULL, testprog)) {
/* Group members bits and others bits do not work. */
assertEqualMem(e + 18, "040777", 6); /* Mode */
#else
- /* Accept 042775 to accomodate systems where sgid bit propagates. */
+ /* Accept 042775 to accommodate systems where sgid bit propagates. */
if (memcmp(e + 18, "042775", 6) != 0)
assertEqualMem(e + 18, "040775", 6); /* Mode */
#endif
This specifies the permissions required for access to the file itself.
Directories have an additional ACL
.Pq Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT ,
-which controlls the initial access ACL for newly created directory entries.
+which controls the initial access ACL for newly created directory entries.
.Pp
.Fn archive_entry_acl_add_entry
and
/*
* TODO: On Linux, store 32 or 64 here depending on whether
* the cached stat structure is a stat32 or a stat64. This
- * will allow us to support both variants interchangably.
+ * will allow us to support both variants interchangeably.
*/
entry->stat_valid = 1;
if (standin_father == self) {
/*
- * As a child of self, any childen would be opposite of
+ * As a child of self, any children would be opposite of
* our parent.
*/
standin_son = standin->rb_nodes[standin_which];
} else {
/*
- * Since we aren't a child of self, any childen would be
+ * Since we aren't a child of self, any children would be
* on the same side as our parent.
*/
standin_son = standin->rb_nodes[standin_other];
/*
* If we are about to delete the standin's father, then when
* we call rebalance, we need to use ourselves as our father.
- * Otherwise remember our original father. Also, sincef we are
+ * Otherwise remember our original father. Also, since we are
* our standin's father we only need to reparent the standin's
* brother.
*
* __archive_rb_tree_node_swap(rbt, self, which);
* __archive_rb_tree_prune_node(rbt, self, F);
*
- * But it's more efficient to just evalate and recolor the child.
+ * But it's more efficient to just evaluate and recolor the child.
*/
static void
__archive_rb_tree_prune_blackred_branch(
* red-black tree. So if we must remove a node, attempt to rearrange
* the tree so we can remove a red node.
*
- * The simpliest case is a childless red node or a childless root node:
+ * The simplest case is a childless red node or a childless root node:
*
* | T --> T | or | R --> * |
* | s --> * |
}
if (!RB_TWOCHILDREN_P(self)) {
/*
- * The next simpliest case is the node we are deleting is
+ * The next simplest case is the node we are deleting is
* black and has one red child.
*
* | T --> T --> T |
uint32_t bcj2_code;
uint64_t bcj2_outPos;
- /* Filename character-set convertion data. */
+ /* Filename character-set conversion data. */
struct archive_string_conv *sconv;
char format_name[64];
archive_entry_set_symlink(entry, NULL);
archive_string_free(&linkname);
/*
- * When a header level is 0, there is a possibilty that
+ * When a header level is 0, there is a possibility that
* a pathname and a symlink has '\' character, a directory
* separator in DOS/Windows. So we should convert it to '/'.
*/
if (l > 0)
return (l);
}
- return (0);/* Unkown key */
+ return (0);/* Unknown key */
}
/*
#define MAX_SYMBOLS 20
/*
- * Considering L1,L2 cache miss and a calling of write sytem-call,
+ * Considering L1,L2 cache miss and a calling of write system-call,
* the best size of the output buffer(uncompressed buffer) is 128K.
* If the structure of extracting process is changed, this value
* might be researched again.
/*
* Solaris pax extension for a sparse file. This is recorded with the
- * data and hole pairs. The way recording sparse infomation by Solaris'
+ * data and hole pairs. The way recording sparse information by Solaris'
* pax simply indicates where data and sparse are, so the stored contents
* consist of both data and hole.
*/
/*
* Remove ucx[i] by shifting
- * follwoing code points.
- */
+ * following code points.
+ */
for (j = i; j+1 < ucx_size; j++) {
ucx[j] = ucx[j+1];
ccx[j] = ccx[j+1];
return_no_changed_data:
/*
- * Something conversion error happend, so we return a no normalized
+ * Something conversion error happened, so we return a no normalized
* string with an error.
*/
(void)archive_string_append_unicode(as, _p, len, sc);
#endif /* __APPLE__ */
/*
- * libarchive 2.x made incorrect UTF-8 strings in the wrong assumuption
- * that WCS is Unicode. it is true for servel platforms but some are false.
+ * libarchive 2.x made incorrect UTF-8 strings in the wrong assumption
+ * that WCS is Unicode. It is true for several platforms but some are false.
* And then people who did not use UTF-8 locale on the non Unicode WCS
* platform and made a tar file with libarchive(mostly bsdtar) 2.x. Those
* now cannot get right filename from libarchive 3.x and later since we
if (l == 0)
return (NULL);
/* NOTE: GetFullPathNameW has a bug that if the length of the file
- * name is just one that return imcomplete buffer size. Thus, we
+ * name is just 1 then it returns incomplete buffer size. Thus, we
* have to add three to the size to allocate a sufficient buffer
* size for the full-pathname of the file name. */
l += 3;
*
* If the hardlink was successfully created and
* the archive doesn't have carry data for it,
- * consider it to be non-authoritive for meta data.
+ * consider it to be non-authoritative for meta data.
* This is consistent with GNU tar and BSD pax.
* If the hardlink does carry data, let the last
* archive entry decide ownership.
/*
* XXX At this point, symlinks should not be hit, otherwise
- * XXX a race occured. Do we want to check explicitly for that?
+ * XXX a race occurred. Do we want to check explicitly for that?
*/
if (file_information(a, a->name, &a->st, NULL, 1) == 0) {
a->pst = &a->st;
*
* If the hardlink was successfully created and
* the archive doesn't have carry data for it,
- * consider it to be non-authoritive for meta data.
+ * consider it to be non-authoritative for meta data.
* This is consistent with GNU tar and BSD pax.
* If the hardlink does carry data, let the last
* archive entry decide ownership.
size_t todo = gnutar->linkname_length;
struct archive_entry *temp = archive_entry_new2(&a->archive);
- /* Uname/gname here don't really matter since noone reads them;
+ /* Uname/gname here don't really matter since no one reads them;
* these are the values that GNU tar happens to use on FreeBSD. */
archive_entry_set_uname(temp, "root");
archive_entry_set_gname(temp, "wheel");
size_t todo = gnutar->pathname_length;
struct archive_entry *temp = archive_entry_new2(&a->archive);
- /* Uname/gname here don't really matter since noone reads them;
+ /* Uname/gname here don't really matter since no one reads them;
* these are the values that GNU tar happens to use on FreeBSD. */
archive_entry_set_uname(temp, "root");
archive_entry_set_gname(temp, "wheel");
iso9660 = a->format_data;
/*
- * Write remaining data out to the temprary file.
+ * Write remaining data out to the temporary file.
*/
if (wb_remaining(a) > 0) {
ret = wb_write_out(a);
ret = zisofs_rewind_boot_file(a);
if (ret < 0)
return (ret);
- /* Write remaining data out to the temprary file. */
+ /* Write remaining data out to the temporary file. */
if (wb_remaining(a) > 0) {
ret = wb_write_out(a);
if (ret < 0)
}
/* Make an offset of the number which is used to be set
- * hexadecimal number to avoid duplicate identififier. */
+ * hexadecimal number to avoid duplicate identifier. */
if ((int)l == ffmax)
noff = ext_off - 6;
else if ((int)l == ffmax-2)
}
/*
- * This comparing rule is acording to ISO9660 Standard 9.3
+ * This comparing rule is according to ISO9660 Standard 9.3
*/
static int
isoent_cmp_iso9660_identifier(const struct isoent *p1, const struct isoent *p2)
/*
* If Mac OS metadata blob is here, recurse to write that
- * as a separate entry. This is realy a pretty poor design:
+ * as a separate entry. This is really a pretty poor design:
* In particular, it doubles the overhead for long filenames.
* TODO: Help Apple folks design something better and figure
* out how to transition from this legacy format.
*
* Joerg Schilling has argued that this is unnecessary because, in
* practice, if the pax extended attributes get extracted as regular
- * files, noone is going to bother reading those attributes to
+ * files, no one is going to bother reading those attributes to
* manually restore them. Based on this, 'star' uses
* /tmp/PaxHeader/'basename' as the ustar header name. This is a
* tempting argument, in part because it's simpler than the SUSv3
void
__archive_check_child(int in, int out)
{
- (void)in; /* UNSED */
- (void)out; /* UNSED */
+ (void)in; /* UNUSED */
+ (void)out; /* UNUSED */
Sleep(100);
}
* pass __FILE__, __LINE__ directly into the function instead of using
* this hook. I suspect this machinery is used so rarely that we
* would be better off just removing it entirely. That would simplify
- * the code here noticably.
+ * the code here noticeably.
*/
static const char *skipping_filename;
static int skipping_line;
5. Then you will see that there is a cabinet file, test.cab
6. Move test.cab to posix platform
7. Extract test.cab with this version of bsdtar
-8. Excecute the following command to make uuencoded files.
+8. Execute the following command to make uuencoded files.
uuencode test_read_format_cab_1.cab test_read_format_cab_1.cab > test_read_format_cab_1.cab.uu
uuencode test_read_format_cab_2.cab test_read_format_cab_2.cab > test_read_format_cab_2.cab.uu
uuencode test_read_format_cab_3.cab test_read_format_cab_3.cab > test_read_format_cab_3.cab.uu
/*
* Exercise hardlink recreation.
*
- * File permissions are chosen so that the authoritive entry
- * has the correct permission and the non-authoritive versions
+ * File permissions are chosen so that the authoritative entry
+ * has the correct permission and the non-authoritative versions
* are just writeable files.
*/
DEFINE_TEST(test_write_disk_hardlink)
/* Test #1 */
/* If the hardlink was successfully created and the archive
* doesn't carry data for it, we consider it to be
- * non-authoritive for meta data as well. This is consistent
+ * non-authoritative for meta data as well. This is consistent
* with GNU tar and BSD pax. */
assertIsReg("link1a", 0755 & ~UMASK);
assertFileSize("link1a", sizeof(data));
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0x08,
+ /* A bit 11 of general purpose flag should be 0x08,
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6);
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0x08,
+ /* A bit 11 of general purpose flag should be 0x08,
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6);
/*
- * Verify that A bit 11 of general purpos flag is not set
+ * Verify that A bit 11 of general purpose flag is not set
* when ASCII filenames are stored.
*/
a = archive_write_new();
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
assertEqualMem(buff + 30, "abcABC", 6);
}
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0x08,
+ /* A bit 11 of general purpose flag should be 0x08,
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
/* Above three characters in KOI8-R should translate to the following
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
/* Above three characters in KOI8-R should not translate to
* any character-set. */
assertEqualMem(buff + 30, "\xD0\xD2\xC9", 3);
/*
- * Verify that A bit 11 of general purpos flag is not set
+ * Verify that A bit 11 of general purpose flag is not set
* when ASCII filenames are stored even if hdrcharset=UTF-8
* is specified.
*/
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
assertEqualMem(buff + 30, "abcABC", 6);
}
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
/* Above three characters in CP1251 should not translate into
* any other character-set. */
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0x08,
+ /* A bit 11 of general purpose flag should be 0x08,
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
/* Above three characters in CP1251 should translate to the following
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
/* Above three characters in CP1251 should translate to the following
* three characters in CP866. */
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0x08,
+ /* A bit 11 of general purpose flag should be 0x08,
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
/* Check UTF-8 version. */
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
/* Above three characters in EUC-JP should not translate to
* any character-set. */
assertEqualMem(buff + 30, "\xC9\xBD.txt", 6);
/*
- * Verify that A bit 11 of general purpos flag is not set
+ * Verify that A bit 11 of general purpose flag is not set
* when ASCII filenames are stored even if hdrcharset=UTF-8
* is specified.
*/
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
assertEqualMem(buff + 30, "abcABC", 6);
}
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0x08,
+ /* A bit 11 of general purpose flag should be 0x08,
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
/* Check UTF-8 version. */
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
/* Above three characters in CP932/SJIS should not translate to
* any character-set. */
assertEqualMem(buff + 30, "\x95\x5C.txt", 6);
/*
- * Verify that A bit 11 of general purpos flag is not set
+ * Verify that A bit 11 of general purpose flag is not set
* when ASCII filenames are stored even if hdrcharset=UTF-8
* is specified.
*/
archive_entry_free(entry);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* A bit 11 of general purpos flag should be 0,
- * which indicates the filename charset is unkown. */
+ /* A bit 11 of general purpose flag should be 0,
+ * which indicates the filename charset is unknown. */
assertEqualInt(0, buff[7]);
assertEqualMem(buff + 30, "abcABC", 6);
}
}
return (*s == '\0');
case '?':
- /* ? always succeds, unless we hit end of 's' */
+ /* ? always succeeds, unless we hit end of 's' */
if (*s == '\0')
return (0);
break;
break;
case OPTION_INCLUDE:
/*
- * Noone else has the @archive extension, so
- * noone else needs this to filter entries
+ * No one else has the @archive extension, so
+ * no one else needs this to filter entries
* when transforming archives.
*/
if (lafe_include(&bsdtar->matching, bsdtar->argument))
* pass __FILE__, __LINE__ directly into the function instead of using
* this hook. I suspect this machinery is used so rarely that we
* would be better off just removing it entirely. That would simplify
- * the code here noticably.
+ * the code here noticeably.
*/
static const char *skipping_filename;
static int skipping_line;
}
/*
- * Try to succesfully run the program; this requires that
+ * Try to successfully run the program; this requires that
* we know some option that will succeed.
*/
if (0 == systemf("%s --version >" DEV_NULL, testprog)) {