Bug 116617 - Please add Extended Attribute support (setxattr, getxattr)
Summary: Please add Extended Attribute support (setxattr, getxattr)
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: HI major
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: usability
: 224635 274327 342152 370371 370543 415473 418225 (view as bug list)
Depends on:
Blocks: 341887
  Show dependency treegraph
 
Reported: 2005-11-18 12:38 UTC by Stephan Ferraro
Modified: 2023-09-23 16:56 UTC (History)
21 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.76
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Ferraro 2005-11-18 12:38:18 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Gentoo Packages
Compiler:          gcc 4.1 
OS:                Linux

I use a filesystem which supports extended attributes (e.g. xfs, ext3, noofs...).
Could it be possible please to add support for this attributes in konqueror?

It could be integreated for example if somebody clicks with right mouse button on a file,
that he can add meta information data on a file (meta information = extended attributes).
The extended attributes works as key:value pair.
The key is a NULL terminated string, the value can also be binary content.

Functions to use for this:
man section 2:
getxattr, lgetxattr, fgetxattr
setxattr, lsetxattr, fsetxattr

Thanks in advance.
Comment 1 Thiago Macieira 2005-11-19 01:56:21 UTC
This has to go deeper down into kio.
Comment 2 Lee Braiden 2005-12-06 00:22:38 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 David Faure 2005-12-06 09:51:04 UTC
ACL support has been implemented now, in 3.5 (mostly by Till Adam).
Comment 4 Lee Braiden 2005-12-06 17:24:14 UTC
David, this wishlist item is for EAs, not ACLs.  I think you're just letting people know of the related feature, but I thought it best to clarify, just in case :)
Comment 5 David Faure 2005-12-06 17:51:18 UTC
Ah, my bad. acl uses attr so I got confused. Reopening, sorry.
Comment 6 Nate Graham 2018-01-28 02:18:04 UTC
*** Bug 224635 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2018-01-28 02:19:07 UTC
*** Bug 342152 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2018-01-28 02:19:18 UTC
*** Bug 370371 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2018-01-28 02:19:22 UTC
*** Bug 370543 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2018-01-28 02:19:36 UTC
*** Bug 274327 has been marked as a duplicate of this bug. ***
Comment 11 funkybomber 2018-01-30 08:18:30 UTC
I have just posted a bounty for this bug. I'd like to see this issue fixed for both situations: 
1) when saving a file with extended file attributes
2) when copying a file/folder with extended file attributes

I know that this issue is multifaceted and serious, so this is my attempt to give it some renewed visibility and momentum!

Please note that I will need to see it solved in the KDE Neon Developer edition before I release the reward!
Happy coding! :)

relevant bug reports:
https://bugs.kde.org/show_bug.cgi?id=370543
https://bugs.kde.org/show_bug.cgi?id=274327
https://bugs.kde.org/show_bug.cgi?id=116617

bounty page:
https://www.bountysource.com/issues/54395598-please-add-extended-attribute-support-setxattr-getxattr
Comment 12 Christoph Feck 2018-01-31 04:45:11 UTC
1) "when saving a file with extended file attributes" might be impossible to fix, because applications would need to load the attributes together with the file to be able to save them later. Are there existing applications (either by KDE or not) that keep existing extended attributes when saving? Also with "Save As..."?
Comment 13 JKFRT 2018-05-01 20:58:42 UTC
(In reply to Christoph Feck from comment #12)
> 1) "when saving a file with extended file attributes" might be impossible to
> fix, because applications would need to load the attributes together with
> the file to be able to save them later. Are there existing applications
> (either by KDE or not) that keep existing extended attributes when saving?
> Also with "Save As..."?

Not sure if I understand the question right, but Thunar (xfce) does preserve extended attributes when copying files around.
Perhaps some of the code base can be borrowed regarding this issue?
Comment 14 Christoph Feck 2018-05-31 18:18:27 UTC
Having a file manager copying metadata should be possible to solve. My comment, however, was about the first situation from comment #11.
Comment 15 Michael D 2018-09-05 10:57:28 UTC
(In reply to Christoph Feck from comment #12)
> 1) "when saving a file with extended file attributes" might be impossible to
> fix, because applications would need to load the attributes together with
> the file to be able to save them later. Are there existing applications
> (either by KDE or not) that keep existing extended attributes when saving?
> Also with "Save As..."?

If I understand correctly, saving a file in Okular preserves xattrs. I have a bunch of files tagged (within Dolphin) that I edit in okular and save (not save as) and the xattrs remain intact. Is this a problem in other applications?
Comment 16 Cochise César 2018-12-27 17:45:17 UTC
I'm working on a solution for this.
Comments are welcome.
https://phabricator.kde.org/D17816
Comment 17 Nate Graham 2020-01-01 23:45:37 UTC
*** Bug 415473 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2020-02-26 18:08:26 UTC
*** Bug 418225 has been marked as a duplicate of this bug. ***
Comment 19 Nate Graham 2020-10-29 22:28:28 UTC
Git commit fd0959409f356d2c7baecb849f50901123913a63 by Nate Graham, on behalf of Gleb Popov.
Committed on 29/10/2020 at 22:28.
Pushed by ngraham into branch 'master'.

Support for xattrs on kio copy/move

Summary:
This patch adds support to KIO to preserve xattr of files and directories on copy or move.
Working for copy/move including overwrite and rename cases.
Not working for "write into" when coping folders have name conflict. I'm against adding to this user case as the name of the action don't imply overwrite.

Tested only on Linux.

Reviewers: dfaure, chinmoyr, bruns, #frameworks, tmarshall, usta, cochise

Reviewed By: dfaure, usta

Subscribers: usta, scheirle, tmarshall, arrowd, cfeck, bruns, phidrho, dhaumann, funkybomber, abika, pino, davidedmundson, ngraham, atha.kane, spoorun, nicolasfella, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D17816

M  +146  -5    autotests/jobtest.cpp
M  +7    -0    autotests/jobtest.h
M  +3    -0    src/ioslaves/file/ConfigureChecks.cmake
M  +4    -1    src/ioslaves/file/config-kioslave-file.h.cmake
M  +1    -0    src/ioslaves/file/file.h
M  +126  -3    src/ioslaves/file/file_unix.cpp

https://invent.kde.org/frameworks/kio/commit/fd0959409f356d2c7baecb849f50901123913a63
Comment 20 funkybomber 2020-11-02 13:08:35 UTC
I just tested this patch in KDE Neon Testing edition with:

Plasma: 5.20.2
KDE Frameworks: 5.76.0
Qt: 5.15.0
I seems to be working very well, at least when saving/updating a .txt file that already has xattrs with Kate. Well done! :)

I had less success when I tried to add some xattrs in a .zip file and then added an extra file into this .zip file using Ark. It would seem that Ark is not respecting the preservation of the xattrs during saving/updating... 

Should I file a new bug, or should this be addressed in the context of the current bug?
Comment 21 Christoph Feck 2020-11-02 14:22:49 UTC
It would really need to be investigated per-application. I expected this change causing a multitude of bug reports, see also comment 12.

Regarding ark, does it work if you use "zip" from command line? Depending on the used ark plugin, it is probably a libarchive or zip command issue. I suggest to report your findings in a new ticket.
Comment 22 funkybomber 2020-11-03 01:28:49 UTC
(In reply to Christoph Feck from comment #21)
> It would really need to be investigated per-application. I expected this
> change causing a multitude of bug reports, see also comment 12.
> 
> Regarding ark, does it work if you use "zip" from command line? Depending on
> the used ark plugin, it is probably a libarchive or zip command issue. I
> suggest to report your findings in a new ticket.

I tried using the zip command in the terminal and it still causes the same problem (does not preserve the xattrs).