Repository navigation
Conversation
- Encrypted special restore piped the decrypted stream into decomp, which reads its file argument and ignores stdin, so tar got no input after the live data was already removed. Add decomp_in (stdin, codec by filename) and use it there and in archive_safe. - archive_safe only checked member paths, so a listing that failed or was empty (wrong passphrase, unreadable archive) passed and the target was wiped before extraction failed. list_safe now also requires tar -t to succeed and list at least one member; the Neo import check uses it too. - cleanup() removed staging files matching *$OPID*, so op-1 also removed op-10/op-11 files of running workers. Match .$OPID and .$OPID.* only. Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
This was referenced Nov 19, 2026
Under mksh printf is an external command, so a large listing passed as one argument hit ARG_MAX, printf failed and scan_members read an empty stdin and returned 0. Read the listing from a here-doc instead, and fail on an empty listing directly. Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
Owner
Author
|
Follow-up commit: |
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.
Fixes three cases where a restore or a finishing op deletes data it should not.
Encrypted special restore (SMS, contacts, calendar, Wi-Fi, Bluetooth): the decrypted stream went into
decomp, which reads its file argument and ignores stdin, so tar got no input after the live data was already removed. Newdecomp_indecompresses stdin and picks the codec by filename;archive_safereuses it.Restore guard:
archive_safeonly checked member paths. A listing that failed or came back empty (wrong passphrase, unreadable archive) passed, and the target was wiped before extraction failed.list_safenow also requirestar -tto succeed and list at least one member. The Neo import check uses it too.cleanup(): removed
staging/*$OPID*, so opop-1also removed staging files of runningop-10/op-11. Now matches*.$OPIDand*.$OPID.*, which covers every staging name in worker.sh.Testing
sh -non worker.sh.list_safeunder mksh and busybox sh: valid tar accepted; empty and garbage input rejected.decomp_inwith a zstd stream under mksh and busybox sh.op-1removes its own files and leavesop-10/op-11.Known limits
ERR_UNSAFE_ARCHIVErather than a passphrase error.