aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-11-25Cleanup: move overflow safe alloc code into libsquashfsDavid Oberhollenzer
There were only a hand full of instances outside libsquashfs that used the alloc code. In most cases, the thing allocated hat its size derived from something already in memory anyway, so it is safe to assume its size fits into a size_t. At the same time, the opencoded Windows path conversion functions are all unified into a single helper function. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Cleanup: completely move str_table into libsquashfs internalsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Cleanup: remove unused str_table functionsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Cleanup: move canonicalize_name back to libfstree.aDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Fix check of block size in super blockDavid Oberhollenzer
The check needs to include 1M, which is still a valid block size. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Cleanup libsquashfs invalid argument error codesDavid Oberhollenzer
- Add an explicit "you're holding it wrong" error code. - Consistently return error codes and not have some special places where -1 is returned. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Cleanup: split out sqfs_write_super similar to sqfs_read_superDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Cleanup: remove the entirely redundant sqfs_has_xattr functionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Update CHANGELOG.mdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Point URLs for mkwinbins.sh to infraroot mirrorDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Complete packaging in mkwinbins.shDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Update README, clarify licensing situationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Fix cross compilation settings for lz4David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Fix: Move LZO compressor from libsquashfs to libcommonDavid Oberhollenzer
The liblzo2 library is licensed under GPLv2, so it is not possible to distribute binaries of libsquashfs that link against liblzo2 under LGPL. This commit moves the LZO compressor implementation to libcommon, where this isn't a problem, since the tools themselves are licensed under GPLv3. It removes the ability of libsquashfs to read or generate LZO compressed SquashFS images, but the tools still can. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-24Fix mkwinbins linking against lzo, add zstdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-23Fix: don't search for liblzo if the precious variable is already setDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-23Fix: add missing null-terminator in getline implementationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-23Make sure the unit tests build with the mingw cross compilerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-23Fix various data type problemsDavid Oberhollenzer
- Make sure the mockup constant for AT_FDCWD is actualy an int - Don't use %lld printf format specified, mscrt doesn't have that - On 64 bit windows, use %I64u format specified for size_t - Seperate the overflow macro stuff from the form specifier stuff - Move the whole thing to compat.h and clean it up a little so it becomes readable. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-23Add windows implementation for chdir in libcompatDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-23Move some unix header inclusions to compat.hDavid Oberhollenzer
In most cases, including unistd.h and fcntl.h was a left over anyway. In the cases where it was not, move it to compat.h. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-22Add fchownat/fchmodat mockups to libcompat for WindowsDavid Oberhollenzer
Not pretty, but definitely prettier than #ifdef hell. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-22Cleanup: move all the compatibillity fluff to a dedicated "libcompat"David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-22Add *.exe and *.dll files to gitignoreDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-22Ensure that tar2sqfs & sqfs2tar set stdin/out to binary modeDavid Oberhollenzer
As usual, Windows has things different and is the platform where the problem was actually discovered. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-19Remove no-tools restriction for windowsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-19Disable gensquashfs directory scanning on WindowsDavid Oberhollenzer
- We can only pack directories and files anyway. - What file modes should we use? Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-19Make rdsquashfs unpack work on WindowsDavid Oberhollenzer
AFAIK the only thing we can actually unpack on Windows is regular files and directories, so only do that. Furthermore, we have no way of setting Unix file attributes, so skip that. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Add Windows implementation for mkdir_pDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Convert the remaining size_t printf format specifiers in libcommonDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Remove directory stack codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Remove pushd/popd usage from gensquashfs dirscanDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Fix: do not follow symlinks when scanning xattrs from a directoryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Cleanup: gensquashfs: split xattr code from directorty tree scanDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Cleanup: gensquashfs: don't store the filepath for directory scanDavid Oberhollenzer
Since we can reconstruct the path at any time, simply do so instead of explicitly duplicating and storing it. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Remove pushd/popd usage from gensquashfs packing codeDavid Oberhollenzer
We don't do any directory operations aftwerwards, so we can just chdir into the input directory. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Remove pushd/popd usage from rdsquashfs unpacking codeDavid Oberhollenzer
Instead, reconstruct the full path and use that instead. We do that anyway if --quiet is not set. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-18Add container_of implementation to utilitiesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-15Extend is_filename_sane reserved character/name checkDavid Oberhollenzer
- Instead of an open coded version, check against a list of bad names. On windows, the comparison needs to be done case insensitive. - If compiling for Windows, include the magic DOS device names in that list. - Also classify filenames as 'insane' if they contain back slashes, on all platforms. - If compiling for Windows, check for reserved characters. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-15Add missing "sys/sysmacros.h" header for back in for LinuxDavid Oberhollenzer
On BSD based systems, major(3), minor(3) and makedev(3) are defined in "sys/types.h", but on GNU/Linux systems they are in "sys/sysmacros.h", which is not available on the BSD systems. This patch fixes up compat.h to include "sys/sysmacros.h" on Linux based systems. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-15Fix build on BSD systemsAlyssa Ross
I tested FreeBSD, DragonflyBSD, NetBSD and OpenBSD and the endian macros weren't necessary (and in fact caused errors) on all of them. Because OpenBSD ships with an ancient GCC that doesn't support the checked addition/multiplication builtins, the build there would fail unless built with CC=cc or CC=clang. I changed configure.ac to prefer cc over gcc, so that the distribution's compiler preference is respected. (The default is [gcc cc]). I had to move AC_PROG_CC above LT_INIT because otherwise LT_INIT would run AC_PROG_CC first, and we wouldn't have a chance to use non-default parameters.
2019-11-06Cleanup: remove some no longer needed header inclusionsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-06Cleanup: remove BSD style __prognameDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-06Cleanup: remove unused stdout sqfs_file_t wrapperDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-06Fix: use size_t printf macro in tar PAX header writerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-06Remove raw file descriptors from tar read pathDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-11-06Remove raw file descriptors from unpack write pathsDavid Oberhollenzer
Instead, use stdio FILE pointers. On POSIX systems, use fileno to get the file descriptor and hopefully create sparase files. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-28Add macro for printf format specifier for size_tDavid Oberhollenzer
The MSVC runtime is a wierdo C89 platform with some cherry picked features from C99 (which does not include the "%zu" format specifier). This commit adds a macro with a size dependend format specifier to be used instead. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-28Add fallback implementation for getsubopt()David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-28Add a minimal fallback implementation for getline()David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>