summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibArchive
AgeCommit message (Collapse)Author
2022-11-13LibArchive: Make get_field_as_integral error out on non-octal inputimplicitfield
Fixes this bug that was reported by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52493
2022-11-13LibArchive: Make TarInputStream::advance report errorsimplicitfield
Fixes this bug that was reported by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52862
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-31Utilities+LibArchive: Don't follow symlinksPeter Elliott
2022-10-31LibArchive: Support writing paths up to 255 charactersPeter Elliott
The POSIX.1-1988 limit was 100, but with the ustar prefix field it's 255 (kinda).
2022-10-31LibArchive: Refactor null-termination logic in TarFileHeaderPeter Elliott
Before this change the behavior was, confusingly: - never null-terminate if set_field() is passed a StringView. - which would also not fail if the StringView is too large. - require null-termination if set_field() is passed a String. Not only are both of these wrong, having different behavior for those is very confusing, and creating a String copy to force a type checker to cause a string to be null-terminated is extremely weird. The new behavior is to always null-terminate when possible, never null-terminate if the last byte is used, and always verify that the string will fit.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-12Everywhere: Explicitly specify the size in StringView constructorssin-ack
This commit moves the length calculations out to be directly on the StringView users. This is an important step towards the goal of removing StringView(char const*), as it moves the responsibility of calculating the size of the string to the user of the StringView (which will prevent naive uses causing OOB access).
2022-07-05LibArchive: Guard against major() and minor() macros from old glibcAndrew Kaster
glibc before 2.28 defines major() and minor() macros from sys/types.h. This triggers a Lagom warning for old distros that use versions older than that, such as Ubuntu 18.04. This fixes a break in the compiler-explorer Lagom build, which is based off 18.04 docker containers.
2022-06-06tar: Implement support for GNU longname headersTim Schumacher
2022-05-12LibArchive: Use named members for ZIP general purpose flagsTim Schumacher
This fixes the faulty bit check that misclassified ZIPs as having data descriptors.
2022-04-13LibArchive: Stop null-terminating StringView tar file header fieldsIdan Horowitz
Since 8209c2b5707db24a8552c6ce8f361f9c49804dec was added the requires check for copy_characters_to_buffer matched StringViews as well, which caused unexpected null bytes to be inserted for non null-terminated fields.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-18Libraries: Change enums to enum classes in LibArchiveLenny Maiorani
2022-03-08LibArchive: Accept space characters as terminators of tar numeric fieldsDaniel Bertalan
POSIX specifies that each numeric field is terminated with one or more space or NUL characters.
2022-03-05LibArchive: Implement a basic parser for tar extended headersTim Schumacher
2022-03-05LibArchive: Add TarFileHeader::content_is_like_extended_header()Tim Schumacher
2022-02-18LibArchive: Use designated initializersLenny Maiorani
Benefits: - Braced-initialization prevents unknown narrowing conversions. - Using designated initializers will result in a compiler error when a member is skipped or forgotten.
2022-02-18LibArchive: Refactor zip header handlingLenny Maiorani
The directory headers have some common code for reading.
2022-02-15LibArchive: Default initialize member variablesLenny Maiorani
Problem: - `memset` is used to initialize data instead of using default initialization. Solution: - Default initialize all member variables. - Eliminate use of `memset` in favor of C++ braced initialization.
2022-02-15LibArchive: Use constexpr variables where possibleLenny Maiorani
2022-02-15LibArchive: Refactor Tar to make DRY (Don't Repeat Yourself)Lenny Maiorani
Problem: - The getters and setters duplicate code for conversions. - Getters are returning `const StringView` rather than non-`const`. Solution: - Factor out common code to helper functions. - Return `StringView` as non-`const`.
2021-11-24LibArchive: Limit all Tar header fields to their buffer lengthTim Schumacher
2021-11-11Everywhere: Pass AK::ReadonlyBytes by valueAndreas Kling
2021-09-01Everywhere: Use my cool new @serenityos.org email addressPeter Elliott
2021-05-17LibArchive: Move method implementations away from headerJean-Baptiste Boric
2021-04-29Everywhere: "file name" => "filename"Andreas Kling
2021-04-22AK+Userland: Use idan.horowitz@serenityos.org for my copyright headersIdan Horowitz
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-18Everywhere: Fix a bunch of typosLinus Groh
2021-04-12LibArchive: Support POSIX.1-1988 tar filesPeter Elliott
These old tar files didn't have magic numbers, so I've also added a checksum check to TarInputStream::valid()
2021-03-27LibArchive: Bounds check header offsets in Zip ParserIdan Horowitz
Since the central directory offset in the end of central directory record and the local file offset in each central directory header are user-controlled arbitary data, we have to bounds check them before using them.
2021-03-27LibArchive: Make bounds checks stricter in the Zip parserIdan Horowitz
We now also check we have enough space in the incoming buffer for the various signatures and optional (length specified) fields. This helps prevents a possible heap overflow read.
2021-03-23LibArchive: Implement ZipOutputStream for zip archive creationIdan Horowitz
This output stream can be used to create zip archives, and will be used in the implementation of the zip utility.
2021-03-23LibArchive: Add Zip file parserIdan Horowitz
This is based on the zip specification on PKWARE's zip specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) and will be used in the unzip utility and eventually in the zip utility.
2021-03-23Libraries: Rename LibTar to LibArchiveIdan Horowitz
This is in preparation for a new implementation of zip archive extraction and creation.