Repository navigation
fix(io): read extended attribute sizes with the size query - #100
Merged
Merged
Conversation
rustix 1.1.6 no longer treats an empty buffer as a size query: getxattr with an empty buffer now reads 0 bytes. Our attribute copy asked for the size that way, so with 1.1.6 every extended attribute (Finder tags and comments, the resource fork) would be carried as empty, with no error. xattr 1.6 has the same problem when listing names, so it would list none. Ask with lgetxattr_query instead, and require xattr 1.7 and rustix 1.1.6 together, so that neither can be updated alone into the broken pairing. The written bytes are the same as before on the old versions. Signed-off-by: Ilham Deneri <ilhamdeneri@gmail.com>
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.
Summary
rustix 1.1.6 changed
getxattr,lgetxattr,fgetxattrandlistxattr: an empty buffer is no longer a size query, it reads 0 bytes, and the size comes from the new*_queryfunctions. The extended-attribute copy in the write transaction asked for an attribute's size with an empty buffer. Under 1.1.6 every attribute would be carried as empty, with no error: Finder tags and comments, and the resource fork. xattr 1.6 asks the same way when listing names, so it would list none. The pending dependency update pulls rustix 1.1.6, and its tests fail on exactly this, intxn::metaand in the in-place and folder copies.This reads the size with
lgetxattr_query(andgetxattr_queryin the resource fork test helper). It also requiresxattr = "1.7"(which uses the query functions) andrustix = "1.1.6"together in the workspace manifest, so neither crate can be updated alone into a broken pairing.User-visible behaviour
None. On the old versions the written bytes were already right; this keeps them right on the new ones.
Tests run
The existing tests are the check. With rustix 1.1.6 and the old size request,
txn::meta::tests::provenance_is_left_to_the_system_without_a_note,a_wav_is_changed_in_place_backed_up_and_undone,an_aiff_is_changed_in_place_backed_up_and_undone,a_flac_is_changed_in_place_backed_up_and_undoneandcopy_to_a_folder_leaves_the_source_and_never_overwritesfail with an attribute read back empty. With xattr 1.6.1 and rustix 1.1.6 the same tests fail. With this change all ofsc-iopasses.Output change
Output-Change: yes; this ships in a minor release.Docs and dependencies
docs/PRODUCT.md/docs/ARCHITECTURE.mdupdated if behaviour or crate boundaries changed: no change needed.