diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2013-05-23 11:36:23 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-02-14 12:32:34 +0200 |
commit | 8e10d93d01049d4c5c58ebe57da499a3873be9db (patch) | |
tree | 485079f92912d9ca524498096feab088c29162de /src/xattrs.c | |
parent | 3cb4693c653aeb7056d8b7effc195f8cc2ae0a63 (diff) | |
download | tar-8e10d93d01049d4c5c58ebe57da499a3873be9db.tar.gz |
tar: imply --xattrs when --xattrs-{inc,exc}lude used
Options --xattrs-include=MASK and --xattrs-exclude=MASK now turn
on the --xattrs option.
Fix also bug in printing in xattrs.c - don't print when option is
negative.
* src/tar.c (set_xattr_option): New static function.
(parse_opt): Call new function when --xatrrs, --xattrs-include or
--xattrs-exclude option is used.
* src/xattrs.c (xattrs_print, xattrs_print_char): Expect positive
values in options.
Diffstat (limited to 'src/xattrs.c')
-rw-r--r-- | src/xattrs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xattrs.c b/src/xattrs.c index dbe49662..dbaa2092 100644 --- a/src/xattrs.c +++ b/src/xattrs.c @@ -695,7 +695,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 = '+'; } @@ -706,11 +706,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); @@ -719,7 +719,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; |