diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-09-02 11:19:11 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-09-02 11:19:11 +0200 |
commit | 84ff0984bb5b471d0b4cbc0b0fca156c29273bf5 (patch) | |
tree | e6c4d1e394bfef5924c8b59fe8fad8691c9738bc /lib/tar/pax_header.c | |
parent | ba5e71a40af4bcc0f2427dc0b4575802da09af56 (diff) |
Fix nonexistant gnu tar sparse format 1.0 support
Contrary to previous claims, support for the GNU tar sparse format 1.0
was missing entirely (the newest of their 3 different sparse mapping
formats). This oversight wasn't caught, because the unit test was
compiling the wrong source file and tar2sqfs had no problem processing
the test file because it is still a valid POSIX-ish tar archive (but
the sparse part was missing and the mapping embedded in the file).
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/pax_header.c')
-rw-r--r-- | lib/tar/pax_header.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tar/pax_header.c b/lib/tar/pax_header.c index 4eeabf5..448976d 100644 --- a/lib/tar/pax_header.c +++ b/lib/tar/pax_header.c @@ -110,6 +110,13 @@ int read_pax_header(FILE *fp, sqfs_u64 entsize, unsigned int *set_by_pax, if (pax_read_decimal(ptr + 16, &out->actual_size)) goto fail; *set_by_pax |= PAX_SPARSE_SIZE; + } else if (!strncmp(ptr, "GNU.sparse.realsize=", 20)) { + if (pax_read_decimal(ptr + 20, &out->actual_size)) + goto fail; + *set_by_pax |= PAX_SPARSE_SIZE; + } else if (!strncmp(ptr, "GNU.sparse.major=", 17) || + !strncmp(ptr, "GNU.sparse.minor=", 17)) { + *set_by_pax |= PAX_SPARSE_GNU_1_X; } else if (!strncmp(ptr, "GNU.sparse.offset=", 18)) { if (pax_read_decimal(ptr + 18, &offset)) goto fail; |