mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-31 15:36:47 +02:00
Merge pull request #10918 from andir/restrict-tarfile-formats
Restrict supported tarball formats to actual Tarballs
This commit is contained in:
commit
48d38b32d2
1 changed files with 4 additions and 2 deletions
|
@ -79,7 +79,8 @@ TarArchive::TarArchive(Source & source, bool raw, std::optional<std::string> com
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!raw) {
|
if (!raw) {
|
||||||
archive_read_support_format_all(archive);
|
archive_read_support_format_tar(archive);
|
||||||
|
archive_read_support_format_zip(archive);
|
||||||
} else {
|
} else {
|
||||||
archive_read_support_format_raw(archive);
|
archive_read_support_format_raw(archive);
|
||||||
archive_read_support_format_empty(archive);
|
archive_read_support_format_empty(archive);
|
||||||
|
@ -96,7 +97,8 @@ TarArchive::TarArchive(const Path & path)
|
||||||
, buffer(defaultBufferSize)
|
, buffer(defaultBufferSize)
|
||||||
{
|
{
|
||||||
archive_read_support_filter_all(archive);
|
archive_read_support_filter_all(archive);
|
||||||
archive_read_support_format_all(archive);
|
archive_read_support_format_tar(archive);
|
||||||
|
archive_read_support_format_zip(archive);
|
||||||
archive_read_set_option(archive, NULL, "mac-ext", NULL);
|
archive_read_set_option(archive, NULL, "mac-ext", NULL);
|
||||||
check(archive_read_open_filename(archive, path.c_str(), 16384), "failed to open archive: %s");
|
check(archive_read_open_filename(archive, path.c_str(), 16384), "failed to open archive: %s");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue