Repository navigation
fix: preserve extra fields in raw_copy_file_touch - #1172
Merged
Pr0methean merged 1 commit intoOct 25, 2026
Merged
Conversation
Pr0methean
approved these changes
Oct 25, 2026
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 #1170.
raw_copy_file_touchstarts from plainfile.options()and copies the comment, so custom extra fields disappear when changing an entry's date or permissions. For example, an allowed field with ID 87 and dataabcsurvives ordinary raw copy but is absent aftertouch. The same behavior drops Info-ZIP's0x7875UID/GID field.Reuse
raw_copy_options, which already supplies comments and serializable extra fields for ordinary raw copy and rename, before applying the requested date and mode. Remove the duplicate comment assignment. The existing timestamp, permission, stored-name, encoding-flag and raw-data paths remain in place; this does not introduce a new extra-field serialization policy.Extend the end-to-end date/permission test with a custom field and comment. Against the original production code, the date/mode/compression/comment assertions pass and the new extra-field equality assertion fails (
Some([87, 0, 3, 0, 97, 98, 99])versusNone); ordinary raw-copy controls pass. After the fix, the full 16-case end-to-end target passes without default features and with all features on Linux amd64/Rust 1.88.0, 1.99.1, and installed 1.101.0-nightly (2026-10-18).An independent public-API probe also finishes and reopens copies of an actual Info-ZIP 3.0 archive: copy/rename/touch retain the six-byte payload, stored name and
0x7875; touch honors the requested date and mode.Linux amd64/Rust 1.99.1: complete test runs pass with no default features, default features, all features, and no default features plus
deflate-zopfli, including doctests (RUSTFLAGS=-Dwarnings). Formatting checks pass on all three installed toolchains. Focused Clippy passes in no-default/default/all-feature modes; all-target Clippy passes with default/all features.Rebased onto the current CI-only upstream update before opening this PR. Library/test trees and the root manifest are unchanged by that update, and the patched source fingerprints match the tested versions.
With no default features, all-target Clippy reports the unchanged
field_reassign_with_defaulterror atsrc/extra_fields/extra_field.rs:364, also reproduced on the pristine base. Documentation completes in all three modes with the existing private-link warning atsrc/result.rs:35, likewise reproduced on the pristine base. No Windows, macOS, other-target, Miri or fuzzing results are claimed locally; the full upstream CI matrix remains to run.Disclosure: this investigation, implementation, tests and PR were produced autonomously by an AI coding agent under the account owner's authorization. An independent AI static review found no actionable issues; no human review is claimed.
Need help on this PR? Tag
@codesmith-botwith what you need.