Mercurial > hg > aboriginal
comparison sources/patches/busybox-1.11.1-tar.patch @ 373:9e2e6d04af86
Bugfix for busybox 1.11.1 dealing with mercurial archives with symlinks.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 20 Jul 2008 12:24:39 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
372:37c8a6c9a493 | 373:9e2e6d04af86 |
---|---|
1 --- busybox-1.11.1/archival/libunarchive/get_header_tar.c Wed Jun 25 14:51:17 2008 | |
2 +++ busybox-1.11.1-tar/archival/libunarchive/get_header_tar.c Sun Jul 20 19:11:45 2008 | |
3 @@ -261,26 +261,31 @@ | |
4 case '0': | |
5 #if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY | |
6 if (last_char_is(file_header->name, '/')) { | |
7 - file_header->mode |= S_IFDIR; | |
8 - } else | |
9 + goto set_dir; | |
10 + } | |
11 #endif | |
12 file_header->mode |= S_IFREG; | |
13 break; | |
14 case '2': | |
15 file_header->mode |= S_IFLNK; | |
16 + /* have seen tarballs with size field containing | |
17 + * the size of the link target's name */ | |
18 + size0: | |
19 + file_header->size = 0; | |
20 break; | |
21 case '3': | |
22 file_header->mode |= S_IFCHR; | |
23 - break; | |
24 + goto size0; /* paranoia */ | |
25 case '4': | |
26 file_header->mode |= S_IFBLK; | |
27 - break; | |
28 + goto size0; | |
29 case '5': | |
30 + set_dir: | |
31 file_header->mode |= S_IFDIR; | |
32 - break; | |
33 + goto size0; | |
34 case '6': | |
35 file_header->mode |= S_IFIFO; | |
36 - break; | |
37 + goto size0; | |
38 #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS | |
39 case 'L': | |
40 /* free: paranoia: tar with several consecutive longnames */ | |
41 --- busybox-1.11.1/archival/libunarchive/seek_by_jump.c Wed Jun 25 14:51:17 2008 | |
42 +++ busybox-1.11.1-tar/archival/libunarchive/seek_by_jump.c Sun Jul 20 19:11:45 2008 | |
43 @@ -8,7 +8,9 @@ | |
44 | |
45 void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) | |
46 { | |
47 - if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { | |
48 + if (amount | |
49 + && lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1 | |
50 + ) { | |
51 if (errno == ESPIPE) | |
52 seek_by_read(archive_handle, amount); | |
53 else |