mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +00:00
LibArchive: Support writing paths up to 255 characters
The POSIX.1-1988 limit was 100, but with the ustar prefix field it's 255 (kinda).
This commit is contained in:
parent
9ae36e2035
commit
612a3324d7
Notes:
sideshowbarker
2024-07-17 08:36:27 +09:00
Author: https://github.com/petelliott
Commit: 612a3324d7
Pull-request: https://github.com/SerenityOS/serenity/pull/15789
Issue: https://github.com/SerenityOS/serenity/issues/15641
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/timschumi ✅
3 changed files with 22 additions and 2 deletions
|
@ -133,7 +133,7 @@ void TarOutputStream::add_directory(String const& path, mode_t mode)
|
|||
VERIFY(!m_finished);
|
||||
TarFileHeader header {};
|
||||
header.set_size(0);
|
||||
header.set_filename(String::formatted("{}/", path)); // Old tar implementations assume directory names end with a /
|
||||
header.set_filename_and_prefix(String::formatted("{}/", path)); // Old tar implementations assume directory names end with a /
|
||||
header.set_type_flag(TarFileType::Directory);
|
||||
header.set_mode(mode);
|
||||
header.set_magic(gnu_magic);
|
||||
|
@ -149,7 +149,7 @@ void TarOutputStream::add_file(String const& path, mode_t mode, ReadonlyBytes by
|
|||
VERIFY(!m_finished);
|
||||
TarFileHeader header {};
|
||||
header.set_size(bytes.size());
|
||||
header.set_filename(path);
|
||||
header.set_filename_and_prefix(path);
|
||||
header.set_type_flag(TarFileType::NormalFile);
|
||||
header.set_mode(mode);
|
||||
header.set_magic(gnu_magic);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue