Repository navigation
Conversation
A special backup reported success even when nothing usable was written: there was no crypto check, archive failures were dropped silently, the tar exit status was masked, and the only test was a non-empty manifest. - Check crypto_available up front when a passphrase is set. - Use the same .trc sentinel and read-back check as archive_dir for each archive; a failure removes that archive and fails the backup. - Fail when a selected category produced no item. - A failed special backup removes its incomplete directory. Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend #13.
do_special_backupcould finishokwithitems:[]or with truncated archives: nocrypto_availablecheck (unlike the other encrypting verbs), eachtar | comp | enc_agefailure onlycontinued inside a subshell, tar's own exit was masked by the pipe, and the only success test was[ -s manifest.json ].crypto_availableis checked first (ERR_CRYPTO_UNAVAIL, existing message).archive_dir: the.trcsentinel for a fatal tar exit (>1; exit 1 for files changing under tar is still fine), and a read-back withtar -t(throughdec_agewhen encrypted). A failure removes that archive and marks the backup failed.system_settingscounts only when it was opted in..special/<ts>directory is removed and the op ends withERR_BACKUP.The per-path loop runs in a pipe subshell, so the failure is passed out through a
.sfailfile in the backup dir.Testing
sh -n,mksh -n,busybox sh -n;shellcheck -s sh: one more SC2016 note (jq$cin single quotes, like the rest of the file).do_special_backupwith stubbedspecial_paths/media_own, real tar, zstd, age 1.2.1 andscript, under mksh R59, busybox 1.37 ash and dash: plain 2-category backup ok with 2 items; encrypted backup ok and its archive opens with the passphrase; missing crypto givesERR_CRYPTO_UNAVAIL; a category with no path, a fatal tar exit and a truncated archive each giveERR_BACKUPand leave no backup dir.