]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Change new extra block from 'LA' to 'el' to follow updated draft spec
authorTim Kientzle <kientzle@gmail.com>
Fri, 3 Jan 2014 03:25:02 +0000 (19:25 -0800)
committerTim Kientzle <kientzle@gmail.com>
Fri, 3 Jan 2014 03:25:02 +0000 (19:25 -0800)
libarchive/archive_read_support_format_zip.c
libarchive/archive_write_set_format_zip.c
libarchive/test/test_write_format_zip_compression_store.c
libarchive/test/test_write_format_zip_file.c
libarchive/test/test_write_format_zip_file_zip64.c

index 1c653a6085a1972d41f270d8ab113648d6592e6a..b3ccf7c00becf622846fd9d3f8caf556eb9aa2e1 100644 (file)
@@ -339,9 +339,9 @@ process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry)
                        }
                        break;
                }
-               case 0x414C:
+               case 0x6c65:
                {
-                       /* Experimental 'LA' field */
+                       /* Experimental 'el' field */
                        int bitmap, bitmap_last;
 
                        if (datasize < 1)
index 32889e80d773fcac97e08f04ebb372bd280be60b..edb06d0681f3756fdcffd2fdc70290f55fe10b2d 100644 (file)
@@ -641,11 +641,11 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
                archive_le16enc(zip64_start + 2, e - (zip64_start + 4));
        }
 
-       { /* Experimental 'LA' extension to improve streaming. */
+       { /* Experimental 'el' extension to improve streaming. */
                unsigned char *external_info = e;
-               memcpy(e, "LA\000\000", 4); // 0x414C + 2-byte length
+               memcpy(e, "el\000\000", 4); // 0x6c65 + 2-byte length
                e += 4;
-               e[0] = 5; /* bitmap of included fields */
+               e[0] = 7; /* bitmap of included fields */
                e += 1;
                archive_le16enc(e, /* "Version created by" */
                    3 * 256 + version_needed);
@@ -655,6 +655,8 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
                archive_le32enc(e,  /* external file attributes */
                    archive_entry_mode(zip->entry) << 16);
                e += 4;
+               // Libarchive does not currently support file comments.
+               
                archive_le16enc(external_info + 2, e - (external_info + 4));
        }
 
index 69cedc4420b625640abfdc9434e91e673bd67149..e339f71bf9be10a3cdc301bad24e5e72bf45ffbd 100644 (file)
@@ -228,7 +228,7 @@ DEFINE_TEST(test_write_format_zip_compression_store)
        assertEqualInt(i4(q + 11), file_gid); /* 'Ux' GID */
        q = q + 4 + i2(q + 2);
 
-       assertEqualInt(i2(q), 0x414c); /* 'LA' experimental extension header */
+       assertEqualInt(i2(q), 0x6c65); /* 'el' experimental extension header */
        assertEqualInt(i2(q + 2), 9); /* size */
        assertEqualInt(q[4], 7); /* Bitmap of fields included. */
        assertEqualInt(i2(q + 5) >> 8, 3); /* system & version made by */
@@ -317,7 +317,7 @@ DEFINE_TEST(test_write_format_zip_compression_store)
        assertEqualInt(i4(q + 11), folder_gid); /* 'ux' GID */
        q = q + 4 + i2(q + 2);
 
-       assertEqualInt(i2(q), 0x414c); /* 'LA' experimental extension header */
+       assertEqualInt(i2(q), 0x6c65); /* 'el' experimental extension header */
        assertEqualInt(i2(q + 2), 9); /* size */
        assertEqualInt(q[4], 7); /* bitmap of fields */
        assertEqualInt(i2(q + 5) >> 8, 3); /* system & version made by */
index 88a733fb59f206d7d48f258fba89da47a25e0d90..f417e467dc2758c693ff5970437a91fc0e2412c8 100644 (file)
@@ -216,7 +216,7 @@ DEFINE_TEST(test_write_format_zip_file)
        assertEqualInt(i4(p + 11), file_gid); /* 'Ux' GID */
        p += 4 + i2(p + 2);
 
-       assertEqualInt(i2(p), 0x414c); /* 'LA' experimental extension block */
+       assertEqualInt(i2(p), 0x6c65); /* 'el' experimental extension block */
        assertEqualInt(i2(p + 2), 9); /* size */
        assertEqualInt(p[4], 7); /* bitmap of fields in this block */
        assertEqualInt(i2(p + 5) >> 8, 3); /* System & version made by */
index 60770653dfe3894cfc3f9c8c0ec845ebdbf4a2b3..ce66115385f6bc973231328d6bc756aab61b09b4 100644 (file)
@@ -249,7 +249,7 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
        /* compressed file size we can't verify here */
        p += 4 + i2(p + 2);
 
-       assertEqualInt(i2(p), 0x414c); /* 'LA' experimental extension header */
+       assertEqualInt(i2(p), 0x6c65); /* 'el' experimental extension header */
        assertEqualInt(i2(p + 2), 9); /* size */
        assertEqualInt(p[4], 7); /* bitmap of included fields */
        assertEqualInt(i2(p + 5) >> 8, 3); /* system & version made by */