aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2019-10-28Add libutil implementation for strndup in case it isn't availableDavid Oberhollenzer
"Some" "non-POSIX systems" don't have that. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-25Add mockup of "struct stat" for WinDOSDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23Add helper script for churning out Windows builds with dependenciesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23For Windows builds, remove the so-version, link libgcc staticallyDavid Oberhollenzer
The -static-libgcc flag has to be passed through the compiler with a "-Wc," prefix, because libtool tries to be clever about linker flags. If added directly to LDFLAGS, libtool removes it. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23Fix tar2sqfs: check for empty names or './' entrtyDavid Oberhollenzer
This commit makes sure entries with empty file names are skipped by tar2sqfs. The case of a directory with the name './' is treated specially, because tar can generate in some common use cases. For instance: $ mkdir foo $ touch foo/bar $ tar -C ./foo -c . > out.tar $ tar tf out.tar will generate a tar file with an entry named './'. For the future it might be interesting to turn that into the root inode somehow. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23Fix sqfs_dir_writer_add_entry behaviour on empty stringsDavid Oberhollenzer
SquashFS cannot represent empty string file names in the directory entry structure, so reject them and report an error. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23Fix memory leak in tar2sqfs if entries are skippedDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23Fix tar_fuzz error check after seekDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23Fix the fstree_init test to account for defaults from SOURCE_DATE_EPOCHDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-23bugfix: Check no_xattr flagUzi Erdenebileg
2019-10-11Add the required libtool magic to build a Windows DLLDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-11Remove usage of strchrnul from libsquashfsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-11Add Windows implementation for sqfs_file_tDavid Oberhollenzer
This commit moves the generic unix implementation into a "unix" subdirectory and adds a "win32" subdirectory with a winapi based implementation. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-11Add configure check for WindowsDavid Oberhollenzer
Set an automake variable and force --without-tools by default. Also, don't even try to check for pthread if we are compiling for Windows. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Update CHANGELOGv0.7David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Add a configure option to disable building the toolsDavid Oberhollenzer
If this option is used, only libsquashfs is built and installed, and the test cases for the other helper libraries are deactivated. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Remove maximum queue backlog guestimation.David Oberhollenzer
Partially revers 2b7df394057c013fd042b85a4d5fd0104ba4a9be. Making the queue fill the entire RAM had some unintended side effects that need further investigation. For now, revert back to the old behaviour. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08sqfsdiff: continue comparison if types are compatibleDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Fix: propperly clear index entryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Fix storing of the directory index in the inode, size accountingDavid Oberhollenzer
After the last modification, the directory index size counter no longer counts the size, but the number of index entries. To avoid future confusion, remove the thing entirely and compute the size on the fly. Furthermore, eliminate unaligned memory writes and fix the darn counter once again. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Fix recovery of directory index in inode readerDavid Oberhollenzer
Apparently mksquashfs writes an actual usage count (1 = 1 entry, 2 = 2 entries; i.e. NOT off by one). Also, if it does happen to be garbage, guard against an overflow. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Fix unaligned reads in write_dir_indexDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-08Make sure the statistics counters are initialized to 0David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-10-07Bump version number for the next releaseDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>