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.
archive_format = p->fmt;
}
archive_format = p->fmt;
}
+static void
+set_xattr_option (int value)
+{
+ if (value == 1)
+ set_archive_format ("posix");
+ xattrs_option = value;
+}
+
const char *
archive_format_string (enum archive_format fmt)
{
const char *
archive_format_string (enum archive_format fmt)
{
break;
case XATTR_OPTION:
break;
case XATTR_OPTION:
- set_archive_format ("posix");
- xattrs_option = 1;
break;
case NO_XATTR_OPTION:
break;
case NO_XATTR_OPTION:
break;
case XATTR_INCLUDE:
case XATTR_EXCLUDE:
break;
case XATTR_INCLUDE:
case XATTR_EXCLUDE:
xattrs_mask_add (arg, (key == XATTR_INCLUDE));
break;
xattrs_mask_add (arg, (key == XATTR_INCLUDE));
break;
if (selinux_context_option > 0 && st->cntx_name)
*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))
- if (selinux_context_option && st->cntx_name)
+ if (selinux_context_option > 0 && st->cntx_name)
fprintf (stdlis, " s: %s\n", st->cntx_name);
/* acls */
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);
{
fprintf (stdlis, " a: ");
acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len);
- if (xattrs_option && st->xattr_map_size)
+ if (xattrs_option > 0 && st->xattr_map_size)