100 Commits
Author SHA1 Message Date
François Degros 7704ecaffd Add repository archival and transition notice 2026-09-20 09:47:57 +10:00
François Degros 21bc15d5ac Start development version 1.25 2026-08-04 15:18:02 +10:00
François Degros 3e1298e581 Release version 1.24 2026-08-04 15:17:24 +10:00
François Degros 5040faceec Adjust libarchive issue 2514 workaround version check
Update WORK_AROUND_ISSUE_2514 to apply only to versions before 3.8.8, as
the fix has been back-ported and is present in newer 3.8.x releases.
2026-08-04 15:00:44 +10:00
François Degros 893e724630 Isolate GPG integration testing environment
Use a temporary directory under GNUPGHOME to prevent contaminating or
relying on the host's global keyring during integration testing. Ensure
the background gpg-agent is terminated and the directory is cleaned up
afterwards.
2026-08-04 15:00:38 +10:00
François Degros 8b6426a00c Fix tests with gpg on some systems 2026-06-11 17:06:54 +10:00
François Degros ec8175a873 Add missing overload of Tree::HasSamePath 2026-06-01 09:48:04 +10:00
François Degros 9830698160 Fix hardlink resolution in multi-archive mode
Isolate original path tracking to the archive currently being loaded.
This prevents hardlinks in one archive from accidentally resolving to
nodes in another archive when their original paths collide before
renaming.

Also optimize memory by explicitly swapping out temporary tracking
structures after the loading phase is complete.
2026-05-31 18:11:11 +10:00
François Degros 6f086e6381 Filter PATH to keep only safe system directories
Instead of overwriting PATH with a hardcoded list, iterate through the
existing PATH and keep only recognized safe system locations. This
provides more flexibility while maintaining security for external
filters.

Also add -o unsafe_path to allow non-standard filter locations.
2026-05-28 22:51:25 +10:00
François Degros ff1688a740 Index renamed nodes by original path to fix hardlink resolution
When name collisions occur within an archive, fuse-archive renames the
offending nodes to ensure VFS integrity.  However, this previously broke
hardlink resolution for any link pointing to a renamed target, as the
target's path in the Tree index no longer matched the path stored in the
hardlink metadata.

This change introduces an auxiliary index, `nodes_by_original_path_`,
which tracks nodes that have undergone renaming.

Key changes:
- Add `renamed` flag to `Node` struct.
- Implement `FindNodeByOriginalPath` which performs a transparent lookup
  in the original path index.
- Update `ResolveHardlinks` to use the original path for target lookups.
- Implement recursive path verification in `OriginalName::HasPath` to
  ensure correct parent hierarchy matching.
- Clear the auxiliary index after hardlink resolution to minimize memory
  footprint during the FUSE session.

This ensures that hardlinks are correctly resolved even in complex
archives with numerous name collisions.
2026-05-28 22:50:52 +10:00
François Degros 9f9577b290 Replace struct Tree with class Tree in Reader header 2026-05-26 17:45:11 +10:00
François Degros beff0d175c Start development version 1.23 2026-05-24 15:08:29 +10:00
François Degros e218685189 Release version 1.22 2026-05-24 15:07:13 +10:00
François Degros b1434306af Rename '-o default_permissions' to '-o enforce_permissions'
- Improve clarity of the option name: 'default_permissions' is a
  misnomer as it must be explicitly requested and actually signals that
  the kernel should enforce standard UNIX permissions.
- Maintain 'default_permissions' as a hidden alias for backward
  compatibility.
- Update documentation and integration tests.
- Align internal variable names for consistency.
2026-05-24 15:03:06 +10:00
François Degros 4b13a49b4b Sanitize PATH for external decompression filters
- Prevent local code execution via PATH poisoning by hardcoding a safe
  system PATH (/usr/bin:/bin:/usr/local/bin) when external filters are
  enabled.
- Include Homebrew and MacPorts paths in sanitized PATH on macOS.
- External filters remain enabled by default for parity with standard
  tools like bsdcat, but are now isolated from the ambient environment.
- Add integration test to verify that parasitic programs in the caller's
  PATH are ignored.
- Update documentation to accurately reflect PATH sanitization.
2026-05-24 15:02:34 +10:00
François Degros 63f331d775 Add -o noexternal option to disable external decompression filters
- Introduce the 'noexternal' mount option which clears the PATH
  environment variable. This prevents libarchive from finding and
  executing external programs (like gzip, xz, etc.) for decompression.
- Update PrintUsage() and README.md to document the new option.
- Add integration test case in tests/test.py to verify environmental
  isolation.
2026-05-22 16:50:04 +10:00
François Degros f754728f12 Enhance GetTree resilience and clean up test.py
- Add error handling to GetTree when scanning directories. This allows
  capturing and verifying OSErrors (stored as 'errno' in the tree)
  instead of crashing the test runner.
- Align GetTree logic with mount-zip for better project consistency.
- Reformat long lines and remove redundant whitespace for PEP 8
  compliance.
- Improve logging messages in TestBigArchiveStreamed.
2026-05-21 15:27:56 +10:00
François Degros c31d7c1b7a Improve sparse seek error verification in test.py
- Test both SEEK_DATA and SEEK_HOLE for out-of-bounds errors.
- Use actual file size (st.st_size) instead of a hardcoded offset.
- Fix platform-specific errno verification to correctly use want_errno
  (EINVAL on macOS, ENXIO on Linux).
2026-05-21 10:42:51 +10:00
François Degros 27a902747a Enhance sparse file verification in test.py
- Add GetHoleMap to verify the actual sparse structure using lseek().
- Implement a has_holes guard based on FUSE version and OS platform.
- Add TestSparse() to verify sparseness preservation for precache/memcache
  and proper fallback for lazycache/nocache.
- Move path definitions to the top of the script for better maintainability.
2026-05-19 16:58:38 +10:00
François Degros d5912d7670 Refactor struct Node 2026-05-17 21:49:25 +10:00
François Degros cf02a8952a Rename test directory to tests 2026-05-12 16:32:41 +10:00
François Degros 4634b3c4bb Reformat test/test.py 2026-05-12 16:31:50 +10:00
François Degros 5b2140f31e Optimize some unit tests to increase code coverage 2026-05-12 14:19:30 +10:00
François Degros 5131ff55ae Migrate project to C++23
- Standardize on -std=c++23 across all targets.
- Verified compatibility with GCC 15.2.0.
2026-05-11 11:48:17 +10:00
François Degros 4a888792dc Make GoogleTest an optional build dependency
- Update Makefile to detect gtest using pkg-config.
- Suppress pkg-config error messages when gtest is missing.
- Conditionally build and run unit tests only if gtest is found.
- Update INSTALL.md to list gtest as a dependency for unit tests.
2026-05-11 11:48:10 +10:00
François Degros f7394bc78c Fix FUSE 2 compatibility and ASAN leaks in help/version
- Fix readdir filler lambda signature for FUSE 2 in unit tests.
- Change '-ho' to '-h' for FUSE 2 help output.
- Use _exit(EXIT_SUCCESS) in help/version paths for FUSE 2 to bypass
  known libfuse2 leaks caught by ASAN.
2026-05-11 11:46:14 +10:00
François Degros 9b3279506a Expand FUSE operation unit tests
- Add GetAttrByFi test to verify attribute retrieval via fuse_file_info.
- Add OpenDir tests to verify error handling for non-existent paths and
  non-directory nodes.

Expand GetXattr unit tests

- Add a test case for requesting an attribute that exists on a different node.
- Define ENOATTR for better compatibility on Linux.
- Use ENOATTR instead of ENODATA in expectations to match fuse_ops.cc.
2026-05-07 15:46:20 +10:00
François Degros 9b656c4568 Refactor command-line option parsing for clarity and type safety
- Direct-map FUSE options to Context fields using offsetof.
- Use explicit int casts for scoped enums in the fuse_opt table.
- Add static assertions to ensure enum/int size compatibility.
- Add '-o precache' option for explicit default cache selection.
- Simplify ProcessArg by removing manual enum mapping logic.
2026-05-07 15:15:08 +10:00
François Degros 026f4c474a Enhance unit tests 2026-05-07 11:06:16 +10:00
François Degros 86f9fae7f8 Repair some of the inadvertent modifications
That happened when the code was modularized.
2026-05-04 18:03:55 +10:00
François Degros e086a3212e Add test for RPM format 2026-05-04 18:02:29 +10:00
François Degros 3718dc08ee Refactor sparse seek logic, expand unit tests, and standardize FUSE error handling
This commit consolidates several improvements to library robustness and
FUSE compliance:

- Core Logic: Centralized SEEK_DATA/SEEK_HOLE navigation in
  Node::SparseSeek and verified with exhaustive boundary tests.
- Testing: Expanded test/unit_tests.cc to cover Path normalization
  (including UTF-8/ZWJ safety), Tree trimming, and Reader recycling
  logic.
- FUSE Integration: Standardized callback return codes (EINVAL for
  readlink on non-symlinks, ENOATTR for missing attributes) and improved
  exception handling to distinguish OOM (ENOMEM) from internal errors.
- Diagnostics: Configured coverage reports to include DEBUG-only paths
  and verified all enum-to-string mappings.
- Automation: Added FUSE-level negative tests to verify error
  propagation across the filesystem boundary.
2026-05-04 16:12:24 +10:00
François Degros e1db2ac54e Add format and check-format targets to Makefile
- Define 'format' target to apply clang-format to all C++ files.
- Define 'check-format' target to verify formatting without modifying files.
- Use '.clang-format' configuration file for style rules.
- Update DEVELOPMENT.md with formatting targets
- Update INSTALL.md with clang-format prerequisite
2026-05-04 10:57:31 +10:00
François Degros ab31b8823c Introduce Google Test framework and add unit tests
- Add Google Test (gtest) and gtest_main as dependencies in the
  Makefile.
- Define a new 'unit_test' target that builds and runs a C++ unit test
  program.
- Integrate 'unit_test' into 'make check' and 'make check-fast' to
  ensure unit tests run before Python integration tests.
- Add an initial 'test/unit_test.cc' with a dummy test case to verify
  the framework setup.
- Update DEVELOPMENT.md to distinguish between Unit Tests (C++) and
  Integration Tests (Python).
- Update INSTALL.md to list GoogleTest as a build prerequisite and
  include the libgtest-dev package for Debian systems.
- Implement comprehensive unit tests for 'Path' (normalization,
  splitting, extensions), 'HashedString' (deduplication, hashing), and
  'Util' (safe arithmetic, string manipulation, hole accounting).
- Correct 'Path' test expectations to align with the library's security-
  conscious normalization logic (e.g., converting '..' components to
  '?').
- Add 'friend' declarations to 'FileDescriptor' and 'Tree' classes to
  enable targeted unit testing of internal logic.
- Implement 'FileDescriptorTest' to verify sparse file write logic
  (WriteBytesAndSkipHoles) and basic I/O operations.
- Implement 'TreeTest' using a test fixture with protected wrapper
  methods to verify private directory management (GetOrCreateDirNode)
  and collision resolution (RenameIfCollision).
- Implement 'NodeTest' to verify 'GetBlockCount' logic, covering empty,
  dense, sparse, and terminal hole cases.
- Implement 'TreeTest::Trim' to verify the collapsing of redundant
  single-child directory hierarchies.
- Refined test setup to correctly establish parent-child relationships
  and path metadata when manually constructing the virtual tree.
- Implement 'TreeTest::ResolveHardlinks' to verify the two-phase hardlink
  resolution logic, ensuring correct inode sharing and nlink counts.
- Implement 'TreeTest::ReaderRecycling' to verify that Reader objects are
  properly returned to the pool and reused.
- Implement 'TreeTest::ReaderBestMatch' to verify the optimization logic in
  'GetReader' that selects the best available reader based on its current
  position and buffer coverage.
- Add 'friend' declaration to 'Reader' to enable detailed state verification.
2026-05-04 10:57:00 +10:00
François Degros 198ee83f12 Optimize terminal hole handling and refine sparse file navigation
Transition to a dynamic terminal hole model where sparse regions at the
end of a file are tracked via Node::last_hole_start instead of being
stored in the interior holes vector. This optimization applies to
terminal holes of any size and streamlines filesystem statistics and
navigation.

Key changes:
- Implement Node::IsFullyCached() and Node::GetSizeToLastHole() for
  dynamic sparse region detection.
- Refine GetBlockCount to correctly exclude the terminal hole from tree-
  wide statistics.
- Update lib/fuse_ops.cc:Seek to correctly navigate both interior and
  terminal holes for SEEK_DATA and SEEK_HOLE.
- Atomize cache state updates within Reader::CacheEntryData and improve
  error recovery for partial cache states.
- Simplify Hole::GetSavedBlocks to calculate savings solely from hole
  boundaries.
- Add diagnostic logging to Seek tests in test/test.py.
2026-05-03 21:24:28 +10:00
François Degros 9aa44a9c6d Modularize fuse-archive into a library and slim CLI wrapper
This comprehensive refactoring transforms the monolithic fuse-archive
into a modular, memory-safe library (libfuse-archive.a) and a
lightweight CLI wrapper.

Key Improvements:
- **State Encapsulation**: All virtual filesystem state (options, nodes,
  readers, cache, and passwords) is now managed within a self-contained
  'Tree' class.
- **Memory Safety**: Redesigned command-line option parsing to prevent
  heap corruption during 'fuse_opt_parse' and verified clean execution
  with ASAN and UBSAN.
- **Automated Resource Management**: Leveraged intrusive containers and
  RAII-compliant nested destructors to automate the lifecycles of Nodes
  and Readers.
- **Component Isolation**: Extracted FUSE operations, archive reading,
  and utility functions into dedicated modules (tree, reader, node,
  fuse_ops, util, etc.).
- **Refined API**: Simplified the library interface; 'Tree::Load' now
  accepts simple paths, internalizing the complexity of descriptor
  management and archive configuration.
- **Technical Integrity**: Maintained 100% functional parity with the
  original implementation, as verified by the full test suite.
2026-05-03 21:23:20 +10:00
François Degros 2307c9d57f Rename ScopedFile to FileDescriptor for technical accuracy 2026-04-30 23:08:48 +10:00
François Degros 11a02ba58e Add valgrind target and MOUNT_WRAPPER support
Added a 'valgrind' target to the Makefile and support for a
'MOUNT_WRAPPER' environment variable in test.py. This allows wrapping
the fuse-archive process with Valgrind during integration tests to check
for memory leaks.
2026-04-30 22:42:39 +10:00
François Degros f71f711c16 Add support for UBSAN=1 to the Makefile 2026-04-30 22:41:54 +10:00
François Degros 1564efe4e0 Tweak some comments 2026-04-30 10:41:13 +10:00
François Degros d0c2b14709 Update documentation to include high-precision timestamps feature 2026-04-29 23:22:52 +10:00
François Degros 11b79181b4 Implement RAII memory management and timespec precision
This commit aligns fuse-archive with mount-zip's optimized architectural
model:
- Establishes parent-child relationships and path hashes before tree
  attachment.
- Standardizes on RAII memory management using Node::Ptr (unique_ptr).
- Transitioned from time_t to timespec for full nanosecond precision.
- Reordered Node members for optimal alignment (16/8/pointer/4
  grouping).
- Modernized logging with a throttled Beat class and ephemeral progress
  updates.
- Adjusted test suite to handle nanosecond precision gracefully. Updated
  CheckTree to allow second-precision matching when the expected
  timestamp has zero nanoseconds. This ensures that tests remain robust
  across different archive formats and library versions that may or may
  not provide nanosecond resolution, while still allowing for exact
  matching if non-zero nanoseconds are specified in the test
  expectations.
2026-04-29 23:21:15 +10:00
François Degros 34b1964139 Standardize on Copy Model for hard link metadata
- Update ResolveHardlinks to explicitly clone all metadata from target
  to link node.
2026-04-29 21:31:26 +10:00
François Degros a268ab242d Introduce Stat and StatVfs aliases for better readability and consistency
- Add high-level type aliases for struct stat and struct statvfs.
- Replace all occurrences of struct stat/statvfs with Stat/StatVfs.
2026-04-29 21:25:46 +10:00
François Degros daf80a1d2d Optimize readdir with conditional FUSE_FILL_DIR_PLUS
- Honor FUSE_READDIR_PLUS flag in ReadDir: only provide stat info if
  requested.
- Fix bug where uninitialized stat buffer was passed to the filler in
  non-plus mode.
- Correctly handle '.' and '..' entries with conditional metadata
  preparation.
2026-04-29 21:24:21 +10:00
François Degros ee21eab471 Fix potential signed integer overflows 2026-04-29 14:19:53 +10:00
François Degros 74481f9c8b Add regression test for integer overflows 2026-04-29 10:59:34 +10:00
François Degros ba664e3440 Add -o nobidding option 2026-04-28 17:34:07 +10:00
François Degros 1d8b84b9b3 Add support for .bz file extension 2026-04-28 14:55:39 +10:00
François Degros e76afd28a6 Update documentation to clarify native vs external filter support
- Refined README.md to map external tools to specific extensions.
- Explicitly mentioned that UU, Lzip, XZ, etc., are handled natively.
- Updated INSTALL.md to distinguish between core requirements and
  optional test tools.
- Regenerated man page.
2026-04-26 19:39:39 +10:00
François Degros ee43dff7f1 Expand supported filename extensions and refine seekable format handling
- Added recognition for many application packages (apk, aab, ipa, whl,
  xpi) and document formats (epub, docx, odt, etc.).
- Renamed filtered_zip to is_seekable_format and pruned seekable_exts to
  core archive types (7z, zip, jar, war, ear).
- Added TAR shorthands: tlrz (LRZIP), tlzo (LZOP), and tlzop (LZOP).
- Added format aliases: cbr (RAR-based) and lzh (LHA-based).
- Checked in permanent test symlinks in test/data for all new
  extensions, including mixed-case .taZ and .apk.gpg.
- Added TestFilteredOpaque to verify that specialized formats remain
  opaque when filtered.
- Added cross-archive collision test case to TestMultiArchive.
- Updated documentation with categorized and alphabetized extension
  lists.
2026-04-26 19:39:14 +10:00
François Degros 08039f4ba1 Robustly handle ambiguous .tlz extension
- Register only likely LZ-based filters (lzma, lzip, lzop, lz4) for .tlz
  files.
- Omit r.Check() to allow mounting even if some filters are not
  supported by the local libarchive build.
- This ensures maximum compatibility across different Linux
  distributions while strictly honoring the 'LZ' hint in the extension.
2026-04-26 18:02:51 +10:00
François Degros 2858731d78 Refine global teardown logic for ASAN builds
- Moved g_unique_strings to heap-allocated pointer to control
  destruction order.
- Ensure all virtual node children are cleared before tree disposal.
- Added Reader::EmptyRecycleBin() to deallocate cached reader objects.
- Explicitly delete the string pool during teardown.
- This ensures a perfectly clean state for AddressSanitizer at exit.
- Renamed 'cleanup' to 'mount_point_guard' for clarity in main().
- Updated DEVELOPMENT.md with comprehensive shutdown teardown details.
2026-04-26 16:23:03 +10:00
François Degros 83dcb74e3c Add DEVELOPMENT.md guide and AGENTS.md pointer
- Created DEVELOPMENT.md as a generic technical guide for all
  contributors.
- Documented project overview, versioning, build system, and technical
  standards.
- Updated release.py to maintain version in DEVELOPMENT.md.
2026-04-26 16:20:53 +10:00
François Degros b16a337336 Add release automation script and Makefile target
- Implement release.py to automate version bumping, date updating, man
  page regeneration, and Git operations.
- Support automatic version detection and suggestion for the next stable
  release.
- Add confirmation prompt to release.py for safety.
- Integrate release script into Makefile via 'release' target.
- Make man page preview optional in 'make doc' via QUIET=1 and use it in
  the release script.
2026-04-26 10:47:31 +10:00
François Degros b438d32670 Start development version 1.21
- Bump version to 1.21 in source code and documentation.
- Regenerate man page.
2026-04-26 10:44:12 +10:00
François Degros 6ca4b20685 Release version 1.20
- Bump version to 1.20 in source code and documentation.
- Update date to April 2026 in documentation.
- Regenerate man page.
2026-04-26 10:43:50 +10:00
François Degros aa508406e5 Improve man page generation and documentation formatting
- Add sed post-processing to Makefile to produce compact lists in the
  man page.
- Fix Markdown formatting in README.md by adding missing blank lines
  before lists.
2026-04-26 10:42:44 +10:00
François Degros aaf71f6674 Improve Makefile structure, conventions, portability, and memory safety
- Implement standard DESTDIR and PREFIX handling for installations.
- Separate mandatory build flags from user-provided variables (CXXFLAGS,
  LDFLAGS).
- Add ASAN=1 option for AddressSanitizer support.
- Fix memory leaks in g_unique_strings and the Node tree for ASAN
  compliance.
- Implement conditional RAII cleanup in main() using Boost Intrusive
  dispose logic, active only in ASAN builds for optimal exit
  performance.
- Fix a memory safety bug in main() when handling --help/--version by
  avoiding unsafe const_cast and ensuring heap-allocated argv[0] is
  restored before freeing.
- Add -D_TIME_BITS=64 to support 64-bit timestamps on 32-bit systems
  (Year 2038).
- Add clean-data target for optional removal of large test archives.
- Add test target as an alias for check.
- Update .PHONY list with all non-file targets.
- Use rm -f and standard paths in uninstall target.
2026-04-25 22:34:42 +10:00
François Degros 258e30690f Comprehensive README documentation update
- Added USAGE EXAMPLES with common and advanced scenarios.
- Added detailed FEATURES list.
- Enhanced GPG and native ENCRYPTION documentation.
- Expanded CACHING section with strategy and storage details.
- Added ARCHIVE TREE STRUCTURE explaining merging and trimming.
- Added LOG MESSAGES section for troubleshooting.
- Refined ARCHIVE FORMATS to reflect dependency-based support.
- Documented automatic mount point creation and cleanup.
- Added COMPARISON table with similar tools.
2026-04-25 20:58:38 +10:00
François Degros f0f40168e7 Fix FUSE major version detection in tests
- Reuse the existing 'sr' variable containing 'fuse-archive --version' output.
- Make version parsing robust to optional colons.
2026-04-25 16:14:34 +10:00
François Degros 80577af0a5 Fix some comments in tests 2026-04-24 23:36:37 +10:00
François Degros 025b07e581 Change libarchive threshold for a workaround 2026-04-24 23:36:11 +10:00
François Degros 00e03fa962 Work around libarchive issue 2514 only if necessary 2026-04-24 18:02:06 +10:00
François Degros 477f22636f Proofread and refine documentation
Fixed typos, grammar, and punctuation in README.md and INSTALL.md.
Standardized header formatting in INSTALL.md.
Clarified that -o memcache is Linux-only in README.md.
Add GPG INTEGRATION section to README.md
Updated documentation date to April 2026.
2026-04-24 16:40:14 +10:00
François Degros 16330a8e15 Implement -o memcache using memfd_create
Modified CreateCacheFile() to use memfd_create(2) on Linux when memcache
is enabled.
Integrated memcache cases into the test suite in test/test.py.
Added has_memcache check in test.py to skip memcache tests on non-Linux
platforms.
2026-04-24 16:39:18 +10:00
François Degros a3698f5904 Add tests for multi-archive, path options and special permissions
- Implemented TestMultiArchive to verify -o nomerge and -o notrim behavior.
- Added gzipped multi1.tar.gz and multi2.tar.gz for path-related testing.
- Implemented TestSpecialPermissions to verify SUID, SGID and sticky bits.
- Added gzipped special_perms.tar.gz with various permission combinations.
- Added FUSE version detection in test.py to skip TestSeek on FUSE < 3.
- Updated TODO.md to mark these tasks as completed.
2026-04-24 15:36:44 +10:00
François Degros d1269e222e Enhance tests and fix seeking logic for sparse files
Added TestSeek to verify lseek(SEEK_DATA) and lseek(SEEK_HOLE).
Created seek.tar.gz with complex sparse file patterns.
Fixed Seek() to correctly return ENXIO when SEEK_HOLE is called at EOF.
Implemented MountArchive context manager in test.py for better test hygiene.
2026-04-24 14:50:24 +10:00
François Degros 77142a9e65 Add -o noholes command line option 2026-04-24 14:23:04 +10:00
François Degros 6c937329e0 Enhance tests to check for hardlink attributes and improve argument handling
- Updated test/test.py to capture blocks and xattrs during scans.
- Added compressed xattr_hardlinks.tar.gz archive for attribute testing.
- Updated TestHardlinks to verify attribute consistency for hardlinks,
  conditioned on gzip/zlib availability.
- Updated existing TestHardlinks expectations to include blocks and xattrs.
- Replaced manual sys.argv check with argparse for --fast and added --verbose.
2026-04-24 13:51:58 +10:00
François Degros f9ac065315 Refactor CacheEntryData to maintain saved_blocks via callback
Update CacheEntryData to accept an optional Node pointer instead of a
Holes vector pointer. This allows CacheEntryData to update the node's
saved_blocks count directly within the hole-discovery callback,
avoiding a redundant post-caching loop in ProcessEntry.
2026-04-24 12:27:17 +10:00
François Degros dd7ac9fd50 Fix consistency of attributes for hardlinks
Updated ListXattr, GetXattr and ReadDir to look at the target node for
each directory entry. This ensures that hardlinks correctly report
metadata updates (such as reduced block counts from sparse hole
detection) that occur on their target node during lazy caching,
maintaining consistency between directory listings and direct stat
calls.
2026-04-24 12:13:48 +10:00
François Degros d8008ef12b Add ScopedFile::Truncate() 2026-04-24 12:08:01 +10:00
François Degros 5dd70ad156 Fix lseek FUSE callback 2026-04-23 23:55:02 +10:00
François Degros 968c5cb0aa Add Node::saved_blocks 2026-04-23 22:55:13 +10:00
François Degros aea58f9092 Keep track of holes in sparse files
https://github.com/google/fuse-archive/issues/41
2026-04-23 17:26:53 +10:00
François Degros 9eddc42c21 Remove dead code 2026-04-23 17:26:42 +10:00
François Degros 469a2d84b3 Don't use heap poisoning with lrzip
https://github.com/ckolivas/lrzip/issues/266
2026-04-23 16:19:04 +10:00
François Degros 5d8ec44c46 Format code with clang-format 2026-04-23 16:18:47 +10:00
François Degros 2ac57f406c Skip big holes when caching data
Added ScopedFile::WriteBytesAndSkipHoles().
2026-04-22 16:58:10 +10:00
François Degros 1d81a05c05 Add a trivial lseek implementation
This lseek implementation is only available with FUSE 3.

Pretty print the SEEK_* enum values in logs
2026-04-22 15:23:05 +10:00
François Degros 02484341f6 Use const for unchanging local variables and struct members 2026-04-22 14:41:03 +10:00
François Degros 8b19c6e1b7 Improve code comments and documentation 2026-04-22 14:21:08 +10:00
François Degros 11961f026f Optimize format mapping functions
Replaced `std::function<void(Reader&)>` with lightweight function
pointers `void (*)(Reader&)` in format mapping dictionaries. This avoids
dynamic allocation and overhead from std::function, making the static
initialization more efficient and idiomatic.
2026-04-22 13:30:09 +10:00
François Degros 90c12b81cc Add missing transitively included standard headers
Added <cctype> for std::iscntrl.
Added <iterator> for std::next.
Added <new> for std::bad_alloc.
2026-04-22 13:30:02 +10:00
François Degros df5fcefb1d Add tests for -o maxfilters=N 2026-04-22 13:29:28 +10:00
François Degros c66788808f Don't use MALLOC_PERTURB_ for fast tests
Bug: https://github.com/ckolivas/lrzip/issues/266
2026-04-16 16:29:56 +10:00
François Degros 5fa9c0aca9 Add ScopedFile::Write()
Remove duplicated code.
2026-04-16 16:26:38 +10:00
François Degros e88f41b2a3 Make tests more robust 2026-04-13 10:39:33 +10:00
François Degros 6512efcecc Simplify tests 2026-04-09 21:27:04 +10:00
François Degros f20c358d5b Don't use '--' in tests
It doesn't work with FUSE 2
2026-04-08 23:09:40 +10:00
François Degros f6ebe30e7c Add -o maxfilters option
It is now possible to specify more than one filter.
2026-04-06 22:24:42 +10:00
François Degros dc32b5ff97 Add and use ScopedFile 2026-04-05 04:34:14 +10:00
François Degros 6dd0c5a114 Remove an incorrect debug assertion 2026-03-30 14:19:43 +11:00
François Degros 6be82a38d1 Work around libarchive issue 2513 only if necessary
Bug: https://github.com/libarchive/libarchive/issues/2513
2026-03-30 12:00:55 +11:00
François Degros 3f0b7efd6d Handle filtered ZIPs 2026-03-30 12:00:31 +11:00
François Degros 1a9d385b22 Support more formats than just TAR after a filter 2026-03-28 17:40:45 +11:00
François Degros 3b7c240321 Update tests 2026-03-25 11:53:26 +11:00
François Degros bf69c7e517 Fix tests when libarchive does not have zlib support 2026-03-25 00:02:58 +11:00
François Degros abc6514a2c Remove filename extension with -o nomerge 2026-03-25 00:02:40 +11:00