aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-08-20Add spec file to build RPM packages.Sébastien Gross
Signed-off-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
2020-08-16Add a libtar test case for a completely filled link target fieldDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-16Fix libtar treatment of link targets that fill the header fieldDavid Oberhollenzer
The tar header has a 100 byte field for symlink and hard link targets. If the target is longer than 100 bytes, an extension header has to be used. However, it is perfectly valid to fill all 100 bytes to the brim without adding a null terminator. In case of a symlink, this can result in garbage link targets, while for hard links it results in an immediate error since the target cannot be resolved later on. This commit attempts to fix the problem by replacing the strdup of the link target with an strndup that copies at most the size of the target header field. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-12Add a "--stat" option to rdsquashfsDavid Oberhollenzer
This commit adds a --stat option to rdsquashfs that dumps a lot of information about and inode that tunred out to be usefull in debugging. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-12Add a clarifying note about documentation & build system copyrightDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-12Fix block processor single block with don't fragment flag bugDavid Oberhollenzer
This commit fixes a bug where the block processor state machine would not add the "last block" flag if there is only one not entirely filled block and the "don't fragment" flag is set. If the flag isn't set, the inode start block position is not updated and points to the beginning of the image instead. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-04Cleanup: move zlib/lz4 code from lib/sqfs/comp/ to lib/David Oberhollenzer
The source code of a modified liblz4 and zlib are included with the option to compile them into libsquashfs if they are not available on the system. So far, the source code was included directly in the compressor sub directory within libsqsuashfs. This commit moves the libraries out into the lib directory. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-04Add configuration for GitHub CodeQL static analysis toolsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-03Patch level release 1.0.1v1.0.1David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-08-03format.txt Fix magic text and remove stray tabsAnatoli Babenia
2020-07-29Fix: xattr reader: read the header after seaking to an OOL valueDavid Oberhollenzer
If an xattr value is stored OOL, the value actually holds an 8 byte reference to another, previously stored value. This reference points to the header that we need to read to know the actual size of the value before reading it, not the value itself, so after reading the reference and seeking to it, the xattr reader needs to read the actual header. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-29Document the file name limit imposed by the kernel implementationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-20Fix block bounds checking in libsquashfs data readerDavid Oberhollenzer
Instead of doing the fragile size comparison in both loops, simply bail from the function if offset is out of bounds, clamp the size to the available range of the file and abail if it is zero. As a result, a lot of checks can be removed and the function will not return data beyond EOF. This problem occoured with files that have a short last block instead of a fragment. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-14.travis.yml: Install readline libraryMatt Turner
extras/browse is conditionally built if readline is available. Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-06-14extras: Pass flags argument to fix buildMatt Turner
Missed in commit 259a98985b4f (Add flags to functions that might logically be expanded in the future) Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-06-13Fix: don't include alloca.h on systems that don't provide this headerv1.0.0David Oberhollenzer
This commit fixes a build issue on BSD based systems, where alloca is defined in stdlib.h and there is no such thing as "alloca.h". Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-13Update changelogDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-13Bump the so version number for libsquashfsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-13Minor documentation updateDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-12Fix the misspelled corpora test configure optionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-12Add an explicit defition for the libsquashfs so versionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-11Add flags to functions that might logically be expanded in the futureDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-09Cleanup: mark sqfs_xattr_writer_flush writer argument as constDavid Oberhollenzer
It does not make any changes to the writer itself, so mark it as const. This also requires some similar changes to the string table. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-09Cleanup: remove refcount adjusting in sqfs_xattr_writer_endDavid Oberhollenzer
After finding a match, reducing the reference count of the matched elements and increasing them afterwards leaves the reference count identical, because they refere to the same entries. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-09Cleanup: split libsquashfs xattr writer codeDavid Oberhollenzer
This commit moves the libsquashfs xattr related code into a sub directory and splits the xattr writer code up into several files. No actual code is changed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-07Fix uninitialized error code in block processor error pathDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-07Bump version numberDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-07Replace assert with propper error handling in rdsquashfs describeDavid Oberhollenzer
If a SquashFS archive contains file names with '..', '/' or similar nonsense in them, the unpacking code already refuses to process them, but the 'describe' code path simply triggers an assert that might not be there if the binary was compiled with NDEBUG defined. This commit replaces the assert with propper error handling that also reports on why things are failing and adds an additional check in the describe_tree function that tests if the file name is sane. Reported-by: Zachary Dremann <dremann@gmail.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-07Update CHANGELOG.mdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-07Move the fragment deduplication hash table back into the block processorDavid Oberhollenzer
Fragment deduplication really doesn't belong into the public API of the fragment table. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-07block processor: add an internal common cleanup functionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-04Fix compressor config union size testDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-04Cleanup: libcommon: use global LUTs for compressor optionsDavid Oberhollenzer
Instead of the convoluted logic, simply use a small number of LUTs that point to the available compressor flags for each compressor, the avaialble options and their ranges. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-04Cleanup: Pull compression level parameter out into compressor configDavid Oberhollenzer
Every compressor (except LC4) has a compression level parameter. This commit pulls the compression level field out into the generic configuration structure and applies some code clean ups as a result from this. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-04Strictly enfore min/max dictionary size in XZ & LZMA compressorsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-04lzma compressor: support micro management optionsDavid Oberhollenzer
The LZMA compressor (through the xz-utils library) supports basically the same options for micro management as the XZ compressor. This commit enables support for those options in the compressor, the option parser and adds an option field to the configuration structure. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-04lzma compressor: add support for the "extreme" flagDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-03Cleanup: Add defines for minimum and maximum block sizeDavid Oberhollenzer
This commit adds propper defines in the super block header and removes some of the hard coded constants. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-02Cleanup: clear naming confusion lzma vs xz in some commentsDavid Oberhollenzer
Previously, the XZ compressor was called LZMA at some points in the code, because it actually referres to LZMAv2 and the older LZMAv1 wasn't implemented. Since LZMAv1 is supported for some time now, simply calling it LZMA is confusing. This commit tries to replace the last bits where XZ is referred to as LZMA, which turns out to be only a hand full of comments. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-06-02tar2sqfs: add missing copyright headerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Fix: Only add Selinux flags if WITH_SELINUX is setDavid Oberhollenzer
On a current Fedora 31, when cross compiling with mingw, pkg config manages to find the Selinux library, but not the header. The configure script disables WITH_SELINUX, but the library variable is still set, causing a linker error further down the line. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30sqfs2tar: Move hard link detection to tree-repacking codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Cleanup: sqfs2tar: break up and simplify the repacking codeDavid Oberhollenzer
- Move the xattr extraction and repacking to xattr.c - Don't on-the-fly delete the tar xattr list, use the function from libtar.a - Split minor tasks into static helper functions - creating a libtar xattr struct from libsqfs xattr data - finding a hard link entry from current path and inode number Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Cleanup: Reorganize structure of Automake filesDavid Oberhollenzer
- Split up the huge file in bin/ into one small file per sub directory - Remove the stub in doc/ Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Cleanup: move man pages to the respective program source directoriesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Cleanup: try to split tar2sqfs.c in a reasonable wayDavid Oberhollenzer
This commit breaks tar2sqfs.c into multiple files: - options.c contains the command line argument processing - process_tarball.c contains the main tar repacking code - tar2sqfs.c contains what is left (the main function) - A header is added for gluing it all together. No actual code is changed. The tar repacking code is slightly modified to pass the sqfs writer and input file pointer around as argument rather than using a global variable. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Cleanup: try to split sqfs2tar.c in a reasonable wayDavid Oberhollenzer
This comit breaks sqfs2tar into multiple files: - options.c contains the command line argument processing - write_tree.c contains the code for generating the actual tar archive - sqfs2tar.c contains what is left - A header is added for glueing it all together. No actual code is changed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-30Block processor: cleanup macros, merge windows & pthread initializationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-29Block processor: merge finish & sync functionsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2020-05-29Block processor: allow operation without a fragment tableDavid Oberhollenzer
This commit modifies the block processor to support operating without a fragment table. If that is the case, fragment deduplication is essentially disabled and fragment blocks aren't indexed anymore. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>