Skip to content

fix(io): read extended attribute sizes with the size query - #100

Merged
wow merged 2 commits into
mainfrom
fix/xattr-size-query
Nov 5, 2026
Merged

wow merged 2 commits into
mainfrom
fix/xattr-size-query

Conversation

@wow

@wow wow commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

rustix 1.1.6 changed getxattr, lgetxattr, fgetxattr and listxattr: an empty buffer is no longer a size query, it reads 0 bytes, and the size comes from the new *_query functions. 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, in txn::meta and in the in-place and folder copies.

This reads the size with lgetxattr_query (and getxattr_query in the resource fork test helper). It also requires xattr = "1.7" (which uses the query functions) and rustix = "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

PASS  file-size               13s
PASS  test-files               0s
PASS  cargo-fmt                2s
PASS  cargo-clippy            16s
PASS  cargo-test             147s
PASS  fe-typecheck             5s
PASS  fe-lint                  5s
PASS  fe-test                 14s
RESULT PASS

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_undone and copy_to_a_folder_leaves_the_source_and_never_overwrites fail with an attribute read back empty. With xattr 1.6.1 and rustix 1.1.6 the same tests fail. With this change all of sc-io passes.

Output change

  • No: the same input still yields the same numbers, grids and bytes.
  • Yes: goldens regenerated and reviewed; the commit carries Output-Change: yes; this ships in a minor release.

Docs and dependencies

  • docs/PRODUCT.md / docs/ARCHITECTURE.md updated if behaviour or crate boundaries changed: no change needed.
  • New dependencies, with licence: none. xattr 1.6.1 to 1.7.0 (MIT OR Apache-2.0), rustix 1.1.5 to 1.1.6 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT).

wow added 2 commits November 5, 2026 22:29
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>
@wow
wow merged commit eab90bd into main Nov 5, 2026
8 checks passed
@wow
wow deleted the fix/xattr-size-query branch November 5, 2026 22:09
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.

1 participant