[tar] tar: `tar -tvv --no-xattrs` doesn't print xattrs now

Pavel Raiskup praiskup at fedoraproject.org
Fri May 31 14:49:37 UTC 2013


commit 005afb760c7a3e17f935434f35698e065234e626
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Fri May 31 16:47:04 2013 +0200

    tar: `tar -tvv --no-xattrs` doesn't print xattrs now
    
    This was obvious bug, already proposed upstream.
    
    Version: 2:1.26-24

 tar-1.26-xattrs-printing.patch |   36 ++++++++++++++++++++++++++++++++++++
 tar.spec                       |    9 +++++++++
 2 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/tar-1.26-xattrs-printing.patch b/tar-1.26-xattrs-printing.patch
new file mode 100644
index 0000000..e6a4f0c
--- /dev/null
+++ b/tar-1.26-xattrs-printing.patch
@@ -0,0 +1,36 @@
+diff --git a/src/xattrs.c b/src/xattrs.c
+index 5a4bf72..bdf6ba0 100644
+--- a/src/xattrs.c
++++ b/src/xattrs.c
+@@ -693,7 +693,7 @@ xattrs_print_char (struct tar_stat_info const *st, char *output)
+   if (selinux_context_option > 0 && st->cntx_name)
+     *output = '.';
+ 
+-  if (acls_option && (st->acls_a_len || st->acls_d_len))
++  if (acls_option > 0 && (st->acls_a_len || st->acls_d_len))
+     *output = '+';
+ }
+ 
+@@ -704,11 +704,11 @@ xattrs_print (struct tar_stat_info const *st)
+     return;
+ 
+   /* selinux */
+-  if (selinux_context_option && st->cntx_name)
++  if (selinux_context_option > 0 && st->cntx_name)
+     fprintf (stdlis, "  s: %s\n", st->cntx_name);
+ 
+   /* acls */
+-  if (acls_option && (st->acls_a_len || st->acls_d_len))
++  if (acls_option > 0 && (st->acls_a_len || st->acls_d_len))
+     {
+       fprintf (stdlis, "  a: ");
+       acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len);
+@@ -717,7 +717,7 @@ xattrs_print (struct tar_stat_info const *st)
+     }
+ 
+   /* xattrs */
+-  if (xattrs_option && st->xattr_map_size)
++  if (xattrs_option > 0 && st->xattr_map_size)
+     {
+       int i;
+       
diff --git a/tar.spec b/tar.spec
index a9eb244..0e46acf 100644
--- a/tar.spec
+++ b/tar.spec
@@ -98,6 +98,13 @@ Patch14: tar-1.26-command-args.patch
 # ~> #926610 (downstream)
 Patch15: tar-1.26-arm-config-sub-guess.patch
 
+# Do not print xattrs/selinux/acls when --no-xattrs/--no-acls/--no-selinux
+# options are used during -tvv output.  (TODO: merge this with xattrs patch
+# once becomes upstream)
+# ~> downstream (yet)
+# ~> proposal: http://lists.gnu.org/archive/html/bug-tar/2013-05/msg00020.html
+Patch16: tar-1.26-xattrs-printing.patch
+
 # Silence gcc warnings
 # ~> upstream tar: 17f99bc6f, 5bb0433
 # ~> upstream paxutils: 0b3d84a0
@@ -151,6 +158,7 @@ the rmt package.
 %patch13 -p1 -b .extract-single-volume
 %patch14 -p1 -b .command-args
 %patch15 -p1 -b .arm-config-guess-sub
+%patch16 -p1 -b .print-xattrs-fix
 %patch999 -p1 -b .silence-gcc
 
 autoreconf -v
@@ -212,6 +220,7 @@ fi
 %changelog
 * Thu May 30 2013 Pavel Raiskup <praiskup at redhat.com> - 2:1.26-24
 - use /usr/bin/ssh as the default remote shell binary (#969015)
+- do not verbose-print xattrs when --no-xattrs option is used
 
 * Tue May 28 2013 Pavel Raiskup <praiskup at redhat.com> - 2:1.26-23
 - again search for 'rmt' binary in %%{_sbindir} on target host


More information about the scm-commits mailing list