summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibArchive
AgeCommit message (Collapse)Author
2023-03-13LibArchive: Read Tar archive headers through `read_value`Tim Schumacher
2023-03-13AK: Rename Stream::write_entire_buffer to Stream::write_until_depletedTim Schumacher
No functional changes.
2023-03-13AK: Rename Stream::read_entire_buffer to Stream::read_until_filledTim Schumacher
No functional changes.
2023-03-13AK: Rename Stream::{read,write} to Stream::{read_some,write_some}Tim Schumacher
Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs.
2023-02-13Everywhere: Remove the `AK::` qualifier from Stream usagesTim Schumacher
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-12LibArchive: Add support for modification time and dateOllrogge
2023-01-29AK: Move `Stream` and `SeekableStream` from `LibCore`Tim Schumacher
`Stream` will be qualified as `AK::Stream` until we remove the `Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is defined by `SeekableStream`, since defining its own would require us to qualify it with `AK::SeekMode` everywhere.
2023-01-29AK: Move `Handle` from `LibCore` and name it `MaybeOwned`Tim Schumacher
The new name should make it abundantly clear what it does.
2023-01-19LibCore: Return `EBADF` on unsupported stream operationsTim Schumacher
2023-01-08LibArchive: Use read_entire_buffer for reading extended headersimplicitfield
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53913
2023-01-08LibArchive+Utilities: Stop using DeprecatedStringimplicitfield
This also slightly improves error propagation in tar, unzip and zip.
2022-12-27LibArchive+Utilities: Port ZipOutputStream to Core::StreamKarol Kosek
2022-12-14LibArchive: Do some error propagation while packing tar filesTim Schumacher
2022-12-14LibArchive: Port `TarOutputStream` to `Core::Stream`Tim Schumacher
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-30LibArchive: Implement proper support for Tar file end markersTim Schumacher
Previously this was handled implicitly, as our implementation of Tar would just stop processing input as soon as it found something invalid. However, since we now error out as soon as something is found to be wrong, we require proper handling for zero blocks, which aren't actually fatal.
2022-11-30LibArchive: Pass along errors from Tar header checksum validationTim Schumacher
2022-11-30LibArchive: Move loading the next tar header into a helper functionTim Schumacher
This now also validates the first header that is loaded, so we can drop the corresponding FIXME from `tar`.
2022-11-30LibArchive: Use Core::Stream inside `TarInputStream`Tim Schumacher
2022-11-30LibArchive: Port `TarFileStream` to `Core::Stream`Tim Schumacher
2022-11-23LibArchive: Do not assert if the provided stream cannot be discardedimplicitfield
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52498
2022-11-23LibArchive: Simplify error handlingimplicitfield
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