diff options
author | Ron Yorston <rmy@pobox.com> | 2015-10-19 12:53:35 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-10-19 12:53:35 +0100 |
commit | 8afe8ee83a274925340473fa4d0a984bdcbee740 (patch) | |
tree | b78ed448cb6a55ba7d0ef8141a9f68b55b8acf11 /archival/libarchive | |
parent | caab029609633220c417dc0aaa9025fd4b7a169c (diff) | |
parent | 3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c (diff) | |
download | busybox-w32-8afe8ee83a274925340473fa4d0a984bdcbee740.tar.gz busybox-w32-8afe8ee83a274925340473fa4d0a984bdcbee740.tar.bz2 busybox-w32-8afe8ee83a274925340473fa4d0a984bdcbee740.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'archival/libarchive')
-rw-r--r-- | archival/libarchive/Kbuild.src | 2 | ||||
-rw-r--r-- | archival/libarchive/common.c | 9 | ||||
-rw-r--r-- | archival/libarchive/decompress_gunzip.c | 5 | ||||
-rw-r--r-- | archival/libarchive/get_header_cpio.c | 7 |
4 files changed, 18 insertions, 5 deletions
diff --git a/archival/libarchive/Kbuild.src b/archival/libarchive/Kbuild.src index b7faaf77f..b159a786a 100644 --- a/archival/libarchive/Kbuild.src +++ b/archival/libarchive/Kbuild.src | |||
@@ -4,7 +4,7 @@ | |||
4 | # | 4 | # |
5 | # Licensed under GPLv2 or later, see file LICENSE in this source tree. | 5 | # Licensed under GPLv2 or later, see file LICENSE in this source tree. |
6 | 6 | ||
7 | lib-y:= | 7 | lib-y:= common.o |
8 | 8 | ||
9 | COMMON_FILES:= \ | 9 | COMMON_FILES:= \ |
10 | \ | 10 | \ |
diff --git a/archival/libarchive/common.c b/archival/libarchive/common.c new file mode 100644 index 000000000..dd69d2222 --- /dev/null +++ b/archival/libarchive/common.c | |||
@@ -0,0 +1,9 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | ||
4 | */ | ||
5 | |||
6 | #include "libbb.h" | ||
7 | #include "bb_archive.h" | ||
8 | |||
9 | const char cpio_TRAILER[] = "TRAILER!!!"; | ||
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c index dced609e5..b6ae7f738 100644 --- a/archival/libarchive/decompress_gunzip.c +++ b/archival/libarchive/decompress_gunzip.c | |||
@@ -1121,9 +1121,8 @@ static int check_header_gzip(STATE_PARAM transformer_state_t *xstate) | |||
1121 | uint8_t os_flags_UNUSED; | 1121 | uint8_t os_flags_UNUSED; |
1122 | } PACKED formatted; | 1122 | } PACKED formatted; |
1123 | } header; | 1123 | } header; |
1124 | struct BUG_header { | 1124 | |
1125 | char BUG_header[sizeof(header) == 8 ? 1 : -1]; | 1125 | BUILD_BUG_ON(sizeof(header) != 8); |
1126 | }; | ||
1127 | 1126 | ||
1128 | /* | 1127 | /* |
1129 | * Rewind bytebuffer. We use the beginning because the header has 8 | 1128 | * Rewind bytebuffer. We use the beginning because the header has 8 |
diff --git a/archival/libarchive/get_header_cpio.c b/archival/libarchive/get_header_cpio.c index 7861d1f6f..badd4a841 100644 --- a/archival/libarchive/get_header_cpio.c +++ b/archival/libarchive/get_header_cpio.c | |||
@@ -52,6 +52,11 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) | |||
52 | &major, &minor, &namesize) != 10) | 52 | &major, &minor, &namesize) != 10) |
53 | bb_error_msg_and_die("damaged cpio file"); | 53 | bb_error_msg_and_die("damaged cpio file"); |
54 | file_header->mode = mode; | 54 | file_header->mode = mode; |
55 | /* "cpio -R USER:GRP" support: */ | ||
56 | if (archive_handle->cpio__owner.uid != (uid_t)-1L) | ||
57 | uid = archive_handle->cpio__owner.uid; | ||
58 | if (archive_handle->cpio__owner.gid != (gid_t)-1L) | ||
59 | gid = archive_handle->cpio__owner.gid; | ||
55 | file_header->uid = uid; | 60 | file_header->uid = uid; |
56 | file_header->gid = gid; | 61 | file_header->gid = gid; |
57 | file_header->mtime = mtime; | 62 | file_header->mtime = mtime; |
@@ -75,7 +80,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) | |||
75 | /* Update offset amount and skip padding before file contents */ | 80 | /* Update offset amount and skip padding before file contents */ |
76 | data_align(archive_handle, 4); | 81 | data_align(archive_handle, 4); |
77 | 82 | ||
78 | if (strcmp(file_header->name, "TRAILER!!!") == 0) { | 83 | if (strcmp(file_header->name, cpio_TRAILER) == 0) { |
79 | /* Always round up. ">> 9" divides by 512 */ | 84 | /* Always round up. ">> 9" divides by 512 */ |
80 | archive_handle->cpio__blocks = (uoff_t)(archive_handle->offset + 511) >> 9; | 85 | archive_handle->cpio__blocks = (uoff_t)(archive_handle->offset + 511) >> 9; |
81 | goto create_hardlinks; | 86 | goto create_hardlinks; |