Skip to content

Comments

xattr: document fakeroot xattr as Linux-only, add missing fakeroot skip on FreeBSD, fixes #9394#9396

Open
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
mr-raj12:resolve-fakeroot-xattr-todos
Open

xattr: document fakeroot xattr as Linux-only, add missing fakeroot skip on FreeBSD, fixes #9394#9396
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
mr-raj12:resolve-fakeroot-xattr-todos

Conversation

@mr-raj12
Copy link
Contributor

Summary

  • Resolved open TODOs in src/borg/xattr.py (lines 22-23) that asked whether fakeroot supports xattrs on non-Linux platforms
  • Added missing skipif_fakeroot_detected to freebsd_test.py for consistency with linux_test.py and darwin_test.py
  • Added test verifying XATTR_FAKEROOT is False on non-Linux and without fakeroot active

Fixes #9394

Background

Investigation confirmed fakeroot xattr support is Linux-only:

  • FreeBSD/NetBSD: fakeroot only wraps the Linux-style setxattr/getxattr API, but these platforms use the extattr_* API instead — fakeroot never intercepts xattr calls there
  • macOS: fakeroot explicitly #undefs all xattr wrappers due to prototype incompatibilities with the Linux versions
  • Vagrantfile confirms: FreeBSD comments "fakeroot causes lots of troubles", NetBSD/OpenBSD have "no fakeroot"

Changes

  • src/borg/xattr.py — Replace TODO comments with documentation explaining why detection is Linux-only
  • src/borg/testsuite/platform/freebsd_test.py — Add skipif_fakeroot_detected to pytestmark (was missing, unlike linux_test.py and darwin_test.py)
  • src/borg/testsuite/xattr_test.py — Add test_xattr_fakeroot_flag() test

Test plan

  • CI passes on all platforms
  • test_xattr_fakeroot_flag runs and passes
  • FreeBSD ACL tests still run normally (skip only triggers under fakeroot)

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.43%. Comparing base (77a5f43) to head (d1a10dd).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9396   +/-   ##
=======================================
  Coverage   76.43%   76.43%           
=======================================
  Files          85       85           
  Lines       14800    14800           
  Branches     2212     2212           
=======================================
  Hits        11313    11313           
  Misses       2809     2809           
  Partials      678      678           

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

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.

xattr: extend fakeroot xattr detection beyond Linux to macOS/FreeBSD/NetBSD

1 participant