FS#79830 - vim 9.0.1968-1 error message about extended attribute errror
Attached to Project:
Arch Linux
Opened by Gene (GeneC) - Sunday, 01 October 2023, 14:47 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 03 October 2023, 06:06 GMT
Opened by Gene (GeneC) - Sunday, 01 October 2023, 14:47 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 03 October 2023, 06:06 GMT
|
Details
Description:
- Edit an existing text file and save generates error: E1509: Error occured when reading or writing extended attribute In spite of this, the file is written out just fine. - Prev version of vim (9.0.1882-1) works fine (as does vi) - File system is ext4 : tune2fs shows Filesystem features: has_journal ext_attr resize_inode dir_index fast_commit filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Additional info: * package version(s) vim 9.0.1968-1 Steps to reproduce: - Edit an existing text file and write it out - Other tests: 1) If I copy the file to /tmp and edit and save it - that works fine with no error. 2) If I copy the file to new name but in same directory - it has same problem.' 3) if I edit a 'new' file on same directory I get no errors and its fine however if i then read same file back in and write - I get same error. Rolling back to vim 9.0.1882-1 and all is fine again. |
This task depends upon
Closed by Toolybird (Toolybird)
Tuesday, 03 October 2023, 06:06 GMT
Reason for closing: Upstream
Additional comments about closing: Thanks for that. Assuming we'll get the fix in the next update.
Tuesday, 03 October 2023, 06:06 GMT
Reason for closing: Upstream
Additional comments about closing: Thanks for that. Assuming we'll get the fix in the next update.
[1] https://github.com/vim/vim/commit/e085dfda5d8dde064b0332464040959479696d1c
When I run getfattr -m '' on a file I get:
security.SMACK64
So if I now do
touch foo
sudo setfattr -x security.SMACK64 foo
getfattr -m '' foo -> no more extended atrib.
Then sure enough vim has no problem any more.
So seems that is likely the underlying problem.
The vim code does the programmatic version setxattr() - and likely it gets permission denied.
I don't know why vim is calling setxattr() on the edited file but maybe it's not, and one possibility might be for a backup file or something.
I didn't read all the code - was a swift glance.
But around line 1513 it does look like copying the xattr to backup:
https://github.com/vim/vim/pull/13203/commits/23fff2bc6a8a379faf742998e9042269d6b6bb89
https://github.com/vim/vim/pull/13229
> https://github.com/vim/vim/pull/13229
Looks to me to be fixing build time detection of xattr not runtime error handling.