diff options
author | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
commit | ead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch) | |
tree | af268270382dad969218063d4a8120fc91a9e631 /archival | |
parent | 567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff) | |
parent | 64981b4c8e88812c322bee3832f1d421ff670ed5 (diff) | |
download | busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2 busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libarchive/get_header_tar.c | 2 | ||||
-rw-r--r-- | archival/tar.c | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c index b3131ff2d..2ab3c04b8 100644 --- a/archival/libarchive/get_header_tar.c +++ b/archival/libarchive/get_header_tar.c | |||
@@ -352,7 +352,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
352 | /* case 0: */ | 352 | /* case 0: */ |
353 | case '0': | 353 | case '0': |
354 | #if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY | 354 | #if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY |
355 | if (last_char_is(file_header->name, '/')) { | 355 | if (file_header->name && last_char_is(file_header->name, '/')) { |
356 | goto set_dir; | 356 | goto set_dir; |
357 | } | 357 | } |
358 | #endif | 358 | #endif |
diff --git a/archival/tar.c b/archival/tar.c index c7642a50e..1796d4c60 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -299,7 +299,8 @@ static void writeLongname(int fd, int type, const char *name, int dir) | |||
299 | header.typeflag = type; | 299 | header.typeflag = type; |
300 | strcpy(header.name, "././@LongLink"); | 300 | strcpy(header.name, "././@LongLink"); |
301 | /* This sets mode/uid/gid/mtime to "00...00<NUL>" strings */ | 301 | /* This sets mode/uid/gid/mtime to "00...00<NUL>" strings */ |
302 | memset(header.mode, '0', sizeof(struct prefilled)); | 302 | memset((char*)&header + offsetof(struct tar_header_t, mode), /* make gcc-9.x happy */ |
303 | '0', sizeof(struct prefilled)); | ||
303 | header.mode [sizeof(header.mode ) - 1] = '\0'; | 304 | header.mode [sizeof(header.mode ) - 1] = '\0'; |
304 | header.uid [sizeof(header.uid ) - 1] = '\0'; | 305 | header.uid [sizeof(header.uid ) - 1] = '\0'; |
305 | header.gid [sizeof(header.gid ) - 1] = '\0'; | 306 | header.gid [sizeof(header.gid ) - 1] = '\0'; |
@@ -492,10 +493,11 @@ static int exclude_file(const llist_t *excluded_files, const char *file) | |||
492 | # define exclude_file(excluded_files, file) 0 | 493 | # define exclude_file(excluded_files, file) 0 |
493 | # endif | 494 | # endif |
494 | 495 | ||
495 | static int FAST_FUNC writeFileToTarball(const char *fileName, struct stat *statbuf, | 496 | static int FAST_FUNC writeFileToTarball(struct recursive_state *state, |
496 | void *userData, int depth UNUSED_PARAM) | 497 | const char *fileName, |
498 | struct stat *statbuf) | ||
497 | { | 499 | { |
498 | struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData; | 500 | struct TarBallInfo *tbInfo = (struct TarBallInfo *) state->userData; |
499 | const char *header_name; | 501 | const char *header_name; |
500 | int inputFileFd = -1; | 502 | int inputFileFd = -1; |
501 | 503 | ||
@@ -714,7 +716,7 @@ static NOINLINE int writeTarFile( | |||
714 | /* Read the directory/files and iterate over them one at a time */ | 716 | /* Read the directory/files and iterate over them one at a time */ |
715 | while (filelist) { | 717 | while (filelist) { |
716 | if (!recursive_action(filelist->data, recurseFlags, | 718 | if (!recursive_action(filelist->data, recurseFlags, |
717 | writeFileToTarball, writeFileToTarball, tbInfo, 0) | 719 | writeFileToTarball, writeFileToTarball, tbInfo) |
718 | ) { | 720 | ) { |
719 | errorFlag = TRUE; | 721 | errorFlag = TRUE; |
720 | } | 722 | } |