Repository navigation
fix(support-bundle): omit macOS AppleDouble files from the diagnostics archive - #6159
Closed
roshangupta00750 wants to merge 1 commit into
Closed
roshangupta00750 wants to merge 1 commit into
roshangupta00750 wants to merge 1 commit into
Conversation
…chive On macOS, `tar` is bsdtar, which embeds AppleDouble `._*` companion files for any bundled file carrying extended attributes. The support bundle collects config, logs and command output from paths that routinely have xattrs (quarantine, provenance), so the archive can ship a `._*` sibling next to real bundle members. `tar -tzf` hides those entries, so they are invisible until the bundle is unpacked or read by tooling that does not filter them: Python's `tarfile` and `zipfile`-style walkers see them raw. The result is binary junk files scattered through a diagnostics archive a maintainer has to read, and decode errors in anything that treats bundle files as text. Set `COPYFILE_DISABLE=1` on the archive creation, matching the guard already applied to the backup archive in `ods-backup.sh`. GNU tar ignores the variable, so Linux behaviour is unchanged. Adds two assertions to tests/test-support-bundle.sh: the produced archive carries no `._*` members, and the archive is created under the guard. The second is deterministic on Linux CI, where bsdtar's behaviour cannot be reproduced, so a future edit dropping the guard fails there.
roshangupta00750
force-pushed
the
fix/support-bundle-appledouble
branch
from
September 29, 2026 12:10
1352fc1 to
5235a90
Compare
Collaborator
|
Thanks for this contribution. |
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.
Support bundles are the artifact users attach to a bug report, so whatever lands in the tarball is what a maintainer reads.
Problem
scripts/ods-support-bundle.shcreates the archive with a baretar:On macOS
taris bsdtar, which writes an AppleDouble._<name>companion member for every archived file that carries extended attributes. The bundle is assembled from config, logs and command output under paths that routinely pick up xattrs (quarantine and provenance attributes), so those companions end up inside the archive next to real members.They are easy to miss because
tar -tzffilters._*entries out of its own listing — the archive looks clean while the members are present. They reappear when the bundle is unpacked, and any consumer that walks the tar without filtering (Pythontarfile, for one) sees them raw: binary blobs sitting next to each real file, which break tooling that decodes bundle files as text.The same construct in
ods-backup.shwas fixed for this reason in #5765. This is the remaining unguarded archive writer.There is independent evidence in the repo that the gap is reachable: the new test added by #5873 has to pass
COPYFILE_DISABLE="1"in the subprocess environment to keep its own support-bundle run clean. That works for that one call site; every other invocation — including a user running the script by hand to attach a bundle to an issue — is still unguarded.Fix
Set the variable on the archive step itself, so the guarantee holds for every caller rather than for the callers that remember:
GNU tar has no such behaviour and ignores the variable, so Linux is byte-for-byte unchanged.
Tests
Two assertions added to
tests/test-support-bundle.sh, which already builds a real archive and lists its members:(^|/)\._. This has teeth on macOS.COPYFILE_DISABLE. bsdtar behaviour cannot be reproduced on Linux CI, so without this a regression would pass there unnoticed; with it, any future edit dropping the guard fails intest-linux.yml.Validation
shellcheck -S styleNo conflict with #5873: that PR edits
read_env_valuenear line 298, this one the archive step near line 818.