[vim/vim] Add extended attribute support (Linux) (PR #13203)

38 views
Skip to first unread message

Christian Brabandt

unread,
Sep 27, 2023, 5:33:44 PM9/27/23
to vim/vim, Subscribed

It's been a long standing issue, that if you write a file with extended attributes and backupcopy=no, the file will loose the extended attributes.

So this patch adds support for retrieving the extended attributes and copying it to the new file. It currently only works on linux, mainly I don't know the different APIs for other systems (BSD, MacOSX and Solaris). On linux, this should be supported since Kernel 2.4 or something, so this should be pretty safe to use now.

I think it makes sense to have this enabled in normal builds so it is not so surprising if one loses those attributes, but not sure.

I also added it explicitly to the :version output as well as make it able to check using :echo has("xattr"), to have users easily check that this is available.

In contrast to the similar support for SELINUX and SMACK support (which also internally uses extended attributes), I have made this a FEAT_XATTR define, instead of the similar HAVE_XATTR, but that should just be a implementation detail (but happy to change if wanted).

todo:
[ ] try to write tests.

closes: #306


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/13203

Commit Summary

  • c853be5 Add extended attribute support (Linux)

File Changes

(14 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203@github.com>

Christian Brabandt

unread,
Sep 27, 2023, 5:47:09 PM9/27/23
to vim/vim, Push

@chrisbra pushed 1 commit.

  • ae0d406 Add extended attribute support (Linux)


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/push/15208323536@github.com>

Christian Brabandt

unread,
Sep 28, 2023, 6:02:02 PM9/28/23
to vim/vim, Push

@chrisbra pushed 2 commits.

  • 4d17ac3 Add extended attribute support (Linux)
  • 14d80b2 Don't use static buffer for Xattr Values, but calc len

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/push/15223234947@github.com>

codecov[bot]

unread,
Sep 28, 2023, 7:46:17 PM9/28/23
to vim/vim, Subscribed

Codecov Report

Merging #13203 (14d80b2) into master (b90e3bc) will increase coverage by 0.00%.
Report is 1 commits behind head on master.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #13203   +/-   ##
=======================================
  Coverage   82.13%   82.14%           
=======================================
  Files         160      160           
  Lines      195393   195393           
  Branches    43844    43844           
=======================================
+ Hits       160485   160500   +15     
+ Misses      22063    22049   -14     
+ Partials    12845    12844    -1     
Flag Coverage Δ
huge-clang-Array 82.78% <ø> (+<0.01%) ⬆️
linux 82.78% <ø> (+<0.01%) ⬆️
mingw-x64-HUGE 76.72% <ø> (+<0.01%) ⬆️
mingw-x86-HUGE 77.23% <ø> (+0.01%) ⬆️
windows 78.31% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/bufwrite.c 73.74% <ø> (ø)
src/evalfunc.c 90.25% <ø> (ø)
src/os_unix.c 67.15% <ø> (ø)
src/version.c 85.24% <ø> (ø)

... and 14 files with indirect coverage changes


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/c1740130900@github.com>

Christian Brabandt

unread,
Sep 29, 2023, 5:50:36 PM9/29/23
to vim/vim, Push

@chrisbra pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/push/15236505518@github.com>

Christian Brabandt

unread,
Sep 29, 2023, 5:58:30 PM9/29/23
to vim/vim, Push

@chrisbra pushed 3 commits.

  • 9baf9a9 Add extended attribute support (Linux)
  • f1b26f9 Don't use static buffer for Xattr Values, but calc len
  • 29496b2 Add a test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/push/15236558561@github.com>

Christian Brabandt

unread,
Sep 29, 2023, 6:23:19 PM9/29/23
to vim/vim, Push

@chrisbra pushed 1 commit.

  • 69aabf1 fix CI complaints, order :version output

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/push/15236752676@github.com>

Christian Brabandt

unread,
Sep 30, 2023, 5:35:24 AM9/30/23
to vim/vim, Push

@chrisbra pushed 1 commit.

  • 23fff2b Add extended attribute support (Linux)

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/push/15239666149@github.com>

Christian Brabandt

unread,
Sep 30, 2023, 6:53:43 AM9/30/23
to vim/vim, Subscribed

Closed #13203 via e085dfd.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13203/issue_event/10517139314@github.com>

Reply all
Reply to author
Forward
0 new messages