summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-26Fix prefix path for file globingDavid Oberhollenzer
Reported-by: Sebastian Birunt <sebastian.birunt@arm.com> Suggested-by: Sebastian Birunt <sebastian.birunt@arm.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-05-02Release version 1.3.1v1.3.1David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-05-02Update CHANGELOG.mdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-05-02fixed fragment table size typojuls0730
2024-05-02Fix broken C++ guard in rbtree.hDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-03-12gensquashfs: apply xattr file also when using a pack fileDavid Oberhollenzer
When reading a directory tree from a description file, we already scan do selinux relabeling if applicable. The same code path can be used to apply xattr from an xattr file, if present. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-03-11Release version 1.3.0v1.3.0David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-03-10Remove tar2sqfs test scriptDavid Oberhollenzer
The whole idea of re-generating archives and matching them against checksums has a big issue in that we cannot controll the underlying compressors. If the underlying compressor changes its behavior between versions, the checksums will be broken. For this exact reason, the zstd and LZ4 checks that used to be present, have already been removed. On Fedora, the script now breaks because of the zlib to zstd-ng transition. If we fix the checksums to work on Fedora, it WILL now break on other distributions. Ultimately, it is better to remove the script alltogether. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-03-10Update man pages, changelogDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-17Address new compiler warningsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-17Bump coverity versionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-14Fix path prefix for windows builds with newer toolchainDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-14Fix win32 filename sanitation for cases were we have clashesDavid Oberhollenzer
We fix filenames containing components like COM1 or PRN by appending an underscore ('_'). A squashfs archive may contain files that already have such a modifed name (e.g. COM1_) which would now potentially clash. This is fixed by matching any number of trailing '_' characters for the bad name and adding another one. So all existing names that start with an illegal prefix and have any number of underscores, will always have an additional one appended. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-14Cleanup logic for emitting file paths in rdsquashfs describeDavid Oberhollenzer
- Merge printing functions for type, name, permission - Split out the code to get a sanitized path - On Windows, always emit a source path if the fixed up path does not match the original path, not only if we have source directory Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-09Fixup extaction paths for rdsquashfs on WindowsDavid Oberhollenzer
- If we generate a manifest file, use the fix-path function to produce a fixed up, actual name as the source path. - When unpacking, create files for the fixed up, actual name. There is no need to touch gensquashfs, if the manifest file is used to re-pack the stuff, the original paths are used and the files are source from the fixed-up paths. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-09Add utility function to fixup Windows file pathsDavid Oberhollenzer
The idea is to iterate over a (canonicalized) path with forward slashes by components, i.e. file and directory names. Each name is then looked at by iterating over components, i.e. everything between dots. If a component is an illegal name, like COM1 or AUX, we add an underscore. If it contains illegal characters, like : or \, we re-map that character into unicode private use area. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-09Remove check for OS specific stuff from is_filename_saneDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-01-29tar2sqfs: Backport exclude filtering logicDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-01-24tar2sqfs: Add option to exclude filesRichard Weinberger
Using --exclude or -E it is now possible to exclude files from the input tar stream. The options can be used multiple times. Signed-off-by: Richard Weinberger <richard@nod.at>
2024-01-24README.md: fixed trailing ] for url and one typoMarcel Petrick
2024-01-24libsqfs: add a threshold for extended directory inodes with indexDavid Oberhollenzer
mksquashfs generates extended inodes if a directory contains 256 entries. libsquashfs so far only generated extended inodes if there is no other way to encode it. Mimic the behaviour of mksquashfs by adding a threshold. For this to work, the "sqfs_inode_set_xattr_index" function has to be changed to not immediately try to demote inodes to basic types. The fstree serialization is modified to do that itself if the index is 0xFFFFFFFF and the target is not a directory inode. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-02-20Fix compressor ID enumerator in format documentationfixes-1.2.0David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-12-14rdsquashfs: improve unpacking error message on WindowsDavid Oberhollenzer
Print a proper error description instead of just an error code. If the error is ERROR_FILE_EXISTS, print out a hint that this might be caused by a case in-sensitivity issue. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-12-14Fix unix istream eof flagDavid Oberhollenzer
Propperly set the parent eof flag and not a local one that isn't accessed at all. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-12-03Update versioning information in README.mdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-12-02Release version 1.2.0v1.2.0David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-12-02Re-run spell checker on the CHANGELOG.mdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-12-01Update CHANGELOG.mdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-29Add dummy hierarchy for fstree_from_dir testDavid Oberhollenzer
Instead of abusing the directory tree of another test case, add a proper dummy hierarchy. This also fixes issues with parallel tests, where another test generates squashfs images in the target path. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-27Continue cleanup of the test casesDavid Oberhollenzer
- Force all tests into their proper sub directory - Temporarily remove the corpora tests. They have been used for regression tests before releases and are disabled by default, so we should not ship them either. A script should be added for that, downloading what is needed. - The "pack a directory" test is also removed. It was rather hacky and there already is a test case for the fstree_from_dir function, which isn't ideal either. Something should be added to the regression test suite. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-27Improve thread pool testDavid Oberhollenzer
Instead of sleeping in the worker thread, busy-loop-wait on a ticket counter to try and serialize the workers in backward order. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-22Add a hacky script to sanity check symbols exported by libsquashfsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-22Move gensquashfs specific code from libfstree to gensquashfsDavid Oberhollenzer
The "from dir" and from "from file" code, as well as the "sort file" code is specific to gensquashfs, so move them there and the test cases as well. The medium term idea is to reduce libfstree to a stub, merge it into the generic writer and ultimately hoist that into libsquashfs. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-22Move helper scripts to scripts/ sub directoryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-22Get rid of the built-in copy of LZ4David Oberhollenzer
On Linux or BSD distributions we have a native version installed via package manager. On Windows, we can just build it from source like the other libraries. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-21Fix windows build for get_node_path testDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-21Make some string functions from libcompat available to libsquashfsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-21filemap xattr: slightly improve error reportingDavid Oberhollenzer
- When printing an error, specify the filename and line number - Always print an error, including out of memory conditions - Fail if we encounter a line that we don't recognize Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-21filemap xattr: use sqfs_u8 data type for xattr value blobsDavid Oberhollenzer
The xattr values are not strings, they are arbitrary byte blobs. To be on the safe side tough, we should still allocate the space for the extra null byte and propperly initialize the buffer. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-19gensquashfs: Add example for the xattr filemap to the help textDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-19gensquashfs: split the help text up into smaller partsDavid Oberhollenzer
It's just too darn big, crossing the maximum guaranteed by C99. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-19gensquashfs: simplfy the help text a bitDavid Oberhollenzer
The help text should provide a short, concise explanation, for quickly lookup up how to use the programs. For the input formats, this is mostly covered by the examples themselves. The detailed description can remain in the man page. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-19Add a man-page section about the xattr file formatDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18filemap xattr: use file istream from libio instead of stdio FILEDavid Oberhollenzer
The line-by-line reading function in the io library was specifically added for this kind of use case, so we don't have to handle trimming of lines, don't have to touch getline() and it's convoluted error handling (return value -1 could mean either EOF or error). The code that searches for '\n' and replaces it with '\0' can be removed as well and a memory leak involving "line" is removed along the way. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18filemap xattr: simplify error handling, freeingDavid Oberhollenzer
- Some of the error/cleanup paths are merged. - Struct fields don't have to be set to NULL if the entire struct is free'd immediately after. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18libsqfs: Fix an overzealous bounds check in the block processorDavid Oberhollenzer
When (during fragment deduplication) a fragment block is read back from disk and unpacked, it can happen that it is _exactly_ the given block size. The bounds check did '>=' instead of '>' and failed in that case with a "data corruption" error. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18libsqfs: Initialize the return value in sqfs_compressor_createDavid Oberhollenzer
Initialize the output compressor pointer to NULL, so if the function fails, the value is propperly initialized to a NULL pointer instead of relying on the function user to initialize it. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18Add a single, central base64 decoderDavid Oberhollenzer
Similar to the hex blob decoder, we need this once for tar and once for the filemap xattr parser. Simply add a single, central implementation to libutil, with a simple unit test, and then use it in both libtar and gensquashfs. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18Add a single, central hex blob decoderDavid Oberhollenzer
Since we need it twice (once for tar, once for the filemap xattr parser), add a single, central implementation to libutil, add a unit test for that implementation and then use it in both libtar and gensquashfs. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-16filemap xattr: Add a test caseDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>