aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/libunarchive/get_header_tar.c17
-rw-r--r--archival/libunarchive/seek_by_jump.c4
2 files changed, 14 insertions, 7 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 7e3c482df..e7a3aeeb3 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -266,26 +266,31 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
266 case '0': 266 case '0':
267#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY 267#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
268 if (last_char_is(file_header->name, '/')) { 268 if (last_char_is(file_header->name, '/')) {
269 file_header->mode |= S_IFDIR; 269 goto set_dir;
270 } else 270 }
271#endif 271#endif
272 file_header->mode |= S_IFREG; 272 file_header->mode |= S_IFREG;
273 break; 273 break;
274 case '2': 274 case '2':
275 file_header->mode |= S_IFLNK; 275 file_header->mode |= S_IFLNK;
276 /* have seen tarballs with size field containing
277 * the size of the link target's name */
278 size0:
279 file_header->size = 0;
276 break; 280 break;
277 case '3': 281 case '3':
278 file_header->mode |= S_IFCHR; 282 file_header->mode |= S_IFCHR;
279 break; 283 goto size0; /* paranoia */
280 case '4': 284 case '4':
281 file_header->mode |= S_IFBLK; 285 file_header->mode |= S_IFBLK;
282 break; 286 goto size0;
283 case '5': 287 case '5':
288 set_dir:
284 file_header->mode |= S_IFDIR; 289 file_header->mode |= S_IFDIR;
285 break; 290 goto size0;
286 case '6': 291 case '6':
287 file_header->mode |= S_IFIFO; 292 file_header->mode |= S_IFIFO;
288 break; 293 goto size0;
289#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS 294#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
290 case 'L': 295 case 'L':
291 /* free: paranoia: tar with several consecutive longnames */ 296 /* free: paranoia: tar with several consecutive longnames */
diff --git a/archival/libunarchive/seek_by_jump.c b/archival/libunarchive/seek_by_jump.c
index 031598e7a..0a259c963 100644
--- a/archival/libunarchive/seek_by_jump.c
+++ b/archival/libunarchive/seek_by_jump.c
@@ -8,7 +8,9 @@
8 8
9void FAST_FUNC seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) 9void FAST_FUNC seek_by_jump(const archive_handle_t *archive_handle, unsigned amount)
10{ 10{
11 if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { 11 if (amount
12 && lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1
13 ) {
12 if (errno == ESPIPE) 14 if (errno == ESPIPE)
13 seek_by_read(archive_handle, amount); 15 seek_by_read(archive_handle, amount);
14 else 16 else