diff options
author | Ron Yorston <rmy@pobox.com> | 2025-05-19 08:34:32 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2025-05-19 08:34:32 +0100 |
commit | 64bf69893bd99c305d13a956389f216e7d15c682 (patch) | |
tree | 7fa7d449f0633c86c1248c0bb86363dd9f46da38 /archival/libarchive/data_extract_all.c | |
parent | a807cdfa95cf4af2f84e207ed15887cc3514cb43 (diff) | |
parent | 5f07327251c93184dfcfc8d978fc35705930ec53 (diff) | |
download | busybox-w32-merge.tar.gz busybox-w32-merge.tar.bz2 busybox-w32-merge.zip |
Merge branch 'busybox' into mergemerge
Diffstat (limited to 'archival/libarchive/data_extract_all.c')
-rw-r--r-- | archival/libarchive/data_extract_all.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/archival/libarchive/data_extract_all.c b/archival/libarchive/data_extract_all.c index 049c2c156..8a69711c1 100644 --- a/archival/libarchive/data_extract_all.c +++ b/archival/libarchive/data_extract_all.c | |||
@@ -65,6 +65,14 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) | |||
65 | } while (--n != 0); | 65 | } while (--n != 0); |
66 | } | 66 | } |
67 | #endif | 67 | #endif |
68 | #if ENABLE_FEATURE_PATH_TRAVERSAL_PROTECTION | ||
69 | /* Strip leading "/" and up to last "/../" path component */ | ||
70 | dst_name = (char *)strip_unsafe_prefix(dst_name); | ||
71 | #endif | ||
72 | // ^^^ This may be a problem if some applets do need to extract absolute names. | ||
73 | // (Probably will need to invent ARCHIVE_ALLOW_UNSAFE_NAME flag). | ||
74 | // You might think that rpm needs it, but in my tests rpm's internal cpio | ||
75 | // archive has names like "./usr/bin/FOO", not "/usr/bin/FOO". | ||
68 | 76 | ||
69 | if (archive_handle->ah_flags & ARCHIVE_CREATE_LEADING_DIRS) { | 77 | if (archive_handle->ah_flags & ARCHIVE_CREATE_LEADING_DIRS) { |
70 | char *slash = strrchr(dst_name, '/'); | 78 | char *slash = strrchr(dst_name, '/'); |