coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cp: add support for preserving ext2 attributes


From: Jaromir Koncicky
Subject: cp: add support for preserving ext2 attributes
Date: Fri, 16 Aug 2013 10:10:00 -0400 (EDT)

In Red Hat Bugzilla, there was a request to add support of preserving ext2 
extended filesystem flags (append only, immutable etc..) to cp, mv, install 
commands: 
https://bugzilla.redhat.com/show_bug.cgi?id=995249

I took a look at it and added the support into cp, using e2fsprogs-libs 
library, so it is preserving the attributes as intended.
However, I should consult this change with upstream first so I'm posting my 
patch.
Note that this is an initial version of the patch and it is not complete at 
all, It has very basic functionality and I'm just demonstrating the way I'm 
going to implement the support.
I need your feedback about this first. Eventually I will complete the patch.

I am doing it under Fedora 19 3.10.4-300.fc19.x86_64, with libattr and 
e2fsprogs-libs installed.

Steps to test it:

- apply the patch
- into Makefile, add manually:
  "LIB_EXT2ATTR = -le2p"    (for example after the line "LIB_XATTR = -lattr")
  "copy_ldadd = ..." add "$(LIB_EXT2ATTR)"
$ make
$ touch testfile
$ sudo chattr +a testfile
$ lsattr testfile
-----a-------e-- testfile
$ sudo src/cp --preserve=all testfile testfile1
$ lsattr testfile1
-----a-------e-- testfile1


Attachment: ext2_attributes_support.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]