rev |
line source |
pascal@1299
|
1 --- busybox-1.12.0/archival/libunarchive/data_extract_all.c
|
pascal@1299
|
2 +++ busybox-1.12.0/archival/libunarchive/data_extract_all.c
|
pascal@1299
|
3 @@ -38,7 +38,8 @@ void FAST_FUNC data_extract_all(archive_
|
pascal@1299
|
4 }
|
pascal@1299
|
5 }
|
pascal@1299
|
6 else if (statbuf.st_mtime <= file_header->mtime) {
|
pascal@1299
|
7 - if (!(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)) {
|
pascal@1299
|
8 + if (!(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET) &&
|
pascal@1299
|
9 + (file_header->mode & S_IFMT) != S_IFDIR) {
|
pascal@1299
|
10 bb_error_msg("%s not created: newer or "
|
pascal@1299
|
11 "same age file exists", file_header->name);
|
pascal@1299
|
12 }
|
pascal@1299
|
13 @@ -77,7 +78,7 @@ void FAST_FUNC data_extract_all(archive_
|
pascal@1299
|
14 }
|
pascal@1299
|
15 case S_IFDIR:
|
pascal@1299
|
16 res = mkdir(file_header->name, file_header->mode);
|
pascal@1299
|
17 - if ((res == -1) && (errno != EISDIR)
|
pascal@1299
|
18 + if ((res == -1) && (errno != EISDIR) && (errno != EEXIST)
|
pascal@1299
|
19 && !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
|
pascal@1299
|
20 ) {
|
pascal@1299
|
21 bb_perror_msg("cannot make dir %s", file_header->name);
|
pascal@1641
|
22
|
pascal@1641
|
23 --- busybox-1.12.0/archival/cpio.c
|
pascal@1641
|
24 +++ busybox-1.12.0/archival/cpio.c
|
pascal@1641
|
25 @@ -30,6 +30,7 @@
|
pascal@1641
|
26 * It's ok to exit instead of return. */
|
pascal@1641
|
27 static int cpio_o(void)
|
pascal@1641
|
28 {
|
pascal@1641
|
29 + static char trailer[] = "TRAILER!!!";
|
pascal@1641
|
30 struct name_s {
|
pascal@1641
|
31 struct name_s *next;
|
pascal@1641
|
32 char name[1];
|
pascal@1641
|
33 @@ -119,7 +120,7 @@
|
pascal@1641
|
34 } else {
|
pascal@1641
|
35 /* If no (more) hardlinks to output,
|
pascal@1641
|
36 * output "trailer" entry */
|
pascal@1641
|
37 - name = "TRAILER!!!";
|
pascal@1641
|
38 + name = trailer;
|
pascal@1641
|
39 /* st.st_size == 0 is a must, but for uniformity
|
pascal@1641
|
40 * in the output, we zero out everything */
|
pascal@1641
|
41 memset(&st, 0, sizeof(st));
|
pascal@1641
|
42 @@ -167,7 +168,7 @@
|
pascal@1641
|
43 }
|
pascal@1641
|
44
|
pascal@1641
|
45 if (!line) {
|
pascal@1641
|
46 - if (links)
|
pascal@1641
|
47 + if (name != trailer)
|
pascal@1641
|
48 goto next_link;
|
pascal@1641
|
49 /* TODO: GNU cpio pads trailer to 512 bytes, do we want that? */
|
pascal@1641
|
50 return EXIT_SUCCESS;
|