You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdelibs/tdeio/tdeio
Alexander Hajnal c1755d5200
Update job.cpp: Corrected errors in comments
1 year ago
..
CMakeLists.txt Drop explicit dependencies on dcopidl and dcopidl2cpp, 4 years ago
KFILEMETAINFO_ISSUES Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
Makefile.am Rename additional header files to avoid conflicts with KDE4 11 years ago
README.xattr Added test for libattr; Renamed macros 1 year ago
authinfo.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
authinfo.h Additional k => tde renaming and fixes 11 years ago
chmodjob.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
chmodjob.h Removed code formatting modelines. 4 years ago
configure.in.in Replaced _BSD_SOURCE, _SVID_SOURCE with _DEFAULT_SOURCE. Removed AC_CHECK_GNU_EXTENSIONS. 6 years ago
connection.cpp Improve progname detection portability 4 years ago
connection.h Removed code formatting modelines. 4 years ago
dataprotocol.cpp tdeio: add tests 7 years ago
dataprotocol.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
dataslave.cpp Additional k => tde renaming and fixes 11 years ago
dataslave.h Removed code formatting modelines. 4 years ago
davjob.cpp Removed code formatting modelines. 4 years ago
davjob.h Removed code formatting modelines. 4 years ago
defaultprogress.cpp Bring filenew, fileopen, fileprint, filequickprint, filesave, filesaveas, fileclose, editclear, editcopy, editcut, editdelete, editpaste, folder_new, and gohome icons into XDG compliance 10 years ago
defaultprogress.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
forwardingslavebase.cpp Fix a number of build warnings 10 years ago
forwardingslavebase.h Fix stale tdeioslave spawned by kdirlister 10 years ago
global.cpp tdeio: minor simplification of plurals in translation 3 years ago
global.h Additional k => tde renaming and fixes 11 years ago
http_slave_defaults.h Additional k => tde renaming and fixes 11 years ago
ioslave_defaults.h Additional k => tde renaming and fixes 11 years ago
job.cpp Update job.cpp: Corrected errors in comments 1 year ago
job.h Removed code formatting modelines. 4 years ago
jobclasses.h Removed code formatting modelines. 4 years ago
kacl.cpp Removed code formatting modelines. 4 years ago
kacl.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kar.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kar.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
karchive.cpp Fix security issue CVE-2016-6232 8 years ago
karchive.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kautomount.cpp Fix bug reports link in about dialog 6 years ago
kautomount.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kdatatool.cpp Rename a number of classes to enhance compatibility with KDE4 11 years ago
kdatatool.h Rename many classes and header files to avoid conflicts with KDE4 11 years ago
kdcopservicestarter.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kdcopservicestarter.h Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
kdirlister.cpp Fixed handling of files containing an # in the name when using the system:/media or media:/ protocol. This resolves bug 3022 and bug 3063. 3 years ago
kdirlister.h Fixed missing update of mime comment in refreshed KFileItem. This 5 years ago
kdirlister_p.h Add preliminary udisks eject support 11 years ago
kdirnotify.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kdirnotify.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kdirnotify_stub.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kdirnotify_stub.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kdirwatch.cpp Fixed second pass uncrustify's code formatting offending files. 3 years ago
kdirwatch.h Removed code formatting modelines. 4 years ago
kdirwatch_p.h Fix a number of problems with the forwarding slave and dirlister 11 years ago
kfilterbase.cpp Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
kfilterbase.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kfilterdev.cpp Cleanup KFilterDev::size warning 11 years ago
kfilterdev.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kimageio.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kimageio.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kimageiofactory.h Rename KShared 11 years ago
klimitediodevice.h Fix remnant QMIN/QMAX to TQMIN/TQMAX. 11 years ago
kmdbase.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kmessageboxwrapper.h Additional k => tde renaming and fixes 11 years ago
kmimemagic.cpp tdeio/kmimemagic: remove MAGIC_CONTINUE flag 7 years ago
kmimemagic.h Use libmagic for mime type determination 10 years ago
kmimetype.cpp iconForURL(): Fix root directory (/) icon. 3 years ago
kmimetype.h Additional k => tde renaming and fixes 11 years ago
kmimetypechooser.cpp Renaming of files in preparation for code style tools. 4 years ago
kmimetypechooser.h Removed code formatting modelines. 4 years ago
kmimetyperesolver.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
knfsshare.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
knfsshare.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kprotocolinfo.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kprotocolinfo.h Read from X-DocPath only 10 years ago
kremoteencoding.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kremoteencoding.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
krun.cpp Fix the last wrong condition from commit 99739b6114. 2 years ago
krun.h Rename additional header files to avoid conflicts with KDE4 11 years ago
ksambashare.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
ksambashare.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kscan.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kscan.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kservice.cpp Fixed tde branding of services in tdebuildsycoca. This was creating old 4 years ago
kservice.h Adjusted to use new TQStringVariantMap type. 5 years ago
kservice_p.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kservicefactory.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kservicefactory.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kservicegroup.cpp Fix XDG ShowOnlyIn/NotShowIn conflicts with KDE4. Add cmake 11 years ago
kservicegroup.h Rename KShared 11 years ago
kservicegroupfactory.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kservicegroupfactory.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kservicetype.cpp Adjusted to use new TQStringVariantMap type. 5 years ago
kservicetype.h Adjusted to use new TQStringVariantMap type. 5 years ago
kservicetypefactory.cpp Removed code formatting modelines. 4 years ago
kservicetypefactory.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
kshellcompletion.cpp Rename KComp to avoid conflicts with KDE4 11 years ago
kshellcompletion.h Rename KComp to avoid conflicts with KDE4 11 years ago
kshred.cpp Fix compiler warnings 9 years ago
kshred.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
ktar.cpp Fix remnant QMIN/QMAX to TQMIN/TQMAX. 11 years ago
ktar.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
ktrader.cpp Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
ktrader.h qt -> tqt conversion: 6 years ago
ktraderparse.cpp Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
ktraderparse.h Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
ktraderparsetree.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
ktraderparsetree.h Rename KShared 11 years ago
kurifilter.cpp Remove warnings about missing embedded ELF icons 8 years ago
kurifilter.h Rename many classes and header files to avoid conflicts with KDE4 11 years ago
kurlcompletion.cpp Removed code formatting modelines. 4 years ago
kurlcompletion.h Additional k => tde renaming and fixes 11 years ago
kurlpixmapprovider.cpp Rename KIcon to enhance compatibility with KDE4 11 years ago
kurlpixmapprovider.h Rename KIcon to enhance compatibility with KDE4 11 years ago
kuserprofile.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
kuserprofile.h Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
kzip.cpp Revert a small portion of commit e0b1bfb0 9 years ago
kzip.h Support writing empty directories to ZIP files. 10 years ago
lex.c Removed explicit usage of the 'register' keyword. 4 years ago
lex.l Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago
metainfojob.cpp Removed code formatting modelines. 4 years ago
metainfojob.h Removed code formatting modelines. 4 years ago
netaccess.cpp Removed beagle related code. 4 years ago
netaccess.h Fix incorrect labelling of local media:/ tdeioslave files in the TDEFileItem class 11 years ago
observer.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
observer.h Removed code formatting modelines. 4 years ago
passdlg.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
passdlg.h Additional k => tde renaming and fixes 11 years ago
paste.cpp QT_NO_* -> TQT_NO_* renaming. 6 years ago
paste.h Rename a number of classes to enhance compatibility with KDE4 11 years ago
pastedialog.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
pastedialog.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
posixacladdons.cpp Improve ACL detection for CMake build 9 years ago
posixacladdons.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
previewjob.cpp Removed code formatting modelines. 4 years ago
previewjob.h Removed code formatting modelines. 4 years ago
progressbase.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
progressbase.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
renamedlg.cpp Move focus to file name in rename dialog during copying files 11 years ago
renamedlg.h Fix a few remaining references to kio_ 11 years ago
renamedlgplugin.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
scheduler.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
scheduler.h Removed code formatting modelines. 4 years ago
sessiondata.cpp Rename KDEsu->TDEsu to provide consistency with previous renamings. 11 years ago
sessiondata.h Additional k => tde renaming and fixes 11 years ago
skipdlg.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
skipdlg.h Fix a few remaining references to kio_ 11 years ago
slave.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
slave.h Removed code formatting modelines. 4 years ago
slavebase.cpp Fix a number of build warnings 10 years ago
slavebase.h Fix a few remaining references to kio_ 11 years ago
slaveconfig.cpp Removed code formatting modelines. 4 years ago
slaveconfig.h Removed code formatting modelines. 4 years ago
slaveinterface.cpp Fix a number of build warnings 10 years ago
slaveinterface.h Additional k => tde renaming and fixes 11 years ago
statusbarprogress.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
statusbarprogress.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
tcpslavebase.cpp Added support for OpenSSL 1.1 7 years ago
tcpslavebase.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
tdeemailsettings.cpp Fix prior commit 11 years ago
tdeemailsettings.h Additional k => tde renaming and fixes 11 years ago
tdefilefilter.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
tdefilefilter.h Rename a few build variables for overall consistency 11 years ago
tdefileitem.cpp Add a definition of MIME type application/x-pie-executable. 3 years ago
tdefileitem.h Renaming of files in preparation for code style tools. 4 years ago
tdefilemetainfo.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
tdefilemetainfo.h Additional k => tde renaming and fixes 11 years ago
tdefileshare.cpp Rename additional header files to avoid conflicts with KDE4 11 years ago
tdefileshare.h Additional k -> tde renaming 11 years ago
tdelficon.cpp Fix FTBFS due to non-existent include 8 years ago
tdelficon.h Fix FTBFS due to non-existent include 8 years ago
tdeprotocolmanager.cpp Fix -tdehtml-* rename regression. This resolves bugs 1825 and 1692 10 years ago
tdeprotocolmanager.h Rename KWallet to TDEWallet 11 years ago
thumbcreator.h Additional k => tde renaming and fixes 11 years ago
yacc.c Fixed some uncrustify's code formatting offending files. 3 years ago
yacc.h Rename a number of libraries and executables to avoid conflicts with KDE4 11 years ago
yacc.y Rename KLock and KTrader to avoid conflicts with KDE4 11 years ago

README.xattr

This is a small patch adding user extended attribute support[1] for local files 
to tdeio.  With the patch in place user xattrs are preserved when copying or 
moving files on the local system[2].  It relies on libattr[3] to do the heavy 
lifting.

The code adds a call to attr_copy_file in libattr that copies the user xattrs 
from the source file to the destination file.  The call is made after the 
source file has been closed and immediately before the source file is deleted 
(in the case that a move is being done).  This code is based on the sample 
code[4] provided with libattr (examples/copyattr.c).

This code has been in daily use by the author of this patch for just over five 
years without any issues.  What's missing though is the addition of tests for 
xattr and libattr support at configuration/compile time.  The code I've added 
is enclosed by '#ifdef DO_USER_XATTR_COPYING' statements so a test should be 
added that sets this macro[5] if configure-time tests show that xattrs/libattr 
are working.  I've added a preliminary test to CMakeLists.txt but I'm not sure 
it's correct.  Alternatively uncomment the '#define DO_USER_XATTR_COPYING 1' 
statement at the top of the code to force my code to be enabled.  Ensuring that 
the cmake test working correctly needs to be done before general release.

This code has been tested on select Ubuntu Linux releases (natty, precise, 
xenial, and jammy) using x86_64 Linux kernels 3.14.1, 4.18.3, and 5.15.0.
Tested filesystems are ext4 and squashfs.

As far as cross-platform availability goes this code is only known to work on 
Linux[6][7].  That said, this code adds functionality that (as far as I'm aware) 
isn't currently present in TDE on any of the platforms it runs on.  In other 
words, even if it only runs on Linux in its current state there is no loss of 
functionality on any other platforms (just a lack of a gaining a feature).  In 
addition, determining the proper location to insert the library call was the 
hard part with the actual implementation being quite straightforward.  Adding 
additional backends for other platforms should be pretty easy.

To test the code build and install it[8] then run the following from the 
commandline in e.g. Konsole:

  $ cd PATH_SUPPORTING_USER_XATTRS_AT_THE_FILESYSTEM_LEVEL
  $ touch attr_test
  $ setfattr -n "user.AttributeName" -v "Attribute value" attr_test
  $ kfmclient copy attr_test attr_test.copy
  $ getfattr -d attr_test*

The final command should output (minus the indents):

  # file: attr_test
  user.AttributeName="Attribute value"
  
  # file: attr_test.copy
  user.AttributeName="Attribute value"

Enjoy!


  - Alex Kent Hajnal (AKH) 2022-12-21



[1] This includeds all attributes residing (on Linux) in the "user" namespace.
    ACLs, etc. are not copied.
    
    See the xattr(7) and e.g. the getfattr(1) manpages for more info.

[2] The underlying filesytems must, of course, have xattr support enabled.  
    This should be the case by default on modern systems that support xattrs.

[3] This is libattr1 and libattr1-dev on Ubuntu.
    
    See http://savannah.nongnu.org/projects/attr for more info.
    See also https://github.com/philips/attr

[4] The code that this patch is based on is licensed GPL v2 (or later).

[5] One has to use '#define DO_USER_XATTR_COPYING 1'; specifying instead  
   '#define DO_USER_XATTR_COPYING' doesn't enable the code (at least on my 
   system).

[6] I'm not sure which non-Linux platforms (if any) libattr runs on.

[7] Another known issue is namespaces.  Linux, FreeBSD, and NetBSD support 
    xattrs using the 'user' namespace.  Solaris and OSX support user xattrs 
    but do not support namespaces.
    (source: File::ExtAttr(3pm), personal testing)

[8] Instead of doing a full install one can simply copy the updated library:
    
    cp -va "BUILD_DIR/tdeio/libtdeio.so.14.0.0" /opt/trinity/lib/ && ldconfig