bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] [PATCH] new XATTRS/SELinux/ACLs propsal


From: Pavel Raiskup
Subject: Re: [Bug-tar] [PATCH] new XATTRS/SELinux/ACLs propsal
Date: Tue, 09 Oct 2012 15:46:41 +0200

>   2. Apply the 0002-*.patch - this patch is adding support for extended
>      attributes into tar.  This is slightly modified version of Red Hat
>      patch that is deployed in Fedora distribution of tar for many years.
>      AFAIK, very similar patch is also compiled in Gentoo's tar.
> 
>      It is possible to disable this feature during ./configure phase using
>      the --without-xattrs option.  It will disable the possibility for
>      archiving/restoring of extended attributes -- but it still allows tar
>      to read (list) the archive contents (including tar --xattrs -tvvf)
>      and do not print the "unknown extended header keyword" warning on
>      error output when extended attributes are present in an archive.
> 
>      Inside this patch are also basic tests for this feature.  Note that
>      this will need probably some improvements from the portability
>      perspective -- now these tests are simply skipped when utilities
>      needed for proper testing are missing on system.
> 
>      When this feature is compiled and tar is unable to write extended
>      attributes onto file system, the ENOTSUP warning may be silenced by
>      using '--warning=no-xattr-write'.
> 
>      As is documented (patch #5), default behaviour of tar will be that
>      it will store all extended attributes by default when '--xattrs'
>      option is present but it restores only 'user.*' domain by default.
>      Anyway, this may be controlled by --xattrs-include/--xattrs-exclude
>      patterns.  These options have non-state validity (when these are
>      used they are valid for whole list of files that is going to be
>      stored/restored/listed).
> 
>      The --no-xattrs is also present just for the situation that on some
>      systems may be --xattrs option enabled by default (hardwired or in
>      set in $TAR_OPTIONS).  (slightly different semantics against
>      --wildcards/--no-wildcards options that has state behaviour)

I'm attaching another fix.  Now the GNU tar would be able to store/extract
extended attributes having the '=' character inside keyword.  E.g.

  $ touch file
  $ setfattr -n user.%3D=N=A=M=E -v VALUE file
  $ #           this ^^ is there just to make sure everything is ok ..
  $ tar --xattrs -cf test.tar file
  file
  $ tar --xattrs -tvf test.tar
  -rw-rw-r--* praiskup/praiskup 0 2012-10-09 15:41 file
    x: 5 user.%3D=N=A=M=E

Attached patch includes test-case to tar's testsuite also.

For more info see this thread:

  http://lists.gnu.org/archive/html/bug-tar/2012-10/msg00017.html

Pavel

Attachment: 0001-Allow-to-store-extract-character-in-xattr-keyword.patch
Description: Text Data


reply via email to

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