Skip to content

check: report invalid pack names instead of crashing - #10068

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
mr-raj12:fix-check-invalid-pack-name
Aug 9, 2026
Merged

check: report invalid pack names instead of crashing#10068
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
mr-raj12:fix-check-invalid-pack-name

Conversation

@mr-raj12

@mr-raj12 mr-raj12 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #10051.

check() decoded every name in packs/ with hex_to_bin without validating it first. A stray object whose name is not 64 hex digits raised a ValueError that aborted the whole check with a traceback, skipping every pack after it.

Now check() drops names that are not valid pack names, logs each one as an error, and verifies the rest. The check still fails (non-zero exit), so the stray object is not silently ignored.

Also adds a test: it stores one intact pack plus a stray non-hex object and checks that the error is reported and the good pack is still verified.

An object in packs/ whose name is not valid hex made check() abort via
hex_to_bin; report it as an error and continue checking the other packs.
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.77%. Comparing base (800a4b8) to head (da6f388).
⚠️ Report is 7 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10068      +/-   ##
==========================================
+ Coverage   86.76%   86.77%   +0.01%     
==========================================
  Files          98       98              
  Lines       17100    17109       +9     
  Branches     2589     2591       +2     
==========================================
+ Hits        14837    14847      +10     
  Misses       1570     1570              
+ Partials      693      692       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
ThomasWaldmann merged commit 19cb850 into borgbackup:master Aug 9, 2026
20 checks passed
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.

check: unhandled ValueError on a non-hex object name in packs/

2 participants