[Top][All Lists]

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

[Bug-tar] Tar's --xattrs | --selinux | --acls listing feature

From: Pavel Raiskup
Subject: [Bug-tar] Tar's --xattrs | --selinux | --acls listing feature
Date: Wed, 02 May 2012 11:10:27 +0200
User-agent: Opera Mail/11.62 (Linux)

Hi tar community,

we are working on the xattrs|selinux|acl listing feature for command

    tar -tf --xattrs and  tar -tvf --xattrs (or --selinux, --acls)

and we would like to consult possible format of listing output even if
xattr support is not yet upstream.

There are few existing possibilities how to implement listing of xattrs --
the problem here is to achieve compromise between verbosity (it may look
like spamming for the case of attrs) and information level provided by

We would like to implement completely 2 or 3 verbosity levels:

0) tar -tf --xattrs; tar -tf --selinux; tar -tf --acls

   - It looks like these command outputs should stay unchanged and easy
     to use for parsing.

1) tar -tvf --xattrs; tar -tf --selinux; tar -tf --acls

   - it looks it would be enough to implement GNU `ls -l` output.  It
     looks like:

     | $ ls -l
     | total 40
     | -rwxrwxr-x. 1 praiskup praiskup    29 Apr 24 07:43 lister
     | -rw-r-xr--+ 1 root     root         0 Apr 24 07:59 root
     | -rw-rwxr--+ 1 praiskup praiskup     0 Apr 24 07:31 test
     | -rw-rw-r--. 1 praiskup praiskup 10240 Apr 24 07:37 test.tar

     The symbol  ^ signalizes there are set additional access control
     informations for the case of '+' symbol and the symbol '.' indicates
     file with SELinux context.

2) tar -tvvf --xattrs

   Here we would go for keeping 'tar -tvf' line for each file and add
   xattrs info bellow (very similar for selinux and acls).

   Format of xattr output would be like 'INDENT KEY : LENGTH', where
   INDENT would be 4 spaces, KEY is attr key string and LENGTH would be
   length of xattr value.


   |-rw-rw-r--. praiskup/praiskup 14 2012-04-19 12:23 xattrs.txt
   |    user.testattr:27
   |    user.mime:20
   |-rw-rw-r--. praiskup/praiskup 14 2012-04-19 12:27 test.txt
   |    user.testattr2:25

   for selinux `tar -tvvf --selinux`

   |-rw-rw-r--. praiskup/praiskup 14 2012-04-19 12:23 xattrs.txt
   |    unconfined_u:object_r:user_home_t:s0

   and for --acls

   |-rw-rw-r-- praiskup/praiskup 14 2012-04-19 12:23 acls.txt
   |    user:praiskup:rwx
   |    user:tester:r--
   |    user:user1:rwx

3) tar '-tvvvf' could inherit 'tar -tvvf' but just add headers before each
   bunch of xattr|acl lines and before selinux line.  Example output:

   $ tar -tvvvf --xattrs --selinux --acls file.tar file.txt

   |-rw-rw-r-- praiskup/praiskup 14 2012-04-19 12:23 file.txt
   |  acls:
   |    user:praiskup:rwx
   |    user:tester:r--
   |    user:user1:rwx
   |  selinux:
   |    unconfined_u:object_r:user_home_t:s0
   |  xattrs:
   |    user.testattr:27
   |    user.mime:20

Some future feature would have filtering possibility also -- employing of
the fnmatch(3) function could be exactly what user usually wants.

Could you please for now  consider whether these formats are good enough
for future upstream acceptance?  I know it may be long way to go there but
the upstream's point of view is even so very important for us.

Thank you for any comment!


reply via email to

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