Skip to content

Harden descriptor validation and improve resource handling - #42

Merged
lloydsmart merged 4 commits into
developfrom
bugfix/descriptor-archive-validation-and-resources
Aug 5, 2026
Merged

lloydsmart merged 4 commits into
developfrom
bugfix/descriptor-archive-validation-and-resources

Conversation

@lloydsmart

Copy link
Copy Markdown
Owner

Summary

  • harden CUE, GDI, and CCD descriptor source-set validation
  • reject unsafe archive paths, links, and sanitised output-name collisions
  • define transactional cleanup for direct descriptor companion files
  • use available physical memory for bounded chdman thread selection
  • remove forced hunk sizes, global sync calls, and fixed sleeps
  • add documented thread and hunk-size overrides

Why

Descriptor references were resolved too loosely, companion files were not consistently validated, and archives could reach extraction without sufficient path and collision preflight. Resource selection also counted swap as usable compression memory and forced hunk sizes without measured justification.

The new validation builds a safe, complete source set before conversion or cleanup. Resource defaults now defer format-specific hunk sizing to chdman and select conservative concurrency from currently available physical memory.

Impact

Unsafe, incomplete, or ambiguous descriptor/archive inputs now fail before chdman runs and retain their originals. Successful direct descriptor conversions remove the validated source set together unless --keep-originals is enabled.

Advanced users can set CHDMAN_THREADS and CHDMAN_HUNK_SIZE; thread counts remain CPU-bounded. Dry-run output reports the effective direct-input command.

Validation

  • shellcheck chdtool.sh tests/*.sh tests/bin/*
  • complete Bash regression suite
  • focused descriptor/archive security regressions
  • focused resource-selection and command-construction regressions

Fixes #32.
Fixes #31.

Registers the focused regression suites and documents the behavior added for #31 and #32.
Removes obsolete state and unused compatibility variables introduced while addressing #31 and #32.
@lloydsmart
lloydsmart marked this pull request as ready for review August 5, 2026 10:22
@lloydsmart
lloydsmart merged commit 77896cf into develop Aug 5, 2026
7 checks passed
@lloydsmart
lloydsmart deleted the bugfix/descriptor-archive-validation-and-resources branch August 5, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: harden descriptor and archive validation perf: review chdman hunk sizes and resource management

1 participant