Skip to content

illumos/Solaris: add xattr support, see #1337 - #10102

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:solaris-xattr-1337
Aug 14, 2026
Merged

ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:solaris-xattr-1337

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Add xattr support for illumos / Solaris derivatives, see #1337.

On these platforms, the extended attributes of a file are regular files inside a hidden attribute directory attached to that file, accessed by giving O_XATTR to open(2)/openat(2), see fsattr(7). Thus this can be implemented in pure Python (new src/borg/platform/solaris.py, no C extension): xattr names/values map to the names/contents of the files in the attribute directory.

  • listxattr: list the attribute directory, hiding the SUNWattr_* "extended system attributes" the OS maintains in there.
  • getxattr: read the attribute file (missing attribute file → ENOATTR); values are limited to 16 MiB, like on the other platforms.
  • setxattr: create/overwrite the attribute file (refusing names unusable as file names, and SUNWattr_*).
  • symlinks cannot have extended attributes on these platforms: listxattr returns an empty result for them, and the set-xattr-on-symlink parts of the xattr tests are now gated accordingly.
  • filesystems without xattr support (e.g. tmpfs): ENOTSUP.

With this, xattr.is_enabled() returns True on ZFS, so the xattr tests and the archiver tests' xattr comparisons now actually run in the omniOS CI job (its TMPDIR is ZFS-backed). The job now also probes/logs xattr support on TMPDIR via runat(1). Docs: platform support matrix updated.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.91549% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.02%. Comparing base (b893d49) to head (64d622c).
⚠️ Report is 14 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/borg/platform/solaris.py 83.33% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10102      +/-   ##
==========================================
+ Coverage   87.01%   87.02%   +0.01%     
==========================================
  Files          99      101       +2     
  Lines       17615    17730     +115     
  Branches     2664     2678      +14     
==========================================
+ Hits        15327    15429     +102     
- Misses       1593     1599       +6     
- Partials      695      702       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

xattrs on these platforms are regular files inside a hidden attribute
directory attached to each file (opened via openat(2) with O_XATTR,
see fsattr(7)), so this can be implemented in pure Python: xattr
names/values map to the names/contents of the files in the attribute
directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann merged commit 664b6ef into borgbackup:master Aug 14, 2026
19 of 20 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the solaris-xattr-1337 branch August 14, 2026 15:34
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