public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2016-05-16 21:08 Lars Wendler
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2016-05-16 21:08 UTC (permalink / raw
  To: gentoo-commits

commit:     4ebe7750670355beb8db3e440ec0f205171c4356
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 21:08:05 2016 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon May 16 21:08:05 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ebe7750

app-arch/tar: Removed old.

Package-Manager: portage-2.2.28
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-arch/tar/Manifest                     |   1 -
 app-arch/tar/files/tar-1.26-no-gets.patch |  22 -
 app-arch/tar/files/tar-1.26-xattr.patch   | 931 ------------------------------
 app-arch/tar/files/tar.1                  | 813 --------------------------
 app-arch/tar/tar-1.26-r1.ebuild           |  76 ---
 app-arch/tar/tar-1.28.ebuild              |  75 ---
 6 files changed, 1918 deletions(-)

diff --git a/app-arch/tar/Manifest b/app-arch/tar/Manifest
index a2c9d8d..b9d5d4d 100644
--- a/app-arch/tar/Manifest
+++ b/app-arch/tar/Manifest
@@ -1,4 +1,3 @@
-DIST tar-1.26.tar.bz2 2339773 SHA256 5a5369f464502a598e938029c310d4b3abd51e6bb8dfd045663e61c8ea9f6d41 SHA512 3bc12441bebfc388017ad0632fb3e777ceaf62be82fb19ce771df8bbb765eb094dad336110189f49f5eaaebd4d6ced586098e1e3c8b9f7f775dc483d5513f209 WHIRLPOOL bfdc579f97a260d6b6776211f470bfc1a99b81d89a8067b2ebfab3101ab1a4f2b4f7c444edffc05bc7585993cae601c499ec074bb606c7ef289deac5429cfb2b
 DIST tar-1.27.1.tar.bz2 2573070 SHA256 9b0fb3ce8512059337add0da5f8f0f7d7647f2201f5ece24581d620ea60337c6 SHA512 f14a0a58e574db3aeec0914621aff2f0518b8d8acce81106b8219b36b3fed47349d6cb802c51a836a5e6889529337434d83b3c50cd7fc1801b9b3944eecc695b WHIRLPOOL fd44ee747f44febc9dd4b0e1a532c38a835fcb55967143a1ab29b29dfc27316de76dfa1d23438f1843bb0a7962eb0b59c3ec75041cc0fbe879b02af292ebc6e9
 DIST tar-1.28.tar.bz2 2693989 SHA256 60e4bfe0602fef34cd908d91cf638e17eeb09394d7b98c2487217dc4d3147562 SHA512 4f66a236a2d9185114e2b358a09f3d38c3c38e984e5fca4bedc4d7eb461bdaace6a7a9fc62aafb70428b1f3dc617fb0d0553558fb29cad33f0cb53ba081521c4 WHIRLPOOL 54ad7b73e973d436cff853fda267d21ab22139f53d18f6870c7a53cf74e53ec8735022b6d3c503504ee416f1b9f9d43ca1af60d2fedb5d852766cb8dd2ac72d0
 DIST tar-1.29.tar.bz2 2715993 SHA256 236b11190c0a3a6885bdb8d61424f2b36a5872869aa3f7f695dea4b4843ae2f2 SHA512 d2cea9892892dfa0c8efd390303b75dccc085c4895e07ced684074592d69729916d6ea12475aa6aff873d076a729bb7dc2499c233edcfb9c7e8e8995481eef3b WHIRLPOOL fa5f66a7bb7698c35ad842bc4900a62997da5eb2f3cd6154391b88505a581078a64a8399bb5976d4723d90951d34c084e00d17908d90792bb5139184e8b92a94

diff --git a/app-arch/tar/files/tar-1.26-no-gets.patch b/app-arch/tar/files/tar-1.26-no-gets.patch
deleted file mode 100644
index a677af1..0000000
--- a/app-arch/tar/files/tar-1.26-no-gets.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-hack until gzip pulls a newer gnulib version
-
-From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
-From: Eric Blake <eblake@redhat.com>
-Date: Thu, 29 Mar 2012 13:30:41 -0600
-Subject: [PATCH] stdio: don't assume gets any more
-
-Gnulib intentionally does not have a gets module, and now that C11
-and glibc have dropped it, we should be more proactive about warning
-any user on a platform that still has a declaration of this dangerous
-interface.
-
---- a/gnu/stdio.in.h
-+++ b/gnu/stdio.in.h
-@@ -125,7 +125,6 @@
-    so any use of gets warrants an unconditional warning.  Assume it is
-    always declared, since it is required by C89.  */
- #undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- 
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@

diff --git a/app-arch/tar/files/tar-1.26-xattr.patch b/app-arch/tar/files/tar-1.26-xattr.patch
deleted file mode 100644
index 7986828..0000000
--- a/app-arch/tar/files/tar-1.26-xattr.patch
+++ /dev/null
@@ -1,931 +0,0 @@
-https://bugs.gentoo.org/382067
-
-add optional xattr support
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -223,6 +223,20 @@ AC_CHECK_TYPE(iconv_t,:,
- #endif
- ])
- 
-+AC_ARG_ENABLE(xattr,
-+  AC_HELP_STRING([--enable-xattr],
-+    [enable Extended Attribute support (disabled by default)]),
-+  [xattr_enabled=$enableval],
-+  [xattr_enabled=no])
-+
-+if test "x$xattr_enabled" = xyes; then
-+  AC_CHECK_HEADERS(attr/xattr.h)
-+  AC_CHECK_FUNCS(getxattr  fgetxattr  lgetxattr \
-+                 setxattr  fsetxattr  lsetxattr \
-+                 listxattr flistxattr llistxattr,
-+                 AC_DEFINE(HAVE_XATTRS,1,[Define if we have a working extended attributes]),)
-+fi
-+
- # Gettext.
- AM_GNU_GETTEXT([external], [need-formatstring-macros])
- AM_GNU_GETTEXT_VERSION([0.16])
---- a/doc/tar.texi
-+++ b/doc/tar.texi
-@@ -3002,6 +3002,10 @@ mechanism.
- Treat all input file or member names literally, do not interpret
- escape sequences.  @xref{input name quoting}.
- 
-+@opsummary{no-xattrs}
-+@item --no-xattrs
-+Causes @command{tar} not to store and not to extract xattrs.  @xref{Attributes}.
-+
- @opsummary{no-wildcards}
- @item --no-wildcards
- Do not use wildcards.
-@@ -3447,6 +3451,10 @@ Enable or disable warning messages identified by @var{keyword}.  The
- messages are suppressed if @var{keyword} is prefixed with @samp{no-}.
- @xref{warnings}.
- 
-+@opsummary{xattrs}
-+@item --xattrs
-+Causes @command{tar} to store xattrs.  @xref{Attributes}.
-+
- @opsummary{wildcards}
- @item --wildcards
- Use wildcards when matching member names with patterns.
-@@ -8659,6 +8667,8 @@ implementation able to read @samp{ustar} archives will be able to read
- most @samp{posix} archives as well, with the only exception that any
- additional information (such as long file names etc.) will in such
- case be extracted as plain text files along with the files it refers to.
-+This is the only format that can store ACLs, SELinux context and extended
-+attributes.
- 
- This archive format will be the default format for future versions
- of @GNUTAR{}.
-@@ -9293,6 +9303,20 @@ Same as both @option{--same-permissions} and @option{--same-order}.
- 
- This option is deprecated, and will be removed in @GNUTAR{} version 1.23.
- 
-+@opindex xattrs
-+@item --xattrs
-+This option causes @command{tar} to store the current extended attributes in
-+the archive.
-+
-+The @option{--xattrs} option has no equivalent short option name.
-+
-+@opindex no-xattrs
-+@item --no-xattrs
-+This option causes @command{tar} not to store the current extended attributes in
-+the archive and not to extract any extended attributes in an archive.
-+
-+The @option{--no-xattrs} option has no equivalent short option name.
-+
- @end table
- 
- @node Portability
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -20,7 +20,7 @@
- 
- bin_PROGRAMS = tar
- 
--noinst_HEADERS = arith.h common.h tar.h
-+noinst_HEADERS = arith.h common.h tar.h xattrs.h
- tar_SOURCES = \
-  buffer.c\
-  checkpoint.c\
-@@ -42,10 +42,11 @@ tar_SOURCES = \
-  unlink.c\
-  update.c\
-  utf8.c\
-- warning.c
-+ warning.c\
-+ xattrs.c
- 
- INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu -I$(top_srcdir)/lib -I../lib
- 
- LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV)
- 
--tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
-+tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
---- a/src/common.h
-+++ b/src/common.h
-@@ -253,6 +253,9 @@ GLOBAL int same_owner_option;
- /* If positive, preserve permissions when extracting.  */
- GLOBAL int same_permissions_option;
- 
-+/* If positive, save the user and root xattrs.  */
-+GLOBAL int xattrs_option;
-+
- /* When set, strip the given number of file name components from the file name
-    before extracting */
- GLOBAL size_t strip_name_components;
-@@ -707,6 +710,9 @@ extern char *output_start;
- 
- void update_archive (void);
- 
-+/* Module attrs.c.  */
-+#include "xattrs.h"
-+
- /* Module xheader.c.  */
- 
- void xheader_decode (struct tar_stat_info *stat);
-@@ -727,6 +733,12 @@ bool xheader_string_end (struct xheader *xhdr, char const *keyword);
- bool xheader_keyword_deleted_p (const char *kw);
- char *xheader_format_name (struct tar_stat_info *st, const char *fmt,
- 			   size_t n);
-+void xheader_xattr_init (struct tar_stat_info *st);
-+void xheader_xattr_free (struct xattr_array *vals, size_t sz);
-+void xheader_xattr_copy (const struct tar_stat_info *st,
-+                         struct xattr_array **vals, size_t *sz);
-+void xheader_xattr_add (struct tar_stat_info *st,
-+                        const char *key, const char *val, size_t len);
- 
- /* Module system.c */
- 
---- a/src/create.c
-+++ b/src/create.c
-@@ -936,6 +936,21 @@ start_header (struct tar_stat_info *st)
-       GNAME_TO_CHARS (st->gname, header->header.gname);
-     }
- 
-+  if (archive_format == POSIX_FORMAT)
-+    {
-+      if (xattrs_option > 0)
-+        {
-+          size_t scan_xattr = 0;
-+          struct xattr_array *xattr_map = st->xattr_map;
-+
-+          while (scan_xattr < st->xattr_map_size)
-+            {
-+              xheader_store (xattr_map[scan_xattr].xkey, st, &scan_xattr);
-+              ++scan_xattr;
-+            }
-+        }
-+    }
-+
-   return header;
- }
- 
-@@ -1711,6 +1726,11 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p)
-       bool ok;
-       struct stat final_stat;
- 
-+      if (fd == 0)
-+        xattrs_xattrs_get (st, p, -1);
-+      else
-+        xattrs_xattrs_get (st, p, fd);
-+
-       if (is_dir)
- 	{
- 	  const char *tag_file_name;
-@@ -1829,6 +1849,8 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p)
-       if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size)
- 	write_long_link (st);
- 
-+      xattrs_xattrs_get (st, p, -1);
-+
-       block_ordinal = current_block_ordinal ();
-       st->stat.st_size = 0;	/* force 0 size on symlink */
-       header = start_header (st);
-@@ -1847,11 +1869,20 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p)
-     }
- #endif
-   else if (S_ISCHR (st->stat.st_mode))
--    type = CHRTYPE;
-+    {
-+      type = CHRTYPE;
-+      xattrs_xattrs_get (st, p, -1);
-+    }
-   else if (S_ISBLK (st->stat.st_mode))
--    type = BLKTYPE;
-+    {
-+      type = BLKTYPE;
-+      xattrs_xattrs_get (st, p, -1);
-+    }
-   else if (S_ISFIFO (st->stat.st_mode))
--    type = FIFOTYPE;
-+    {
-+      type = FIFOTYPE;
-+      xattrs_xattrs_get (st, p, -1);
-+    }
-   else if (S_ISSOCK (st->stat.st_mode))
-     {
-       WARNOPT (WARN_FILE_IGNORED,
---- a/src/extract.c
-+++ b/src/extract.c
-@@ -97,6 +97,9 @@ struct delayed_set_stat
-     /* Directory that the name is relative to.  */
-     int change_dir;
- 
-+    /* extended attributes*/
-+    size_t xattr_map_size;   /* Size of the xattr map */
-+    struct xattr_array *xattr_map;
-     /* Length and contents of name.  */
-     size_t file_name_len;
-     char file_name[1];
-@@ -134,6 +137,9 @@ struct delayed_link
-        hard-linked together.  */
-     struct string_list *sources;
- 
-+    size_t xattr_map_size;   /* Size of the xattr map */
-+    struct xattr_array *xattr_map;
-+
-     /* The desired target of the desired link.  */
-     char target[1];
-   };
-@@ -335,6 +341,8 @@ set_stat (char const *file_name,
- 	utime_error (file_name);
-     }
- 
-+  xattrs_xattrs_set (st, file_name, typeflag);
-+
-   if (0 < same_owner_option && ! interdir)
-     {
-       /* Some systems allow non-root users to give files away.  Once this
-@@ -431,6 +439,13 @@ delay_set_stat (char const *file_name, struct tar_stat_info const *st,
-   data->atflag = atflag;
-   data->after_links = 0;
-   data->change_dir = chdir_current;
-+  if (st)
-+    xheader_xattr_copy (st, &data->xattr_map, &data->xattr_map_size);
-+  else
-+    {
-+      data->xattr_map = NULL;
-+      data->xattr_map_size = 0;
-+    }
-   strcpy (data->file_name, file_name);
-   delayed_set_stat_head = data;
-   if (must_be_dot_or_slash (file_name))
-@@ -673,6 +688,31 @@ maybe_recoverable (char *file_name, bool regular, bool *interdir_made)
-   return RECOVER_NO;
- }
- 
-+/* Restore stat extended attributes (xattr) for FILE_NAME, using information
-+   given in *ST.  Restore before extraction because they may affect layout.
-+   If not restoring permissions, invert the
-+   INVERT_PERMISSIONS bits from the file's current permissions.
-+   TYPEFLAG specifies the type of the file.
-+   FILE_CREATED indicates set_xattr has created the file */
-+static int
-+set_xattr (char const *file_name, struct tar_stat_info const *st,
-+	   mode_t invert_permissions, char typeflag, int *file_created)
-+{
-+  int status = 0;
-+  bool interdir_made = false;
-+
-+  if ((xattrs_option >= 0) && st->xattr_map_size) {
-+    mode_t mode = current_stat_info.stat.st_mode & MODE_RWX & ~ current_umask;
-+
-+    do
-+      status = mknod (file_name, mode ^ invert_permissions, 0);
-+    while (status && maybe_recoverable ((char *)file_name, false, &interdir_made));
-+    xattrs_xattrs_set (st, file_name, typeflag);
-+    *file_created = 1;
-+  }
-+  return(status);
-+}
-+
- /* Fix the statuses of all directories whose statuses need fixing, and
-    which are not ancestors of FILE_NAME.  If AFTER_LINKS is
-    nonzero, do this for all such directories; otherwise, stop at the
-@@ -733,12 +773,15 @@ apply_nonancestor_delayed_set_stat (char const *file_name, bool after_links)
- 	  sb.stat.st_gid = data->gid;
- 	  sb.atime = data->atime;
- 	  sb.mtime = data->mtime;
-+	  sb.xattr_map = data->xattr_map;
-+	  sb.xattr_map_size = data->xattr_map_size;
- 	  set_stat (data->file_name, &sb,
- 		    -1, current_mode, current_mode_mask,
- 		    DIRTYPE, data->interdir, data->atflag);
- 	}
- 
-       delayed_set_stat_head = data->next;
-+      xheader_xattr_free (data->xattr_map, data->xattr_map_size);
-       free (data);
-     }
- }
-@@ -854,6 +897,7 @@ extract_dir (char *file_name, int typeflag)
- 
- static int
- open_output_file (char const *file_name, int typeflag, mode_t mode,
-+		  int file_created,
- 		  mode_t *current_mode, mode_t *current_mode_mask)
- {
-   int fd;
-@@ -864,6 +908,10 @@ open_output_file (char const *file_name, int typeflag, mode_t mode,
- 		     ? O_TRUNC | (dereference_option ? 0 : O_NOFOLLOW)
- 		     : O_EXCL));
- 
-+  /* File might be created in set_xattr. So clear O_EXCL to avoid open() failure */
-+  if (file_created)
-+    openflag = openflag & ~O_EXCL;
-+
-   if (typeflag == CONTTYPE)
-     {
-       static int conttype_diagnosed;
-@@ -934,6 +982,7 @@ extract_file (char *file_name, int typeflag)
-   bool interdir_made = false;
-   mode_t mode = (current_stat_info.stat.st_mode & MODE_RWX
- 		 & ~ (0 < same_owner_option ? S_IRWXG | S_IRWXO : 0));
-+  mode_t invert_permissions = 0 < same_owner_option ? mode & (S_IRWXG | S_IRWXO) : 0;
-   mode_t current_mode = 0;
-   mode_t current_mode_mask = 0;
- 
-@@ -950,7 +999,17 @@ extract_file (char *file_name, int typeflag)
-     }
-   else
-     {
-+      int file_created = 0;
-+      if (set_xattr (file_name, &current_stat_info, invert_permissions,
-+		     typeflag, &file_created))
-+        {
-+          skip_member ();
-+          open_error (file_name);
-+          return 1;
-+        }
-+
-       while ((fd = open_output_file (file_name, typeflag, mode,
-+				     file_created,
- 				     &current_mode, &current_mode_mask))
- 	     < 0)
- 	{
-@@ -1091,6 +1150,7 @@ create_placeholder_file (char *file_name, bool is_symlink, bool *interdir_made)
- 			    + strlen (file_name) + 1);
-       p->sources->next = 0;
-       strcpy (p->sources->string, file_name);
-+      xheader_xattr_copy (&current_stat_info, &p->xattr_map, &p->xattr_map_size);
-       strcpy (p->target, current_stat_info.link_name);
- 
-       h = delayed_set_stat_head;
-@@ -1525,6 +1585,8 @@ apply_delayed_links (void)
- 		  st1.stat.st_gid = ds->gid;
- 		  st1.atime = ds->atime;
- 		  st1.mtime = ds->mtime;
-+		  st1.xattr_map = ds->xattr_map;
-+		  st1.xattr_map_size = ds->xattr_map_size;
- 		  set_stat (source, &st1, -1, 0, 0, SYMTYPE,
- 			    false, AT_SYMLINK_NOFOLLOW);
- 		  valid_source = source;
-@@ -1539,6 +1601,8 @@ apply_delayed_links (void)
- 	  sources = next;
- 	}
- 
-+   xheader_xattr_free (ds->xattr_map, ds->xattr_map_size);
-+
-       {
- 	struct delayed_link *next = ds->next;
- 	free (ds);
---- a/src/list.c
-+++ b/src/list.c
-@@ -604,6 +604,8 @@ decode_header (union block *header, struct tar_stat_info *stat_info,
-   assign_string (&stat_info->gname,
- 		 header->header.gname[0] ? header->header.gname : NULL);
- 
-+  xheader_xattr_init (stat_info);
-+
-   if (format == OLDGNU_FORMAT && incremental_option)
-     {
-       stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime);
---- a/src/tar.c
-+++ b/src/tar.c
-@@ -304,6 +304,7 @@ enum
-   NO_UNQUOTE_OPTION,
-   NO_WILDCARDS_MATCH_SLASH_OPTION,
-   NO_WILDCARDS_OPTION,
-+  NO_XATTR_OPTION,
-   NULL_OPTION,
-   NUMERIC_OWNER_OPTION,
-   OCCURRENCE_OPTION,
-@@ -340,7 +341,8 @@ enum
-   VOLNO_FILE_OPTION,
-   WARNING_OPTION,
-   WILDCARDS_MATCH_SLASH_OPTION,
--  WILDCARDS_OPTION
-+  WILDCARDS_OPTION,
-+  XATTR_OPTION
- };
- 
- const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION;
-@@ -516,6 +518,10 @@ static struct argp_option options[] = {
-   {"preserve-order", 's', 0, 0,
-    N_("sort names to extract to match archive"), GRID+1 },
-   {"same-order", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
-+  {"xattrs", XATTR_OPTION, 0, 0,
-+   N_("Save the user/root xattrs to the archive"), GRID+1 },
-+  {"no-xattrs", NO_XATTR_OPTION, 0, 0,
-+   N_("Don't extract the user/root xattrs from the archive"), GRID+1 },
-   {"preserve", PRESERVE_OPTION, 0, 0,
-    N_("same as both -p and -s"), GRID+1 },
-   {"delay-directory-restore", DELAY_DIRECTORY_RESTORE_OPTION, 0, 0,
-@@ -2079,6 +2085,15 @@ parse_opt (int key, char *arg, struct argp_state *state)
-       same_permissions_option = -1;
-       break;
- 
-+    case XATTR_OPTION:
-+      set_archive_format ("posix");
-+      xattrs_option = 1;
-+      break;
-+
-+    case NO_XATTR_OPTION:
-+      xattrs_option = -1;
-+      break;
-+
-     case RECURSION_OPTION:
-       recursion_option = FNM_LEADING_DIR;
-       break;
-@@ -2461,6 +2476,15 @@ decode_options (int argc, char **argv)
- 	  || subcommand_option != LIST_SUBCOMMAND))
-     USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives")));
- 
-+  /* star create's non-POSIX typed archives with xattr support, so allow the
-+     extra headers */
-+  if ((xattrs_option > 0)
-+      && archive_format != POSIX_FORMAT
-+      && (subcommand_option != EXTRACT_SUBCOMMAND
-+	  || subcommand_option != DIFF_SUBCOMMAND
-+	  || subcommand_option != LIST_SUBCOMMAND))
-+    USAGE_ERROR ((0, 0, _("--xattrs can be used only on POSIX archives")));
-+
-   /* If ready to unlink hierarchies, so we are for simpler files.  */
-   if (recursive_unlink_option)
-     old_files_option = UNLINK_FIRST_OLD_FILES;
-@@ -2713,6 +2737,7 @@ void
- tar_stat_destroy (struct tar_stat_info *st)
- {
-   tar_stat_close (st);
-+  xheader_xattr_free (st->xattr_map, st->xattr_map_size);
-   free (st->orig_file_name);
-   free (st->file_name);
-   free (st->link_name);
---- a/src/tar.h
-+++ b/src/tar.h
-@@ -276,6 +276,14 @@ struct xheader
-   uintmax_t string_length;
- };
- 
-+/* Information about xattrs for a file.  */
-+struct xattr_array
-+  {
-+    char *xkey;
-+    char *xval_ptr;
-+    size_t xval_len;
-+  };
-+
- struct tar_stat_info
- {
-   char *orig_file_name;     /* name of file read from the archive header */
-@@ -287,6 +295,7 @@ struct tar_stat_info
- 
-   char          *uname;     /* user name of owner */
-   char          *gname;     /* group name of owner */
-+
-   struct stat   stat;       /* regular filesystem stat */
- 
-   /* STAT doesn't always have access, data modification, and status
-@@ -309,6 +318,9 @@ struct tar_stat_info
-   size_t sparse_map_size;   /* Size of the sparse map */
-   struct sp_array *sparse_map;
- 
-+  size_t xattr_map_size;   /* Size of the xattr map */
-+  struct xattr_array *xattr_map;
-+
-   /* Extended headers */
-   struct xheader xhdr;
- 
---- /dev/null
-+++ b/src/xattrs.c
-@@ -0,0 +1,181 @@
-+/* Create a tar archive.
-+
-+   Copyright (C) 2006 Free Software Foundation, Inc.
-+
-+   Written by James Antill, on 2006-07-27.
-+
-+   This program is free software; you can redistribute it and/or modify it
-+   under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; either version 2, or (at your option) any later
-+   version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
-+   Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this program; if not, write to the Free Software Foundation, Inc.,
-+   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-+
-+#include <system.h>
-+
-+#include <quotearg.h>
-+
-+#include "common.h"
-+
-+
-+#ifndef HAVE_ATTR_XATTR_H
-+# undef HAVE_XATTRS
-+#endif
-+
-+#ifdef HAVE_ATTR_XATTR_H
-+# include <attr/xattr.h>
-+#endif
-+
-+
-+void xattrs_xattrs_get (struct tar_stat_info *st, char const *file_name, int fd)
-+{
-+  if (xattrs_option > 0)
-+    { /* get all xattrs ... this include security.* and system.* if
-+         available. We filter them here, but we have to filter them
-+         in xattrs_xattrs_set() anyway.
-+      */
-+      static ssize_t xsz = 1024;
-+      static char *xatrs = NULL;
-+      ssize_t xret = -1;
-+
-+#ifndef HAVE_XATTRS
-+      static int done = 0;
-+      if ((xattrs_option > 0) && !done)
-+          WARN ((0, 0, _("Xattr support requested, but not available")));
-+      done = 1;
-+#else
-+
-+      if (!xatrs) xatrs = xmalloc (xsz);
-+
-+      while (((fd == -1) ?
-+              ((xret = llistxattr (file_name, xatrs, xsz)) == -1) :
-+              ((xret = flistxattr (fd, xatrs, xsz)) == -1)) &&
-+             (errno == ERANGE))
-+        {
-+          xsz <<= 1;
-+          xatrs = xrealloc (xatrs, xsz);
-+        }
-+
-+      if (xret == -1)
-+        call_arg_warn ((fd == -1) ? "llistxattrs" : "flistxattrs", file_name);
-+      else
-+        {
-+          const char *attr = xatrs;
-+          static ssize_t asz = 1024;
-+          static char *val = NULL;
-+
-+          if (!val) val = xmalloc (asz);
-+
-+          while (xret > 0)
-+            {
-+              size_t len = strlen (attr);
-+              ssize_t aret = 0;
-+
-+              /* Archive all xattrs during creation, decide at extraction time
-+               * which ones are of interest/use for the target filesystem. */
-+              while (((fd == -1) ?
-+                      ((aret = lgetxattr (file_name, attr, val, asz)) == -1) :
-+                      ((aret = fgetxattr (fd, attr, val, asz)) == -1)) &&
-+                     (errno == ERANGE))
-+                {
-+                  asz <<= 1;
-+                  val = xrealloc (val, asz);
-+                }
-+
-+              if (aret != -1)
-+                xheader_xattr_add (st, attr, val, aret);
-+              else if (errno != ENOATTR)
-+                call_arg_warn ((fd==-1) ? "lgetxattr" : "fgetxattr", file_name);
-+
-+              attr += len + 1;
-+              xret -= len + 1;
-+            }
-+        }
-+#endif
-+    }
-+}
-+
-+static void xattrs__fd_set (struct tar_stat_info const *st,
-+                           char const *file_name, char typeflag,
-+                           const char *attr,
-+                           const char *ptr, size_t len)
-+{
-+#ifdef HAVE_XATTRS
-+  if (ptr)
-+    {
-+      const char *sysname = "setxattr";
-+      int ret = -1;
-+
-+      if (typeflag != SYMTYPE)
-+        ret = setxattr (file_name, attr, ptr, len, 0);
-+      else
-+        {
-+          sysname = "lsetxattr";
-+          ret = lsetxattr (file_name, attr, ptr, len, 0);
-+        }
-+
-+      /* do not print warnings when SELinux is disabled */
-+      if ((ret == -1) && (errno != EPERM) && (errno != ENOTSUP))
-+        call_arg_error (sysname, file_name);
-+    }
-+#endif
-+}
-+
-+static char *skip_to_ext_fields (char *ptr)
-+{
-+  ptr += strcspn (ptr, ":,\n"); /* skip tag name. Ie. user/group/default/mask */
-+
-+  if (*ptr != ':')
-+    return (ptr); /* error? no user/group field */
-+  ++ptr;
-+
-+  ptr += strcspn (ptr, ":,\n"); /* skip user/group name */
-+
-+  if (*ptr != ':')
-+    return (ptr); /* error? no perms field */
-+  ++ptr;
-+
-+  ptr += strcspn (ptr, ":,\n"); /* skip perms */
-+
-+  if (*ptr != ':')
-+    return (ptr); /* no extra fields */
-+
-+  return (ptr);
-+}
-+
-+void xattrs_xattrs_set (struct tar_stat_info const *st,
-+                       char const *file_name, char typeflag)
-+{
-+  if ((xattrs_option >= 0) && st->xattr_map_size)
-+    {
-+      size_t scan = 0;
-+
-+#ifndef HAVE_XATTRS
-+      static int done = 0;
-+      if (!done)
-+          WARN ((0, 0, _("Xattr support requested, but not available")));
-+      done = 1;
-+#else
-+      while (scan < st->xattr_map_size)
-+        {
-+          char *keyword = st->xattr_map[scan].xkey;
-+
-+          /* assert (!memcpy (keyword, "SCHILY.xattr.", strlen("SCHILY.xattr."))); */
-+          keyword += strlen ("SCHILY.xattr.");
-+
-+          xattrs__fd_set (st, file_name, typeflag, keyword,
-+                          st->xattr_map[scan].xval_ptr,
-+                          st->xattr_map[scan].xval_len);
-+
-+          ++scan;
-+        }
-+#endif
-+    }
-+}
---- /dev/null
-+++ b/src/xattrs.h
-@@ -0,0 +1,6 @@
-+
-+extern void xattrs_xattrs_get (struct tar_stat_info *st,
-+                               char const *file_name, int fd);
-+
-+extern void xattrs_xattrs_set (struct tar_stat_info const *st,
-+                               char const *file_name, char typeflag);
---- a/src/xheader.c
-+++ b/src/xheader.c
-@@ -460,6 +460,74 @@ xheader_write_global (struct xheader *xhdr)
-     }
- }
- 
-+void xheader_xattr_init (struct tar_stat_info *st)
-+{
-+  st->xattr_map = NULL;
-+  st->xattr_map_size = 0;
-+}
-+
-+void xheader_xattr_free (struct xattr_array *xattr_map, size_t xattr_map_size)
-+{
-+  size_t scan = 0;
-+
-+  while (scan < xattr_map_size)
-+    {
-+      free (xattr_map[scan].xkey);
-+      free (xattr_map[scan].xval_ptr);
-+
-+      ++scan;
-+    }
-+  free (xattr_map);
-+}
-+
-+static void xheader_xattr__add (struct xattr_array **xattr_map,
-+                               size_t *xattr_map_size,
-+                               const char *key, const char *val, size_t len)
-+{
-+  size_t pos = (*xattr_map_size)++;
-+
-+  *xattr_map = xrealloc (*xattr_map,
-+                         *xattr_map_size * sizeof (struct xattr_array));
-+  (*xattr_map)[pos].xkey = xstrdup (key);
-+  (*xattr_map)[pos].xval_ptr = xmemdup (val, len + 1);
-+  (*xattr_map)[pos].xval_len = len;
-+}
-+
-+void xheader_xattr_add (struct tar_stat_info *st,
-+                       const char *key, const char *val, size_t len)
-+{
-+  size_t klen = strlen (key);
-+  char *xkey = xmalloc (strlen("SCHILY.xattr.") + klen + 1);
-+  char *tmp = xkey;
-+
-+  tmp = stpcpy (tmp, "SCHILY.xattr.");
-+  tmp = stpcpy (tmp, key);
-+
-+  xheader_xattr__add (&st->xattr_map, &st->xattr_map_size, xkey, val, len);
-+
-+  free (xkey);
-+}
-+
-+void xheader_xattr_copy (const struct tar_stat_info *st,
-+                        struct xattr_array **xattr_map, size_t *xattr_map_size)
-+{
-+  size_t scan = 0;
-+
-+  *xattr_map = NULL;
-+  *xattr_map_size = 0;
-+
-+  while (scan < st->xattr_map_size)
-+    {
-+      char  *key = st->xattr_map[scan].xkey;
-+      char  *val = st->xattr_map[scan].xval_ptr;
-+      size_t len = st->xattr_map[scan].xval_len;
-+
-+      xheader_xattr__add (xattr_map, xattr_map_size, key, val, len);
-+
-+      ++scan;
-+    }
-+}
-+
- \f
- /* General Interface */
- 
-@@ -473,6 +541,7 @@ struct xhdr_tab
- 		 struct xheader *, void const *data);
-   void (*decoder) (struct tar_stat_info *, char const *, char const *, size_t);
-   int flags;
-+  bool prefix;
- };
- 
- /* This declaration must be extern, because ISO C99 section 6.9.2
-@@ -489,8 +558,17 @@ locate_handler (char const *keyword)
-   struct xhdr_tab const *p;
- 
-   for (p = xhdr_tab; p->keyword; p++)
--    if (strcmp (p->keyword, keyword) == 0)
--      return p;
-+    if (p->prefix)
-+      {
-+        if (strncmp (p->keyword, keyword, strlen(p->keyword)) == 0)
-+          return p;
-+      }
-+  else
-+      {
-+        if (strcmp (p->keyword, keyword) == 0)
-+          return p;
-+      }
-+
-   return NULL;
- }
- 
-@@ -500,7 +578,7 @@ xheader_protected_pattern_p (const char *pattern)
-   struct xhdr_tab const *p;
- 
-   for (p = xhdr_tab; p->keyword; p++)
--    if ((p->flags & XHDR_PROTECTED) && fnmatch (pattern, p->keyword, 0) == 0)
-+    if (!p->prefix && (p->flags & XHDR_PROTECTED) && fnmatch (pattern, p->keyword, 0) == 0)
-       return true;
-   return false;
- }
-@@ -511,7 +589,7 @@ xheader_protected_keyword_p (const char *keyword)
-   struct xhdr_tab const *p;
- 
-   for (p = xhdr_tab; p->keyword; p++)
--    if ((p->flags & XHDR_PROTECTED) && strcmp (p->keyword, keyword) == 0)
-+    if (!p->prefix && (p->flags & XHDR_PROTECTED) && strcmp (p->keyword, keyword) == 0)
-       return true;
-   return false;
- }
-@@ -1470,6 +1548,27 @@ volume_filename_decoder (struct tar_stat_info *st,
- }
- 
- static void
-+xattr_coder (struct tar_stat_info const *st , char const *keyword,
-+             struct xheader *xhdr, void const *data)
-+{
-+  struct xattr_array *xattr_map = st->xattr_map;
-+  const size_t *off = data;
-+  xheader_print_n (xhdr, keyword,
-+                   xattr_map[*off].xval_ptr, xattr_map[*off].xval_len);
-+}
-+
-+static void
-+xattr_decoder (struct tar_stat_info *st,
-+               char const *keyword, char const *arg, size_t size)
-+{
-+  char *xstr = NULL;
-+
-+  xstr = xmemdup (arg, size + 1);
-+  xheader_xattr_add (st, keyword + strlen("SCHILY.xattr."), xstr, size);
-+  free (xstr);
-+}
-+
-+static void
- sparse_major_coder (struct tar_stat_info const *st, char const *keyword,
- 		    struct xheader *xhdr, void const *data)
- {
-@@ -1506,53 +1605,53 @@ sparse_minor_decoder (struct tar_stat_info *st,
- }
- 
- struct xhdr_tab const xhdr_tab[] = {
--  { "atime",	atime_coder,	atime_decoder,	  0 },
--  { "comment",	dummy_coder,	dummy_decoder,	  0 },
--  { "charset",	dummy_coder,	dummy_decoder,	  0 },
--  { "ctime",	ctime_coder,	ctime_decoder,	  0 },
--  { "gid",	gid_coder,	gid_decoder,	  0 },
--  { "gname",	gname_coder,	gname_decoder,	  0 },
--  { "linkpath", linkpath_coder, linkpath_decoder, 0 },
--  { "mtime",	mtime_coder,	mtime_decoder,	  0 },
--  { "path",	path_coder,	path_decoder,	  0 },
--  { "size",	size_coder,	size_decoder,	  0 },
--  { "uid",	uid_coder,	uid_decoder,	  0 },
--  { "uname",	uname_coder,	uname_decoder,	  0 },
-+  { "atime",   atime_coder,    atime_decoder,    0, false },
-+  { "comment", dummy_coder,    dummy_decoder,    0, false },
-+  { "charset", dummy_coder,    dummy_decoder,    0, false },
-+  { "ctime",   ctime_coder,    ctime_decoder,    0, false },
-+  { "gid",     gid_coder,      gid_decoder,      0, false },
-+  { "gname",   gname_coder,    gname_decoder,    0, false },
-+  { "linkpath", linkpath_coder, linkpath_decoder, 0, false },
-+  { "mtime",   mtime_coder,    mtime_decoder,    0, false },
-+  { "path",    path_coder,     path_decoder,     0, false },
-+  { "size",    size_coder,     size_decoder,     0, false },
-+  { "uid",     uid_coder,      uid_decoder,      0, false },
-+  { "uname",   uname_coder,    uname_decoder,    0, false },
- 
-   /* Sparse file handling */
-   { "GNU.sparse.name",       path_coder, path_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   { "GNU.sparse.major",      sparse_major_coder, sparse_major_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   { "GNU.sparse.minor",      sparse_minor_coder, sparse_minor_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   { "GNU.sparse.realsize",   sparse_size_coder, sparse_size_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   { "GNU.sparse.numblocks",  sparse_numblocks_coder, sparse_numblocks_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
- 
-   /* tar 1.14 - 1.15.90 keywords. */
-   { "GNU.sparse.size",       sparse_size_coder, sparse_size_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   /* tar 1.14 - 1.15.1 keywords. Multiple instances of these appeared in 'x'
-      headers, and each of them was meaningful. It confilcted with POSIX specs,
-      which requires that "when extended header records conflict, the last one
-      given in the header shall take precedence." */
-   { "GNU.sparse.offset",     sparse_offset_coder, sparse_offset_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   { "GNU.sparse.numbytes",   sparse_numbytes_coder, sparse_numbytes_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
-   /* tar 1.15.90 keyword, introduced to remove the above-mentioned conflict. */
-   { "GNU.sparse.map",        NULL /* Unused, see pax_dump_header() */,
--    sparse_map_decoder, 0 },
-+    sparse_map_decoder, 0, false },
- 
-   { "GNU.dumpdir",           dumpdir_coder, dumpdir_decoder,
--    XHDR_PROTECTED },
-+    XHDR_PROTECTED, false },
- 
-   /* Keeps the tape/volume label. May be present only in the global headers.
-      Equivalent to GNUTYPE_VOLHDR.  */
-   { "GNU.volume.label", volume_label_coder, volume_label_decoder,
--    XHDR_PROTECTED | XHDR_GLOBAL },
-+    XHDR_PROTECTED | XHDR_GLOBAL, false },
- 
-   /* These may be present in a first global header of the archive.
-      They provide the same functionality as GNUTYPE_MULTIVOL header.
-@@ -1561,11 +1660,14 @@ struct xhdr_tab const xhdr_tab[] = {
-      GNU.volume.offset keeps the offset of the start of this volume,
-      otherwise kept in oldgnu_header.offset.  */
-   { "GNU.volume.filename", volume_label_coder, volume_filename_decoder,
--    XHDR_PROTECTED | XHDR_GLOBAL },
-+    XHDR_PROTECTED | XHDR_GLOBAL, false },
-   { "GNU.volume.size", volume_size_coder, volume_size_decoder,
--    XHDR_PROTECTED | XHDR_GLOBAL },
-+    XHDR_PROTECTED | XHDR_GLOBAL, false },
-   { "GNU.volume.offset", volume_offset_coder, volume_offset_decoder,
--    XHDR_PROTECTED | XHDR_GLOBAL },
-+    XHDR_PROTECTED | XHDR_GLOBAL, false },
-+
-+  /* xattrs use the star format.  note we only save some variants... */
-+  { "SCHILY.xattr", xattr_coder, xattr_decoder, 0, true },
- 
--  { NULL, NULL, NULL, 0 }
-+  { NULL, NULL, NULL, 0, false }
- };

diff --git a/app-arch/tar/files/tar.1 b/app-arch/tar/files/tar.1
deleted file mode 100644
index 5d60127..0000000
--- a/app-arch/tar/files/tar.1
+++ /dev/null
@@ -1,813 +0,0 @@
-.TH TAR 1 "Mar 2010" "GNU" "tar"
-.SH NAME
-tar \- The GNU version of the tape archiver (tar) utility
-.SH SYNOPSIS
-.B tar
-.I <operation> [options]
-
-.I Operations:
-.nf
-.B [-]A --catenate --concatenate
-.B [-]c --create
-.B [-]d --diff --compare
-.B [-]r --append
-.B [-]t --list
-.B [-]u --update
-.B [-]x --extract --get
-.B --delete
-.fi
-
-.I Common Options:
-.nf
-.BR -C ", " --directory " DIR"
-.BR -f ", " --file " FILE"
-.BR -j ", " --bzip2
-.BR -J ", " --xz
-.BR -p ", " --preserve-permissions
-.BR -v ", " --verbose
-.BR -z ", " --gzip
-.fi
-
-.I All Options:
-.br
-[
-.BR -a ", " --auto-compress
-]
-[
-.BR --add-file " FILE"
-]
-[
-.BR --anchored
-]
-[
-.BR --atime-preserve
-]
-[
-.BR -b ", " --blocking-factor " N"
-]
-[
-.BR -B ", " --read-full-records
-]
-[
-.BR --backup " BACKUP-TYPE"
-]
-[
-.BR --block-compress
-]
-[
-.BR -C ", " --directory " DIR"
-]
-[
-.BR --checkpoint
-]
-[
-.BR --delay-directory-restore
-]
-[
-.BR --exclude " PATTERN"
-]
-[
-.BR --exclude-caches
-]
-[
-.BR --exclude-caches-all
-]
-[
-.BR --exclude-caches-under
-]
-[
-.BR --exclude-tag " FILE"
-]
-[
-.BR --exclude-tag-all " FILE"
-]
-[
-.BR --exclude-tag-under " FILE"
-]
-[
-.BR -f ", " --file " [HOSTNAME:]FILE"
-]
-[
-.BR -F ", " --info-script " FILE, " --new-volume-script " FILE"
-]
-[
-.BR --force-local
-]
-[
-.BR --format " FORMAT"
-]
-[
-.BR -g ", " --listed-incremental " SNAPSHOT"
-]
-[
-.BR -G ", " --incremental
-]
-[
-.BR --group " GROUP"
-]
-[
-.BR -h ", " --dereference
-]
-[
-.BR --help
-]
-[
-.BR -i ", " --ignore-zeros
-]
-[
-.BR -I ", " --use-compress-program " PROG"
-]
-[
-.BR --ignore-case
-]
-[
-.BR --ignore-command-error
-]
-[
-.BR --ignore-failed-read
-]
-[
-.BR --index-file " FILE"
-]
-[
-.BR -j ", " --bzip2
-]
-[
-.BR -J ", " --xz
-]
-[
-.BR -k ", " --keep-old-files
-]
-[
-.BR -K ", " --starting-file " FILE"
-]
-[
-.BR --keep-newer-files
-]
-[
-.BR -l ", " --check-links
-]
-[
-.BR -L ", " --tape-length " N"
-]
-[
-.BR --lzip
-]
-[
-.BR --lzma
-]
-[
-.BR --lzop
-]
-[
-.BR -m ", " --touch ", " --modification-time
-]
-[
-.BR -M ", " --multi-volume
-]
-[
-.BR --mode " PERMISSIONS"
-]
-[
-.BR --mtime " DATE"
-]
-[
-.BR -N ", " --after-date " DATE, " --newer " DATE"
-]
-[
-.BR --newer-mtime " DATE"
-]
-[
-.BR --no-anchored
-]
-[
-.BR --no-auto-compress
-]
-[
-.BR --no-delay-directory-restore
-]
-[
-.BR --no-ignore-case
-]
-[
-.BR --no-ignore-command-error
-]
-[
-.BR --no-overwrite-dir
-]
-[
-.BR --no-quote-chars
-]
-[
-.BR --no-recursion
-]
-[
-.BR --no-same-permissions
-]
-[
-.BR --no-unquote
-]
-[
-.BR --no-wildcards
-]
-[
-.BR --no-wildcards-match-slash
-]
-[
-.BR --null
-]
-[
-.BR --numeric-owner
-]
-[
-.BR -o ", " --old-archive ", " --portability ", " --no-same-owner
-]
-[
-.BR -O ", " --to-stdout
-]
-[
-.BR --occurrence " NUM"
-]
-[
-.BR --one-file-system
-]
-[
-.BR --overwrite
-]
-[
-.BR --overwrite-dir
-]
-[
-.BR --owner " USER"
-]
-[
-.BR -p ", " --same-permissions ", " --preserve-permissions
-]
-[
-.BR -P ", " --absolute-names
-]
-[
-.BR --pax-option " KEYWORD-LIST"
-]
-[
-.BR --posix
-]
-[
-.BR --preserve
-]
-[
-.BR --quote-chars " STRING"
-]
-[
-.BR --quote-style " STYLE"
-]
-[
-.BR -R ", " --block-number
-]
-[
-.BR --record-size " SIZE"
-]
-[
-.BR --recursion
-]
-[
-.BR --recursive-unlink
-]
-[
-.BR --remove-files
-]
-[
-.BR --restrict
-]
-[
-.BR --rmt-command " CMD"
-]
-[
-.BR --rsh-command " CMD"
-]
-[
-.BR -s ", " --same-order ", " --preserve-order
-]
-[
-.BR -S ", " --sparse
-]
-[
-.BR --same-owner
-]
-[
-.BR --show-defaults
-]
-[
-.BR --show-omitted-dirs
-]
-[
-.BR --show-transformed-names ", " --show-stored-names
-]
-[
-.BR --strip-components " NUMBER"
-]
-[
-.BR --suffix " SUFFIX"
-]
-[
-.BR -T ", " --files-from " FILE"
-]
-[
-.BR --test-label
-]
-[
-.BR --to-command " COMMAND"
-]
-[
-.BR --transform " EXPRESSION"
-]
-[
-.BR --totals	
-]
-[
-.BR -U ", " --unlink-first
-]
-[
-.BR --unquote
-]
-[
-.BR --utc
-]
-[
-.BR -v ", " --verbose
-]
-[
-.BR -V ", " --label " NAME"
-]
-[
-.BR --version	
-]
-[
-.BR --volno-file " FILE"
-]
-[
-.BR -w ", " --interactive ", " --confirmation
-]
-[
-.BR -W ", " --verify
-]
-[
-.BR --wildcards
-]
-[
-.BR --wildcards-match-slash
-]
-[
-.BR -X ", " --exclude-from " FILE"
-]
-[
-.BR -z ", " --gzip ", " --gunzip ", " --ungzip
-]
-[
-.BR -Z ", " --compress ", " --uncompress
-]
-[
-.BR -[0-7][lmh]
-]
-.SH DESCRIPTION
-This manual page documents the GNU version of \fBtar\fR, an archiving 
-program designed to store and extract files from an archive file known 
-as a \fItarfile\fR.  A \fItarfile\fR may be made on a tape drive, 
-however, it is also common to write a \fItarfile\fR to a normal file.  
-The first argument to \fBtar\fR must be one of the options \fBAcdrtux\fR, 
-followed by any optional functions.  The final arguments to \fBtar\fR 
-are the names of the files or directories which should be archived.  The 
-use of a directory name always implies that the subdirectories below 
-should be included in the archive.
-.SH EXAMPLES
-.TP
-.B tar -xvf foo.tar
-verbosely extract foo.tar
-.TP
-.B tar -xzf foo.tar.gz
-extract gzipped foo.tar.gz
-.TP
-.B tar -cjf foo.tar.bz2 bar/
-create bzipped tar archive of the directory bar called foo.tar.bz2
-.TP
-.B tar -xjf foo.tar.bz2 -C bar/
-extract bzipped foo.tar.bz2 after changing directory to bar
-.TP
-.B tar -xzf foo.tar.gz blah.txt
-extract the file blah.txt from foo.tar.gz
-.P
-Note: When working with archives, specifying the compression option is often
-times unnecessary as \fBtar\fR will automatically detect the compression type
-based on the suffix of the archive.
-.SH "FUNCTION LETTERS"
-.TP
-.B One of the following options must be used:
-.TP
-.BR -A ", " --catenate ", " --concatenate
-append tar files to an archive
-.TP
-.BR -c ", " --create
-create a new archive
-.TP
-.BR -d ", " --diff ", " --compare
-find differences between archive and file system
-.TP
-.BR -r ", " --append
-append files to the end of an archive
-.TP
-.BR -t ", " --list
-list the contents of an archive
-.TP
-.BR -u ", " --update
-only append files that are newer than the existing in archive
-.TP
-.BR -x ", " --extract ", " --get
-extract files from an archive
-.TP
-.BR --delete
-delete from the archive (not for use on magnetic tapes!)
-.SH "COMMON OPTIONS"
-.TP
-.BR -C ", " --directory " DIR"
-change to directory DIR
-.TP
-.BR -f ", " --file " [HOSTNAME:]FILE"
-use archive file or device FILE (default is "-", meaning stdin/stdout)
-.TP
-.BR -j ", " --bzip2
-filter archive through bzip2; use to decompress .bz2 files
-.TP
-.BR -J ", " --xz
-filter archive through xz; use to decompress .xz files
-.TP
-.BR -p ", " --preserve-permissions
-extract all protection information
-.TP
-.BR -v ", " --verbose
-verbosely list files processed
-.TP
-.BR -z ", " --gzip ", " --ungzip
-filter the archive through gzip
-.SH "ALL OPTIONS"
-.TP
-.BR -a ", " --auto-compress
-use archive suffix to determine the compression program
-.TP
-.BR --add-file " FILE"
-add specified FILE to the archive (useful if FILE starts with a dash)
-.TP
-.BR --anchored
-patterns will match the start of file names
-.TP
-.BR --atime-preserve
-don't change access times of files that are archived
-.TP
-.BR -b ", " --blocking-factor " N"
-block size of Nx512 bytes (default N=20)
-.TP
-.BR -B ", " --read-full-blocks
-reblock as we read (for reading 4.2BSD pipes)
-.TP
-.BR --backup " BACKUP-TYPE"
-backup files instead of deleting them using BACKUP-TYPE simple or 
-numbered
-.TP
-.BR --block-compress
-block the output of compression program for tapes
-.TP
-.BR -C ", " --directory " DIR"
-change to directory DIR
-.TP
-.BR --checkpoint
-print directory names while reading the archive
-.TP
-.BR --delay-directory-restore
-delay setting modification times and permissions of extracted directories
-until the end of extraction
-.TP
-.BR --exclude " PATTERN"
-exclude files based upon PATTERN
-.TP
-.BR --exclude-caches
-exclude directories that contain a cache directory tag
-.TP
-.BR --exclude-tag " FILE"
-exclude directories that contain a file named FILE
-.TP
-.BR -f ", " --file " [HOSTNAME:]FILE"
-use archive file or device FILE (default "-", meaning stdin/stdout)
-.TP
-.BR -F ", " --info-script " FILE, " --new-volume-script " FILE"
-run script at end of each tape (implies \fI--multi-volume\fR)
-.TP
-.BR --force-local
-archive file is local even if its name contains a colon
-.TP
-.BR --format " FORMAT"
-selects the format of the created archive
-.nf
-\fIv7\fR - Unix V7
-\fIoldgnu\fR - GNU tar <=1.12
-\fIgnu\fR - GNU tar 1.13
-\fIustar\fR - POSIX.1-1988
-\fIposix\fR - POSIX.1-2001
-.fi
-.TP
-.BR -g ", " --listed-incremental " SNAPSHOT"
-create/list/extract new GNU-format incremental backup
-.TP
-.BR --group " GROUP"
-give files added to the archive a group id of GROUP instead of the group id
-of the source file; this option does not affect extraction
-.TP
-.BR -G ", " --incremental
-create/list/extract old GNU-format incremental backup
-.TP
-.BR -h ", " --dereference
-don't archive symlinks; archive the files they point to
-.TP
-.BR --help
-like this manpage, but not as cool
-.TP
-.BR -i ", " --ignore-zeros
-ignore blocks of zeros in archive (normally mean EOF)
-.TP
-.BR -I ", " --use-compress-program " PROG"
-access the archive through PROG (which is generally a compression program;
-it must accept the \fI-d\fR option)
-.TP
-.BR --ignore-case
-ignore case when excluding files
-.TP
-.BR --ignore-command-error
-ignore exit codes of subprocesses
-.TP
-.BR --ignore-failed-read
-don't exit with non-zero status on unreadable files
-.TP
-.BR --index-file " FILE"
-send verbose output to FILE instead of stdout
-.TP
-.BR -j ", " --bzip2
-filter archive through bzip2, use to decompress .bz2 files
-.TP
-.BR -J ", " --xz
-filter archive through xz; use to decompress .xz files
-.TP
-.BR -k ", " --keep-old-files
-keep existing files; don't overwrite them from archive
-.TP
-.BR -K ", " --starting-file " FILE"
-begin at file FILE in the archive
-.TP
-.BR --keep-newer-files
-do not overwrite files which are newer than the archive
-.TP
-.BR -l ", " --check-links
-warn if number of hard links to the file on the filesystem mismatchs
-the number of links recorded in the archive
-.TP
-.BR -L ", " --tape-length " N"
-change tapes after writing N*1024 bytes
-.TP
-.BR -m ", " --touch ", " --modification-time
-don't extract file modified time
-.TP
-.BR -M ", " --multi-volume
-create/list/extract multi-volume archive
-.TP
-.BR --mode " PERMISSIONS"
-apply PERMISSIONS while adding files (see \fBchmod\fR(1))
-.TP
-.BR --mtime " DATE"
-when creating archives, use  DATE as the modification time of the members,
-instead of their actual modification times
-.TP
-.BR -N ", " --after-date " DATE, " --newer " DATE"
-only store files that were modified or had status updates (permissions,
-ACLs, extended attributes, ...) since DATE
-.TP
-.BR --newer-mtime " DATE"
-like \fI--newer\fR, but only store files that were modified since DATE
-.TP
-.BR --no-anchored
-match any subsequenceof the name's components with \fI--exclude\fR
-.TP
-.BR --no-auto-compress
-do not use archive suffix to determine the compression program
-.TP
-.BR --no-delay-directory-restore
-modification times and permissions of extracted directories are set when
-all files from this directory have been extracted; this is the default
-.TP
-.BR --no-ignore-command-error
-print warnings about subprocesses that terminated with a non-zero exit code
-.TP
-.BR --no-ignore-case
-use case-sensitive matching with \fI--exclude\fR
-.TP
-.BR --no-overwrite-dir
-preserve metadata of existing directories when extracting files from an
-archive
-.TP
-.BR --no-quote-chars " STRING"
-remove characters listed in STRING from the list of quoted characters
-set by a previous \fI--quote-chars\fR option
-.TP
-.BR --no-recursion
-don't recurse into directories
-.TP
-.BR --no-same-permissions
-apply user's umask when extracting files instead of recorded permissions
-.TP
-.BR --no-unquote
-treat all input file or member names literally, do not interpret
-escape sequences
-.TP
-.BR --no-wildcards
-don't use wildcards with \fI--exclude\fR
-.TP
-.BR --no-wildcards-match-slash
-wildcards do not match slashes (/) with \fI--exclude\fR
-.TP
-.BR --null
-\fI--files-from\fR reads null-terminated names, disable \fI--directory\fR
-.TP
-.BR --numeric-owner
-always use numbers for user/group names
-.TP
-.BR -o ", " --old-archive ", " --portability
-like \fI--format=v7\fR; \fI-o\fR exhibits this behavior when creating an 
-archive (deprecated behavior)
-.TP
-.BR -o ", " --no-same-owner
-do not attempt to restore ownership when extracting; \fI-o\fR exhibits 
-this behavior when extracting an archive
-.TP
-.BR -O ", " --to-stdout
-extract files to standard output
-.TP
-.BR --occurrence " NUM"
-process only NUM occurrences of each named file; used with 
-\fI--delete\fR, \fI--diff\fR, \fI--extract\fR, or \fI--list\fR
-.TP
-.BR --one-file-system
-stay in local file system when creating an archive
-.TP
-.BR --overwrite
-overwrite existing files and directory metadata when extracting
-.TP
-.BR --overwrite-dir
-overwrite directory metadata when extracting
-.TP
-.BR --owner " USER"
-give files added to the archive a user id of USER instead of the user id
-of the source file; this option does not affect extraction
-.TP
-.BR -p ", " --preserve-permissions ", " --same-permissions
-extract all protection information
-.TP
-.BR -P ", " --absolute-names
-don't strip leading `/'s from file names
-.TP
-.BR --pax-option " KEYWORD-LIST"
-used only with POSIX.1-2001 archives to modify the way \fBtar\fR handles 
-extended header keywords
-.TP
-.BR --posix
-like \fI--format=posix\fR
-.TP
-.BR --preserve
-like \fI--preserve-permissions\fR plus \fI--same-order\fR
-.TP
-.BR --quote-chars " STRING"
-always quote the characters from STRING, even if the selected quoting
-style would not quote them
-.TP
-.BR --quote-style " STYLE"
-set the quoting style to be used when printing member and file names
-.TP
-.BR -R ", " --record-number
-show record number within archive with each message
-.TP
-.BR --record-size " SIZE"
-use SIZE bytes per record when accessing archives
-.TP
-.BR --recursion
-recurse into directories
-.TP
-.BR --recursive-unlink
-remove existing directories before extracting directories of the same name
-.TP
-.BR --remove-files
-remove files after adding them to the archive
-.TP
-.BR --restrict
-disable the use of some potentially harmful options; currently this
-disables shell invocation from the multi-volume menu
-.TP
-.BR --rmt-command " CMD"
-use CMD instead of the default /usr/sbin/rmt
-.TP
-.BR --rsh-command " CMD"
-use remote CMD instead of \fBrsh\fR(1)
-.TP
-.BR -s ", " --same-order ", " --preserve-order
-list of names to extract is sorted to match archive
-.TP
-.BR -S ", " --sparse
-handle sparse files efficiently
-.TP
-.BR --same-owner
-create extracted files with the same ownership 
-.TP
-.BR --show-defaults
-display the default options used by \fBtar\fR
-.TP
-.BR --show-omitted-dirs
-print directories \fBtar\fR skips while operating on an archive
-.TP
-.BR --show-transformed-names ", " --show-stored-names
-display file or member names after applying any \fBsed\fR transformations
-.TP
-.BR --strip-components " NUMBER"
-strip NUMBER of leading path components from file names before extraction
-.TP
-.BR --suffix " SUFFIX"
-use SUFFIX instead of default '~' when backing up files
-.TP
-.BR -T ", " --files-from " FILE"
-get names to extract or create from file FILE
-.TP
-.BR --test-label
-read the volume label; if an argument is specified, test whether it
-matches the volume label
-.TP
-.BR --to-command " COMMAND"
-during extraction, pipe extracted files to the standard input of COMMAND
-.TP
-.BR --totals
-print total bytes written with --create
-.TP
-.BR --transform " EXPRESSION"
-transform file or member names using the \fBsed\fR replacement expression
-EXPRESSION
-.TP
-.BR -U ", " --unlink-first
-remove existing files before extracting files of the same name
-.TP
-.BR --unquote
-enable unquoting input file or member names; this is the default
-.TP
-.BR --utc
-display file modification dates in UTC
-.TP
-.BR -v ", " --verbose
-verbosely list files processed
-.TP
-.BR -V ", " --label " NAME"
-create archive with volume name NAME
-.TP
-.BR --version
-print \fBtar\fR program version number
-.TP
-.BR --volno-file " FILE"
-keep track of which volume of a multi-volume archive its working in 
-FILE; used with \fI--multi-volume\fR
-.TP
-.BR -w ", " --interactive ", " --confirmation
-ask for confirmation for every action
-.TP
-.BR -W ", " --verify
-attempt to verify the archive after writing it
-.TP
-.BR --wildcards
-use wildcards with \fI--exclude\fR
-.TP
-.BR --wildcards-match-slash
-wildcards match slashes (/) with \fI--exclude\fR
-.TP
-.BR -X ", " --exclude-from " FILE"
-exclude files listed in FILE
-.TP
-.BR -z ", " --gzip ", " --gunzip ", " --ungzip
-filter the archive through gzip
-.TP
-.BR -Z ", " --compress ", " --uncompress
-filter the archive through compress
-.TP
-.BR -[0-7][lmh]
-specify drive and density
-.SH BUGS
-The GNU folks, in general, abhor man pages and create info documents instead.
-The maintainer of \fBtar\fR falls into this category.  Thus, this man page may 
-not be complete nor current, and it is included in the Gentoo portage tree 
-because man is a great tool :).  This man page was first taken from Debian 
-Linux and has since been lovingly updated here.
-.SH "REPORTING BUGS"
-Please report bugs via http://bugs.gentoo.org/
-.SH "AUTHORS"
-.nf
-Debian Linux http://www.debian.org/
-Mike Frysinger <vapier@gentoo.org>
-.fi

diff --git a/app-arch/tar/tar-1.26-r1.ebuild b/app-arch/tar/tar-1.26-r1.ebuild
deleted file mode 100644
index a0a5829..0000000
--- a/app-arch/tar/tar-1.26-r1.ebuild
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="3"
-
-inherit flag-o-matic eutils autotools
-
-DESCRIPTION="Use this to make tarballs :)"
-HOMEPAGE="https://www.gnu.org/software/tar/"
-SRC_URI="mirror://gnu/tar/${P}.tar.bz2
-	mirror://gnu-alpha/tar/${P}.tar.bz2"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="minimal nls static userland_GNU xattr"
-
-RDEPEND="xattr? ( sys-apps/attr )"
-DEPEND="${RDEPEND}
-	nls? ( >=sys-devel/gettext-0.10.35 )"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-xattr.patch #382067
-	epatch "${FILESDIR}"/${P}-no-gets.patch
-	eautoreconf
-
-	if ! use userland_GNU ; then
-		sed -i \
-			-e 's:/backup\.sh:/gbackup.sh:' \
-			scripts/{backup,dump-remind,restore}.in \
-			|| die "sed non-GNU"
-	fi
-}
-
-src_configure() {
-	use static && append-ldflags -static
-	FORCE_UNSAFE_CONFIGURE=1 \
-	econf \
-		--enable-backup-scripts \
-		--bindir="${EPREFIX}"/bin \
-		--libexecdir="${EPREFIX}"/usr/sbin \
-		$(usex userland_GNU "" "--program-prefix=g") \
-		$(use_enable nls) \
-		$(use_enable xattr)
-}
-
-src_install() {
-	emake DESTDIR="${D}" install || die
-
-	local p=$(usex userland_GNU "" "g")
-	if [[ -z ${p} ]] ; then
-		# a nasty yet required piece of baggage
-		exeinto /etc
-		doexe "${FILESDIR}"/rmt || die
-	fi
-
-	# autoconf looks for gtar before tar (in configure scripts), hence
-	# in Prefix it is important that it is there, otherwise, a gtar from
-	# the host system (FreeBSD, Solaris, Darwin) will be found instead
-	# of the Prefix provided (GNU) tar
-	if use prefix ; then
-		dosym tar /bin/gtar
-	fi
-
-	dodoc AUTHORS ChangeLog* NEWS README* THANKS
-	newman "${FILESDIR}"/tar.1 ${p}tar.1
-	mv "${ED}"/usr/sbin/${p}backup{,-tar}
-	mv "${ED}"/usr/sbin/${p}restore{,-tar}
-
-	if use minimal ; then
-		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
-			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
-			-delete
-	fi
-}

diff --git a/app-arch/tar/tar-1.28.ebuild b/app-arch/tar/tar-1.28.ebuild
deleted file mode 100644
index 0b13822..0000000
--- a/app-arch/tar/tar-1.28.ebuild
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-
-inherit flag-o-matic eutils
-
-DESCRIPTION="Use this to make tarballs :)"
-HOMEPAGE="https://www.gnu.org/software/tar/"
-SRC_URI="mirror://gnu/tar/${P}.tar.bz2
-	mirror://gnu-alpha/tar/${P}.tar.bz2"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl minimal nls selinux static userland_GNU xattr"
-
-RDEPEND="acl? ( virtual/acl )
-	selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}
-	nls? ( >=sys-devel/gettext-0.10.35 )
-	xattr? ( sys-apps/attr )"
-
-src_prepare() {
-	if ! use userland_GNU ; then
-		sed -i \
-			-e 's:/backup\.sh:/gbackup.sh:' \
-			scripts/{backup,dump-remind,restore}.in \
-			|| die "sed non-GNU"
-	fi
-}
-
-src_configure() {
-	use static && append-ldflags -static
-	FORCE_UNSAFE_CONFIGURE=1 \
-	econf \
-		--enable-backup-scripts \
-		--bindir="${EPREFIX}"/bin \
-		--libexecdir="${EPREFIX}"/usr/sbin \
-		$(usex userland_GNU "" "--program-prefix=g") \
-		$(use_with acl posix-acls) \
-		$(use_enable nls) \
-		$(use_with selinux) \
-		$(use_with xattr xattrs)
-}
-
-src_install() {
-	emake DESTDIR="${D}" install
-
-	local p=$(usex userland_GNU "" "g")
-	if [[ -z ${p} ]] ; then
-		# a nasty yet required piece of baggage
-		exeinto /etc
-		doexe "${FILESDIR}"/rmt
-	fi
-
-	# autoconf looks for gtar before tar (in configure scripts), hence
-	# in Prefix it is important that it is there, otherwise, a gtar from
-	# the host system (FreeBSD, Solaris, Darwin) will be found instead
-	# of the Prefix provided (GNU) tar
-	if use prefix ; then
-		dosym tar /bin/gtar
-	fi
-
-	dodoc AUTHORS ChangeLog* NEWS README* THANKS
-	mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
-	mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
-
-	if use minimal ; then
-		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
-			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
-			-delete || die
-	fi
-}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2016-10-28 17:56 Patrick McLean
  0 siblings, 0 replies; 9+ messages in thread
From: Patrick McLean @ 2016-10-28 17:56 UTC (permalink / raw
  To: gentoo-commits

commit:     f79804de6297450e101d97411e7f74f06d22d787
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 17:56:30 2016 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 17:56:30 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f79804de

app-arch/tar: Revision bump to 1.29-r1 to add patch for CVE-2016-6321

Gentoo-Bug: 598334

Package-Manager: portage-2.3.2

 .../files/tar-1.29-extract-pathname-bypass.patch   | 27 ++++++++
 app-arch/tar/tar-1.29-r1.ebuild                    | 81 ++++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/app-arch/tar/files/tar-1.29-extract-pathname-bypass.patch b/app-arch/tar/files/tar-1.29-extract-pathname-bypass.patch
new file mode 100644
index 00000000..6470fe0
--- /dev/null
+++ b/app-arch/tar/files/tar-1.29-extract-pathname-bypass.patch
@@ -0,0 +1,27 @@
+--- a/lib/paxnames.c	2016-04-06 00:04:47.314860045 +0300
++++ b/lib/paxnames.c	2016-04-06 02:08:44.962297881 +0300
+@@ -18,6 +18,7 @@
+ #include <system.h>
+ #include <hash.h>
+ #include <paxlib.h>
++#include <quotearg.h>
+ 
+ \f
+ /* Hash tables of strings.  */
+@@ -114,7 +115,15 @@
+       for (p = file_name + prefix_len; *p; )
+ 	{
+           if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
+-	    prefix_len = p + 2 - file_name;
++            {
++	      static char const *const diagnostic[] =
++	      {
++		N_("%s: Member name contains '..'"),
++		N_("%s: Hard link target contains '..'")
++	      };
++	      ERROR ((0, 0, _(diagnostic[link_target]),
++	              quotearg_colon (file_name)));
++	    }
+ 
+ 	  do
+ 	    {

diff --git a/app-arch/tar/tar-1.29-r1.ebuild b/app-arch/tar/tar-1.29-r1.ebuild
new file mode 100644
index 00000000..138eccb
--- /dev/null
+++ b/app-arch/tar/tar-1.29-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Use this to make tarballs :)"
+HOMEPAGE="https://www.gnu.org/software/tar/"
+SRC_URI="mirror://gnu/tar/${P}.tar.bz2
+	mirror://gnu-alpha/tar/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
+
+RDEPEND="acl? ( virtual/acl )
+	selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+	nls? ( >=sys-devel/gettext-0.10.35 )
+	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
+
+PATCHES=(
+	"${FILESDIR}/${P}-extract-pathname-bypass.patch"
+)
+
+src_prepare() {
+	epatch "${PATCHES[@]}"
+	epatch_user
+
+	if ! use userland_GNU ; then
+		sed -i \
+			-e 's:/backup\.sh:/gbackup.sh:' \
+			scripts/{backup,dump-remind,restore}.in \
+			|| die "sed non-GNU"
+	fi
+}
+
+src_configure() {
+	use static && append-ldflags -static
+	FORCE_UNSAFE_CONFIGURE=1 \
+	econf \
+		--enable-backup-scripts \
+		--bindir="${EPREFIX}"/bin \
+		--libexecdir="${EPREFIX}"/usr/sbin \
+		$(usex userland_GNU "" "--program-prefix=g") \
+		$(use_with acl posix-acls) \
+		$(use_enable nls) \
+		$(use_with selinux) \
+		$(use_with xattr xattrs)
+}
+
+src_install() {
+	default
+
+	local p=$(usex userland_GNU "" "g")
+	if [[ -z ${p} ]] ; then
+		# a nasty yet required piece of baggage
+		exeinto /etc
+		doexe "${FILESDIR}"/rmt
+	fi
+
+	# autoconf looks for gtar before tar (in configure scripts), hence
+	# in Prefix it is important that it is there, otherwise, a gtar from
+	# the host system (FreeBSD, Solaris, Darwin) will be found instead
+	# of the Prefix provided (GNU) tar
+	if use prefix ; then
+		dosym tar /bin/gtar
+	fi
+
+	mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
+	mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
+
+	if use minimal ; then
+		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
+			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
+			-delete || die
+	fi
+}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2016-12-20 22:21 Mike Frysinger
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2016-12-20 22:21 UTC (permalink / raw
  To: gentoo-commits

commit:     fa002a1c28b0803731d5403108633a11e28126a8
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 20 22:20:09 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Dec 20 22:21:08 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa002a1c

app-arch/tar: move to upstream patch for extract bypass #598334

The patch that we were using was from the security authors, not from
the upstream GNU tar project.  Turns out their patch breaks creation
of archives that use .. names too.  See https://crbug.com/674472#5.

 ...tar-1.29-extract-pathname-bypass-upstream.patch | 60 ++++++++++++++++
 app-arch/tar/tar-1.29-r2.ebuild                    | 80 ++++++++++++++++++++++
 2 files changed, 140 insertions(+)

diff --git a/app-arch/tar/files/tar-1.29-extract-pathname-bypass-upstream.patch b/app-arch/tar/files/tar-1.29-extract-pathname-bypass-upstream.patch
new file mode 100644
index 00000000..2030ca6
--- /dev/null
+++ b/app-arch/tar/files/tar-1.29-extract-pathname-bypass-upstream.patch
@@ -0,0 +1,60 @@
+https://bugs.gentoo.org/598334
+
+From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
+Date: Sat, 29 Oct 2016 21:04:40 -0700
+Subject: [PATCH] When extracting, skip ".." members
+
+* NEWS: Document this.
+* src/extract.c (extract_archive): Skip members whose names
+contain "..".
+---
+ NEWS          | 8 +++++++-
+ src/extract.c | 8 ++++++++
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+--- a/NEWS
++++ b/NEWS
+@@ -1,6 +1,16 @@
+ GNU tar NEWS - User visible changes. 2016-05-16
+ Please send GNU tar bug reports to <bug-tar@gnu.org>
+ 
++
++\f
++version 1.29-r2+ Gentoo
++
++* Member names containing '..' components are now skipped when extracting.
++
++This fixes tar's behavior to match its documentation, and is a bit
++safer when extracting untrusted archives over old files (an unsafe
++practice that the tar manual has long recommended against).
++
+ \f
+ version 1.29 - Sergey Poznyakoff, 2016-05-16
+ 
+--- a/src/extract.c
++++ b/src/extract.c
+@@ -1629,12 +1629,20 @@
+ {
+   char typeflag;
+   tar_extractor_t fun;
++  bool skip_dotdot_name;
+ 
+   fatal_exit_hook = extract_finish;
+ 
+   set_next_block_after (current_header);
+ 
++  skip_dotdot_name = (!absolute_names_option
++		      && contains_dot_dot (current_stat_info.orig_file_name));
++  if (skip_dotdot_name)
++    ERROR ((0, 0, _("%s: Member name contains '..'"),
++	    quotearg_colon (current_stat_info.orig_file_name)));
++
+   if (!current_stat_info.file_name[0]
++      || skip_dotdot_name
+       || (interactive_option
+ 	  && !confirm ("extract", current_stat_info.file_name)))
+     {
+-- 
+2.11.0.rc2
+

diff --git a/app-arch/tar/tar-1.29-r2.ebuild b/app-arch/tar/tar-1.29-r2.ebuild
new file mode 100644
index 00000000..dc2ade4
--- /dev/null
+++ b/app-arch/tar/tar-1.29-r2.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Use this to make tarballs :)"
+HOMEPAGE="https://www.gnu.org/software/tar/"
+SRC_URI="mirror://gnu/tar/${P}.tar.bz2
+	mirror://gnu-alpha/tar/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
+
+RDEPEND="acl? ( virtual/acl )
+	selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+	nls? ( >=sys-devel/gettext-0.10.35 )
+	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
+
+PATCHES=(
+	"${FILESDIR}/${P}-extract-pathname-bypass-upstream.patch" #598334
+)
+
+src_prepare() {
+	epatch "${PATCHES[@]}"
+	epatch_user
+
+	if ! use userland_GNU ; then
+		sed -i \
+			-e 's:/backup\.sh:/gbackup.sh:' \
+			scripts/{backup,dump-remind,restore}.in \
+			|| die "sed non-GNU"
+	fi
+}
+
+src_configure() {
+	use static && append-ldflags -static
+	FORCE_UNSAFE_CONFIGURE=1 \
+	econf \
+		--enable-backup-scripts \
+		--bindir="${EPREFIX}"/bin \
+		--libexecdir="${EPREFIX}"/usr/sbin \
+		$(usex userland_GNU "" "--program-prefix=g") \
+		$(use_with acl posix-acls) \
+		$(use_enable nls) \
+		$(use_with selinux) \
+		$(use_with xattr xattrs)
+}
+
+src_install() {
+	default
+
+	local p=$(usex userland_GNU "" "g")
+	if [[ -z ${p} ]] ; then
+		# a nasty yet required piece of baggage
+		exeinto /etc
+		doexe "${FILESDIR}"/rmt
+	fi
+
+	# autoconf looks for gtar before tar (in configure scripts), hence
+	# in Prefix it is important that it is there, otherwise, a gtar from
+	# the host system (FreeBSD, Solaris, Darwin) will be found instead
+	# of the Prefix provided (GNU) tar
+	if use prefix ; then
+		dosym tar /bin/gtar
+	fi
+
+	mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
+	mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
+
+	if use minimal ; then
+		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
+			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
+			-delete || die
+	fi
+}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2017-12-18 18:34 Thomas Deutschmann
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Deutschmann @ 2017-12-18 18:34 UTC (permalink / raw
  To: gentoo-commits

commit:     2e5075768d9c5abc55782ffb650e5df117f518f6
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 18 18:33:16 2017 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 18:33:53 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e507576

app-arch/tar: Fix test 92

Closes: https://bugs.gentoo.org/641508
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 app-arch/tar/files/tar-1.30-fix-test-92.patch | 13 +++++++++++++
 app-arch/tar/tar-1.30.ebuild                  |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/app-arch/tar/files/tar-1.30-fix-test-92.patch b/app-arch/tar/files/tar-1.30-fix-test-92.patch
new file mode 100644
index 00000000000..d5a63e4ab35
--- /dev/null
+++ b/app-arch/tar/files/tar-1.30-fix-test-92.patch
@@ -0,0 +1,13 @@
+http://lists.gnu.org/archive/html/bug-tar/2017-12/msg00027.html
+
+--- a/tests/difflink.at
++++ b/tests/difflink.at
+@@ -21,7 +21,7 @@ mkdir a
+ genfile -f a/x
+ ln -s x a/y
+ ln a/y a/z
+-tar cf a.tar a
++tar cf a.tar a/x a/y a/z
+ rm a/z
+ ln -s x a/z
+ tar df a.tar

diff --git a/app-arch/tar/tar-1.30.ebuild b/app-arch/tar/tar-1.30.ebuild
index 7a541404f34..a06f678cc89 100644
--- a/app-arch/tar/tar-1.30.ebuild
+++ b/app-arch/tar/tar-1.30.ebuild
@@ -21,6 +21,8 @@ DEPEND="${RDEPEND}
 	nls? ( >=sys-devel/gettext-0.10.35 )
 	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
 
+PATCHES=( "${FILESDIR}"/${P}-fix-test-92.patch )
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2018-07-16  6:45 Lars Wendler
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Wendler @ 2018-07-16  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     de933339703cdb66aa0298c231b9d4fe0e54e106
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 16 06:44:49 2018 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jul 16 06:44:49 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de933339

app-arch/tar: Removed old.

Package-Manager: Portage-2.3.42, Repoman-2.3.9

 app-arch/tar/Manifest                              |   1 -
 app-arch/tar/files/tar-1.29-add-files.patch        | 194 ---------------------
 ...tar-1.29-extract-pathname-bypass-upstream.patch |  60 -------
 .../files/tar-1.29-extract-pathname-bypass.patch   |  27 ---
 app-arch/tar/tar-1.29-r1.ebuild                    |  80 ---------
 app-arch/tar/tar-1.29-r3.ebuild                    |  81 ---------
 6 files changed, 443 deletions(-)

diff --git a/app-arch/tar/Manifest b/app-arch/tar/Manifest
index c087d7a3260..4d3b42f1260 100644
--- a/app-arch/tar/Manifest
+++ b/app-arch/tar/Manifest
@@ -1,2 +1 @@
-DIST tar-1.29.tar.bz2 2715993 BLAKE2B 656b77a49c463ec7ade87a97b71469dadbf01551131bdf0cfa895b7b2a7d073a4cd51e9bec4169b134d83155aca18af1a89ddb5d14cb1dc0d9968184870d69f3 SHA512 d2cea9892892dfa0c8efd390303b75dccc085c4895e07ced684074592d69729916d6ea12475aa6aff873d076a729bb7dc2499c233edcfb9c7e8e8995481eef3b
 DIST tar-1.30.tar.bz2 2858639 BLAKE2B 82a8b1fbf1eb5c0347b2f8cf35854498e2955eb85eaf041ec44a38bbd9bc82cc7184d5cb858f9905f503c9178ec6d0ed50be2dc27be9933b29e0a18b8e6c0b8f SHA512 07a1157430898fee1a2c6fd3853d59d4ae13998db685669c8c702f73d2466eeb9892f84a5f0495bfe088c8190a643a99ac9f2cb16b85c9fe3ae0d83cc0f338e8

diff --git a/app-arch/tar/files/tar-1.29-add-files.patch b/app-arch/tar/files/tar-1.29-add-files.patch
deleted file mode 100644
index 8ab15ac32af..00000000000
--- a/app-arch/tar/files/tar-1.29-add-files.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-From 3a283cfe9f8f1f127e8dc5597a5ea1d249985a54 Mon Sep 17 00:00:00 2001
-From: Sergey Poznyakoff <gray@gnu.org>
-Date: Sat, 12 Nov 2016 11:20:47 +0200
-Subject: [PATCH] Fix the --add-file option.
-
-* src/common.h (name_more_files): New proto.
-(files_from_option): Remove.
-* src/names.c (name_more_files): New file.
-(names_options): Fix declaration of the
-add-file option.
-(names_parse_opt): Handle --add-file.
-* src/tar.c (struct tar_args): Remove the input_files member.
-Change all uses: use name_more_files() instead.
-* tests/Makefile.am: Add new test.
-* tests/add-file.at: New testcase.
-* tests/testsuite.at: Add new test.
----
- src/common.h       |  4 +---
- src/names.c        | 24 ++++++++++++-------
- src/tar.c          | 16 ++++---------
- tests/Makefile.am  |  3 ++-
- tests/add-file.at  | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- tests/testsuite.at |  1 +
- 6 files changed, 92 insertions(+), 23 deletions(-)
- create mode 100644 tests/add-file.at
-
-diff --git a/src/common.h b/src/common.h
-index 50c34cc7c09b..6fdb6225f18b 100644
---- a/src/common.h
-+++ b/src/common.h
-@@ -414,9 +414,6 @@ GLOBAL bool show_transformed_names_option;
-    timestamps from archives with an unusual member order. It is automatically
-    set for incremental archives. */
- GLOBAL bool delay_directory_restore_option;
--
--/* When set, tar will not refuse to create empty archives */
--GLOBAL bool files_from_option;
- \f
- /* Declarations for each module.  */
- 
-@@ -738,6 +735,7 @@ void uid_to_uname (uid_t uid, char **uname);
- int uname_to_uid (char const *uname, uid_t *puid);
- 
- void name_init (void);
-+bool name_more_files (void);
- void name_add_name (const char *name);
- void name_term (void);
- const char *name_next (int change_dirs);
-diff --git a/src/names.c b/src/names.c
-index 219aa77a4356..1a9465667cd3 100644
---- a/src/names.c
-+++ b/src/names.c
-@@ -32,7 +32,8 @@ static void name_add_file (const char *name);
- \f
- enum
-   {
--    EXCLUDE_BACKUPS_OPTION = 256,
-+    ADD_FILE_OPTION = 256,
-+    EXCLUDE_BACKUPS_OPTION,
-     EXCLUDE_CACHES_OPTION,
-     EXCLUDE_CACHES_UNDER_OPTION,
-     EXCLUDE_CACHES_ALL_OPTION,
-@@ -67,7 +68,7 @@ static struct argp_option names_options[] = {
-   {NULL, 0, NULL, 0,
-    N_("Local file name selection:"), GRID },
- 
--  {"add-file", ARGP_KEY_ARG, N_("FILE"), 0,
-+  {"add-file", ADD_FILE_OPTION, N_("FILE"), 0,
-    N_("add given FILE to the archive (useful if its name starts with a dash)"), GRID+1 },
-   {"directory", 'C', N_("DIR"), 0,
-    N_("change to directory DIR"), GRID+1 },
-@@ -190,10 +191,10 @@ names_parse_opt (int key, char *arg, struct argp_state *state)
- 
-     case 'T':
-       name_add_file (arg);
--      /* Indicate we've been given -T option. This is for backward
--	 compatibility only, so that `tar cfT archive /dev/null will
--	 succeed */
--      files_from_option = true;
-+      break;
-+
-+    case ADD_FILE_OPTION:
-+      name_add_name (arg);
-       break;
- 
-     default:
-@@ -651,8 +652,8 @@ struct name_elt        /* A name_array element. */
-   } v;
- };
- 
--static struct name_elt *name_head;  /* store a list of names */
--size_t name_count;	 	    /* how many of the entries are names? */
-+static struct name_elt *name_head;/* store a list of names */
-+size_t name_count;	 	  /* how many of the entries are file names? */
- 
- static struct name_elt *
- name_elt_alloc (void)
-@@ -784,6 +785,12 @@ name_list_advance (void)
-     }
- }
- 
-+/* Return true if there are names or options in the list */
-+bool
-+name_more_files (void)
-+{
-+  return name_count > 0;
-+}
- 
- /* Add to name_array the file NAME with fnmatch options MATFLAGS */
- void
-@@ -823,6 +830,7 @@ name_add_file (const char *name)
-   ep->v.file.name = name;
-   ep->v.file.line = 0;
-   ep->v.file.fp = NULL;
-+  name_count++;
- }
- \f
- /* Names from external name file.  */
-diff --git a/src/tar.c b/src/tar.c
-index 35bac38c2793..a361fc2c607f 100644
---- a/src/tar.c
-+++ b/src/tar.c
-@@ -813,7 +813,6 @@ struct tar_args        /* Variables used during option parsing */
-   bool pax_option;                 /* True if --pax-option was given */
-   char const *backup_suffix_string;   /* --suffix option argument */
-   char const *version_control_string; /* --backup option argument */
--  bool input_files;                /* True if some input files where given */
-   int compress_autodetect;         /* True if compression autodetection should
- 				      be attempted when creating archives */
- };
-@@ -1322,7 +1321,6 @@ parse_opt (int key, char *arg, struct argp_state *state)
-     case ARGP_KEY_ARG:
-       /* File name or non-parsed option, because of ARGP_IN_ORDER */
-       name_add_name (arg);
--      args->input_files = true;
-       break;
- 
-     case 'A':
-@@ -2179,7 +2177,7 @@ more_options (int argc, char **argv, struct option_locus *loc)
-   args.loc = loc;
-   if (argp_parse (&argp, argc, argv, ARGP_IN_ORDER|ARGP_NO_EXIT, &idx, &args))
-     abort (); /* shouldn't happen */
--  if (loc->source == OPTS_ENVIRON && args.input_files)
-+  if (loc->source == OPTS_ENVIRON && name_more_files ())
-     USAGE_ERROR ((0, 0, _("non-option arguments in %s"), loc->name));
- }
- 
-@@ -2221,7 +2219,6 @@ decode_options (int argc, char **argv)
-   args.pax_option = false;
-   args.backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
-   args.version_control_string = 0;
--  args.input_files = false;
-   args.compress_autodetect = false;
- 
-   subcommand_option = UNKNOWN_SUBCOMMAND;
-@@ -2340,10 +2337,7 @@ decode_options (int argc, char **argv)
- 
-   /* Handle operands after any "--" argument.  */
-   for (; idx < argc; idx++)
--    {
--      name_add_name (argv[idx]);
--      args.input_files = true;
--    }
-+    name_add_name (argv[idx]);
- 
-   /* Derive option values and check option consistency.  */
- 
-@@ -2365,7 +2359,7 @@ decode_options (int argc, char **argv)
- 
-   if (occurrence_option)
-     {
--      if (!args.input_files)
-+      if (!name_more_files ())
- 	USAGE_ERROR ((0, 0,
- 		      _("--occurrence is meaningless without a file list")));
-       if (!IS_SUBCOMMAND_CLASS (SUBCL_OCCUR))
-@@ -2569,7 +2563,7 @@ decode_options (int argc, char **argv)
-     {
-       /* --test-label is silent if the user has specified the label name to
- 	 compare against. */
--      if (!args.input_files)
-+      if (!name_more_files ())
- 	verbose_option++;
-     }
-   else if (utc_option)
-@@ -2598,7 +2592,7 @@ decode_options (int argc, char **argv)
-   switch (subcommand_option)
-     {
-     case CREATE_SUBCOMMAND:
--      if (!args.input_files && !files_from_option)
-+      if (!name_more_files ())
- 	USAGE_ERROR ((0, 0,
- 		      _("Cowardly refusing to create an empty archive")));
-       if (args.compress_autodetect && archive_names

diff --git a/app-arch/tar/files/tar-1.29-extract-pathname-bypass-upstream.patch b/app-arch/tar/files/tar-1.29-extract-pathname-bypass-upstream.patch
deleted file mode 100644
index 2030ca6d2bd..00000000000
--- a/app-arch/tar/files/tar-1.29-extract-pathname-bypass-upstream.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-https://bugs.gentoo.org/598334
-
-From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
-Date: Sat, 29 Oct 2016 21:04:40 -0700
-Subject: [PATCH] When extracting, skip ".." members
-
-* NEWS: Document this.
-* src/extract.c (extract_archive): Skip members whose names
-contain "..".
----
- NEWS          | 8 +++++++-
- src/extract.c | 8 ++++++++
- 2 files changed, 15 insertions(+), 1 deletion(-)
-
---- a/NEWS
-+++ b/NEWS
-@@ -1,6 +1,16 @@
- GNU tar NEWS - User visible changes. 2016-05-16
- Please send GNU tar bug reports to <bug-tar@gnu.org>
- 
-+
-+\f
-+version 1.29-r2+ Gentoo
-+
-+* Member names containing '..' components are now skipped when extracting.
-+
-+This fixes tar's behavior to match its documentation, and is a bit
-+safer when extracting untrusted archives over old files (an unsafe
-+practice that the tar manual has long recommended against).
-+
- \f
- version 1.29 - Sergey Poznyakoff, 2016-05-16
- 
---- a/src/extract.c
-+++ b/src/extract.c
-@@ -1629,12 +1629,20 @@
- {
-   char typeflag;
-   tar_extractor_t fun;
-+  bool skip_dotdot_name;
- 
-   fatal_exit_hook = extract_finish;
- 
-   set_next_block_after (current_header);
- 
-+  skip_dotdot_name = (!absolute_names_option
-+		      && contains_dot_dot (current_stat_info.orig_file_name));
-+  if (skip_dotdot_name)
-+    ERROR ((0, 0, _("%s: Member name contains '..'"),
-+	    quotearg_colon (current_stat_info.orig_file_name)));
-+
-   if (!current_stat_info.file_name[0]
-+      || skip_dotdot_name
-       || (interactive_option
- 	  && !confirm ("extract", current_stat_info.file_name)))
-     {
--- 
-2.11.0.rc2
-

diff --git a/app-arch/tar/files/tar-1.29-extract-pathname-bypass.patch b/app-arch/tar/files/tar-1.29-extract-pathname-bypass.patch
deleted file mode 100644
index 6470fe082bd..00000000000
--- a/app-arch/tar/files/tar-1.29-extract-pathname-bypass.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/lib/paxnames.c	2016-04-06 00:04:47.314860045 +0300
-+++ b/lib/paxnames.c	2016-04-06 02:08:44.962297881 +0300
-@@ -18,6 +18,7 @@
- #include <system.h>
- #include <hash.h>
- #include <paxlib.h>
-+#include <quotearg.h>
- 
- \f
- /* Hash tables of strings.  */
-@@ -114,7 +115,15 @@
-       for (p = file_name + prefix_len; *p; )
- 	{
-           if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
--	    prefix_len = p + 2 - file_name;
-+            {
-+	      static char const *const diagnostic[] =
-+	      {
-+		N_("%s: Member name contains '..'"),
-+		N_("%s: Hard link target contains '..'")
-+	      };
-+	      ERROR ((0, 0, _(diagnostic[link_target]),
-+	              quotearg_colon (file_name)));
-+	    }
- 
- 	  do
- 	    {

diff --git a/app-arch/tar/tar-1.29-r1.ebuild b/app-arch/tar/tar-1.29-r1.ebuild
deleted file mode 100644
index cc4cfe9bcbe..00000000000
--- a/app-arch/tar/tar-1.29-r1.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit flag-o-matic eutils
-
-DESCRIPTION="Use this to make tarballs :)"
-HOMEPAGE="https://www.gnu.org/software/tar/"
-SRC_URI="mirror://gnu/tar/${P}.tar.bz2
-	mirror://gnu-alpha/tar/${P}.tar.bz2"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
-
-RDEPEND="acl? ( virtual/acl )
-	selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}
-	nls? ( >=sys-devel/gettext-0.10.35 )
-	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
-
-PATCHES=(
-	"${FILESDIR}/${P}-extract-pathname-bypass.patch"
-)
-
-src_prepare() {
-	epatch "${PATCHES[@]}"
-	epatch_user
-
-	if ! use userland_GNU ; then
-		sed -i \
-			-e 's:/backup\.sh:/gbackup.sh:' \
-			scripts/{backup,dump-remind,restore}.in \
-			|| die "sed non-GNU"
-	fi
-}
-
-src_configure() {
-	use static && append-ldflags -static
-	FORCE_UNSAFE_CONFIGURE=1 \
-	econf \
-		--enable-backup-scripts \
-		--bindir="${EPREFIX}"/bin \
-		--libexecdir="${EPREFIX}"/usr/sbin \
-		$(usex userland_GNU "" "--program-prefix=g") \
-		$(use_with acl posix-acls) \
-		$(use_enable nls) \
-		$(use_with selinux) \
-		$(use_with xattr xattrs)
-}
-
-src_install() {
-	default
-
-	local p=$(usex userland_GNU "" "g")
-	if [[ -z ${p} ]] ; then
-		# a nasty yet required piece of baggage
-		exeinto /etc
-		doexe "${FILESDIR}"/rmt
-	fi
-
-	# autoconf looks for gtar before tar (in configure scripts), hence
-	# in Prefix it is important that it is there, otherwise, a gtar from
-	# the host system (FreeBSD, Solaris, Darwin) will be found instead
-	# of the Prefix provided (GNU) tar
-	if use prefix ; then
-		dosym tar /bin/gtar
-	fi
-
-	mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
-	mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
-
-	if use minimal ; then
-		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
-			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
-			-delete || die
-	fi
-}

diff --git a/app-arch/tar/tar-1.29-r3.ebuild b/app-arch/tar/tar-1.29-r3.ebuild
deleted file mode 100644
index 7f8e1ba1631..00000000000
--- a/app-arch/tar/tar-1.29-r3.ebuild
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit flag-o-matic eutils
-
-DESCRIPTION="Use this to make tarballs :)"
-HOMEPAGE="https://www.gnu.org/software/tar/"
-SRC_URI="mirror://gnu/tar/${P}.tar.bz2
-	mirror://gnu-alpha/tar/${P}.tar.bz2"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
-
-RDEPEND="acl? ( virtual/acl )
-	selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}
-	nls? ( >=sys-devel/gettext-0.10.35 )
-	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
-
-PATCHES=(
-	"${FILESDIR}/${P}-extract-pathname-bypass-upstream.patch" #598334
-	"${FILESDIR}/${P}-add-files.patch"
-)
-
-src_prepare() {
-	epatch "${PATCHES[@]}"
-	epatch_user
-
-	if ! use userland_GNU ; then
-		sed -i \
-			-e 's:/backup\.sh:/gbackup.sh:' \
-			scripts/{backup,dump-remind,restore}.in \
-			|| die "sed non-GNU"
-	fi
-}
-
-src_configure() {
-	use static && append-ldflags -static
-	FORCE_UNSAFE_CONFIGURE=1 \
-	econf \
-		--enable-backup-scripts \
-		--bindir="${EPREFIX}"/bin \
-		--libexecdir="${EPREFIX}"/usr/sbin \
-		$(usex userland_GNU "" "--program-prefix=g") \
-		$(use_with acl posix-acls) \
-		$(use_enable nls) \
-		$(use_with selinux) \
-		$(use_with xattr xattrs)
-}
-
-src_install() {
-	default
-
-	local p=$(usex userland_GNU "" "g")
-	if [[ -z ${p} ]] ; then
-		# a nasty yet required piece of baggage
-		exeinto /etc
-		doexe "${FILESDIR}"/rmt
-	fi
-
-	# autoconf looks for gtar before tar (in configure scripts), hence
-	# in Prefix it is important that it is there, otherwise, a gtar from
-	# the host system (FreeBSD, Solaris, Darwin) will be found instead
-	# of the Prefix provided (GNU) tar
-	if use prefix ; then
-		dosym tar /bin/gtar
-	fi
-
-	mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
-	mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
-
-	if use minimal ; then
-		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
-			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
-			-delete || die
-	fi
-}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2019-03-10 16:16 Mikle Kolyada
  0 siblings, 0 replies; 9+ messages in thread
From: Mikle Kolyada @ 2019-03-10 16:16 UTC (permalink / raw
  To: gentoo-commits

commit:     d13df079ae17e4dd7ddc114185e835920a52882f
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 16:16:03 2019 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 16:16:03 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d13df079

app-arch/tar: Security cleanup

Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 app-arch/tar/Manifest                              |  1 -
 .../tar/files/tar-1.30-fix-test-117-and-118.patch  | 89 ----------------------
 app-arch/tar/files/tar-1.30-fix-test-92.patch      | 13 ----
 app-arch/tar/tar-1.30.ebuild                       | 81 --------------------
 4 files changed, 184 deletions(-)

diff --git a/app-arch/tar/Manifest b/app-arch/tar/Manifest
index dcb20a1e807..eeff245a6f1 100644
--- a/app-arch/tar/Manifest
+++ b/app-arch/tar/Manifest
@@ -1,3 +1,2 @@
-DIST tar-1.30.tar.bz2 2858639 BLAKE2B 82a8b1fbf1eb5c0347b2f8cf35854498e2955eb85eaf041ec44a38bbd9bc82cc7184d5cb858f9905f503c9178ec6d0ed50be2dc27be9933b29e0a18b8e6c0b8f SHA512 07a1157430898fee1a2c6fd3853d59d4ae13998db685669c8c702f73d2466eeb9892f84a5f0495bfe088c8190a643a99ac9f2cb16b85c9fe3ae0d83cc0f338e8
 DIST tar-1.31.tar.bz2 2946047 BLAKE2B c85c17740e4cd3e8c93d10d93b070cd80629b7f052d020c0513cdddd377f3f90e229a6fa10dfbb43e1006f8202c674f2df854b864c0947f49339a52964d65c1c SHA512 0f4d00e08d56a8f8c32aac0afa2845397efb8ad72eaa6af47334cef9612adb1a4b91406bdc2c3a2cf1b9cc8b92c12735a331e0d137b24f66703f6af6219464f6
 DIST tar-1.32.tar.bz2 2947264 BLAKE2B 4e380a9a2f84a2af5130464e1b298ae6acf02ee459cbca20dd0991c2859785e5aac789d57b87b32e8b45d89985b6414af9dd37161385da9568d6030c5aa42c0e SHA512 3139e87112123269ee0600243b3ea081687cc93667bef5832bfe3c785c1be622f520f00fcfbdf44ad1d3247866d0ecfe347a85bbfec38eb38fa1014baef566f6

diff --git a/app-arch/tar/files/tar-1.30-fix-test-117-and-118.patch b/app-arch/tar/files/tar-1.30-fix-test-117-and-118.patch
deleted file mode 100644
index 2f75da6cd24..00000000000
--- a/app-arch/tar/files/tar-1.30-fix-test-117-and-118.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-tests: fix race in dirrem01 and dirrem02
-
-Previously the '--checkpoint-action=echo' was triggered after
-'--checkpoint-action=sleep=1' - so the order of events *usually*
-was (for --format='gnu'):
-
-  ...
-  1. checkpoint handler before write of 'dir/sub' member
-  2. one-second delay
-  3. stderr write: 'tar: Write checkpoint 3'
-  4. write the member 'dir/sub' into the archive
-  5. check that the member's ctime has not been changed
-  6. genfile's detecting 'Write checkpoint', doing unlink
-  ...
-
-But sometimes, the genfile was fast enough to win the race and
-unlinked the directory before the member was written into the
-archive (IOW, the order was 1-2-3-6-4-5).  This led to the
-occasional warning 'tar: dir/sub: file changed as we read it'.
-
-Swap the order of 'sleep=1' and 'echo' actions so the genfile
-utility has (hopefully) enough time to do the unlink before
-writing the file into the archive (enforce 1-2-3-6-4-5 order).
-
-* tests/dirrem01.at: Swap 'sleep=1' and 'echo' actions.
-* tests/dirrem02.at: Likewise.
-
-Origin: https://lists.gnu.org/archive/html/bug-tar/2018-01/msg00000.html
----
- tests/dirrem01.at | 5 +++--
- tests/dirrem02.at | 7 ++++---
- 2 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/tests/dirrem01.at b/tests/dirrem01.at
-index 40344dc..dabc206 100644
---- a/tests/dirrem01.at
-+++ b/tests/dirrem01.at
-@@ -47,14 +47,15 @@ gnu)   CPT=3;;
- esac
- 
- genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
--       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
--       --checkpoint-action='echo' -c -f archive.tar \
-+       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
-+       --checkpoint-action='sleep=1' -c -f archive.tar \
-        --listed-incremental db -v dir >/dev/null
- ],
- [1],
- [ignore],
- [tar: dir: Directory is new
- tar: dir/sub: Directory is new
-+tar: dir/sub: file changed as we read it
- tar: dir/sub: File removed before we read it
- ],[],[],[gnu,posix])
- 
-diff --git a/tests/dirrem02.at b/tests/dirrem02.at
-index e1cf9ef..924454f 100644
---- a/tests/dirrem02.at
-+++ b/tests/dirrem02.at
-@@ -20,7 +20,7 @@
- 
- # Description:
- #
--# When an explicitley named directory disappears during creation
-+# When an explicitly named directory disappears during creation
- # of incremental dump, tar should still exit with TAREXIT_FAILURE (2).
- #
- # For further details see dirrem01.at
-@@ -44,14 +44,15 @@ gnu)   CPT=3;;
- esac
- 
- genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
--       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
--       --checkpoint-action='echo' -c -f archive.tar \
-+       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
-+       --checkpoint-action='sleep=1' -c -f archive.tar \
-        --listed-incremental db -v dir dir/sub >/dev/null
- ],
- [2],
- [ignore],
- [tar: dir: Directory is new
- tar: dir/sub: Directory is new
-+tar: dir/sub: file changed as we read it
- tar: dir/sub: Cannot open: No such file or directory
- tar: Exiting with failure status due to previous errors
- ],[],[],[gnu,posix])
--- 
-cgit v1.0-41-gc330
-

diff --git a/app-arch/tar/files/tar-1.30-fix-test-92.patch b/app-arch/tar/files/tar-1.30-fix-test-92.patch
deleted file mode 100644
index d5a63e4ab35..00000000000
--- a/app-arch/tar/files/tar-1.30-fix-test-92.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-http://lists.gnu.org/archive/html/bug-tar/2017-12/msg00027.html
-
---- a/tests/difflink.at
-+++ b/tests/difflink.at
-@@ -21,7 +21,7 @@ mkdir a
- genfile -f a/x
- ln -s x a/y
- ln a/y a/z
--tar cf a.tar a
-+tar cf a.tar a/x a/y a/z
- rm a/z
- ln -s x a/z
- tar df a.tar

diff --git a/app-arch/tar/tar-1.30.ebuild b/app-arch/tar/tar-1.30.ebuild
deleted file mode 100644
index 613884f9f5d..00000000000
--- a/app-arch/tar/tar-1.30.ebuild
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic
-
-DESCRIPTION="Use this to make tarballs :)"
-HOMEPAGE="https://www.gnu.org/software/tar/"
-SRC_URI="mirror://gnu/tar/${P}.tar.bz2
-	mirror://gnu-alpha/tar/${P}.tar.bz2"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
-
-RDEPEND="acl? ( virtual/acl )
-	selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}
-	nls? ( >=sys-devel/gettext-0.10.35 )
-	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
-
-PATCHES=(
-	"${FILESDIR}"/${P}-fix-test-92.patch
-	"${FILESDIR}"/${P}-fix-test-117-and-118.patch
-)
-
-src_prepare() {
-	default
-
-	if ! use userland_GNU ; then
-		sed -i \
-			-e 's:/backup\.sh:/gbackup.sh:' \
-			scripts/{backup,dump-remind,restore}.in \
-			|| die "sed non-GNU"
-	fi
-}
-
-src_configure() {
-	use static && append-ldflags -static
-	local myeconfargs=(
-		--bindir="${EPREFIX}"/bin
-		--enable-backup-scripts
-		--libexecdir="${EPREFIX}"/usr/sbin
-		$(usex userland_GNU "" "--program-prefix=g")
-		$(use_with acl posix-acls)
-		$(use_enable nls)
-		$(use_with selinux)
-		$(use_with xattr xattrs)
-	)
-	FORCE_UNSAFE_CONFIGURE=1 econf "${myeconfargs[@]}"
-}
-
-src_install() {
-	default
-
-	local p=$(usex userland_GNU "" "g")
-	if [[ -z ${p} ]] ; then
-		# a nasty yet required piece of baggage
-		exeinto /etc
-		doexe "${FILESDIR}"/rmt
-	fi
-
-	# autoconf looks for gtar before tar (in configure scripts), hence
-	# in Prefix it is important that it is there, otherwise, a gtar from
-	# the host system (FreeBSD, Solaris, Darwin) will be found instead
-	# of the Prefix provided (GNU) tar
-	if use prefix ; then
-		dosym tar /bin/gtar
-	fi
-
-	mv "${ED%/}"/usr/sbin/${p}backup{,-tar} || die
-	mv "${ED%/}"/usr/sbin/${p}restore{,-tar} || die
-
-	if use minimal ; then
-		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
-			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
-			-delete || die
-	fi
-}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2019-04-08  6:57 Mikle Kolyada
  0 siblings, 0 replies; 9+ messages in thread
From: Mikle Kolyada @ 2019-04-08  6:57 UTC (permalink / raw
  To: gentoo-commits

commit:     0f24827067ff6f59cd0290e37b36efed2f9c4c84
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  8 06:57:38 2019 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Mon Apr  8 06:57:38 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f248270

app-arch/tar: Security cleanup

Closes: https://bugs.gentoo.org/681728
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

 app-arch/tar/Manifest                              |  1 -
 .../tar-1.31-remove-erroneous-abort-call.patch     | 33 ---------
 app-arch/tar/tar-1.31-r1.ebuild                    | 81 ----------------------
 3 files changed, 115 deletions(-)

diff --git a/app-arch/tar/Manifest b/app-arch/tar/Manifest
index eeff245a6f1..64c7c860dbf 100644
--- a/app-arch/tar/Manifest
+++ b/app-arch/tar/Manifest
@@ -1,2 +1 @@
-DIST tar-1.31.tar.bz2 2946047 BLAKE2B c85c17740e4cd3e8c93d10d93b070cd80629b7f052d020c0513cdddd377f3f90e229a6fa10dfbb43e1006f8202c674f2df854b864c0947f49339a52964d65c1c SHA512 0f4d00e08d56a8f8c32aac0afa2845397efb8ad72eaa6af47334cef9612adb1a4b91406bdc2c3a2cf1b9cc8b92c12735a331e0d137b24f66703f6af6219464f6
 DIST tar-1.32.tar.bz2 2947264 BLAKE2B 4e380a9a2f84a2af5130464e1b298ae6acf02ee459cbca20dd0991c2859785e5aac789d57b87b32e8b45d89985b6414af9dd37161385da9568d6030c5aa42c0e SHA512 3139e87112123269ee0600243b3ea081687cc93667bef5832bfe3c785c1be622f520f00fcfbdf44ad1d3247866d0ecfe347a85bbfec38eb38fa1014baef566f6

diff --git a/app-arch/tar/files/tar-1.31-remove-erroneous-abort-call.patch b/app-arch/tar/files/tar-1.31-remove-erroneous-abort-call.patch
deleted file mode 100644
index 9e255df5760..00000000000
--- a/app-arch/tar/files/tar-1.31-remove-erroneous-abort-call.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 85c005ee1345c342f707f3c55317daf6cb050603 Mon Sep 17 00:00:00 2001
-From: Sergey Poznyakoff <gray@gnu.org.ua>
-Date: Thu, 10 Jan 2019 18:18:49 +0200
-Subject: Remove erroneous abort() call
-
-The call was introduced by commit ccef8581. It caused tar to abort
-on perfectly normal operations, like untarring archives containing
-./ with the -U option,
-
-See http://lists.gnu.org/archive/html/bug-tar/2019-01/msg00019.html
-for details.
-
-* src/extract.c (maybe_recoverable): Remove misplaced call to abort().
----
- src/extract.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/extract.c b/src/extract.c
-index 090b866..8276f8f 100644
---- a/src/extract.c
-+++ b/src/extract.c
-@@ -787,7 +787,7 @@ maybe_recoverable (char *file_name, bool regular, bool *interdir_made)
- 	case UNLINK_FIRST_OLD_FILES:
- 	  break;
- 	}
--      abort (); /* notreached */
-+      FALLTHROUGH;
- 
-     case ENOENT:
-       /* Attempt creating missing intermediate directories.  */
--- 
-cgit v1.0-41-gc330
-

diff --git a/app-arch/tar/tar-1.31-r1.ebuild b/app-arch/tar/tar-1.31-r1.ebuild
deleted file mode 100644
index 72de0a507c7..00000000000
--- a/app-arch/tar/tar-1.31-r1.ebuild
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic
-
-DESCRIPTION="Use this to make tarballs :)"
-HOMEPAGE="https://www.gnu.org/software/tar/"
-SRC_URI="mirror://gnu/tar/${P}.tar.bz2
-	mirror://gnu-alpha/tar/${P}.tar.bz2"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
-
-LIB_DEPEND="acl? ( virtual/acl[static-libs(+)] )"
-
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
-	selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}
-	nls? ( >=sys-devel/gettext-0.10.35 )
-	static? ( ${LIB_DEPEND} )
-	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
-
-PATCHES=( "${FILESDIR}"/${P}-remove-erroneous-abort-call.patch )
-
-src_prepare() {
-	default
-
-	if ! use userland_GNU ; then
-		sed -i \
-			-e 's:/backup\.sh:/gbackup.sh:' \
-			scripts/{backup,dump-remind,restore}.in \
-			|| die "sed non-GNU"
-	fi
-}
-
-src_configure() {
-	use static && append-ldflags -static
-	local myeconfargs=(
-		--bindir="${EPREFIX%/}"/bin
-		--enable-backup-scripts
-		--libexecdir="${EPREFIX%/}"/usr/sbin
-		$(usex userland_GNU "" "--program-prefix=g")
-		$(use_with acl posix-acls)
-		$(use_enable nls)
-		$(use_with selinux)
-		$(use_with xattr xattrs)
-	)
-	FORCE_UNSAFE_CONFIGURE=1 econf "${myeconfargs[@]}"
-}
-
-src_install() {
-	default
-
-	local p=$(usex userland_GNU "" "g")
-	if [[ -z ${p} ]] ; then
-		# a nasty yet required piece of baggage
-		exeinto /etc
-		doexe "${FILESDIR}"/rmt
-	fi
-
-	# autoconf looks for gtar before tar (in configure scripts), hence
-	# in Prefix it is important that it is there, otherwise, a gtar from
-	# the host system (FreeBSD, Solaris, Darwin) will be found instead
-	# of the Prefix provided (GNU) tar
-	if use prefix ; then
-		dosym tar /bin/gtar
-	fi
-
-	mv "${ED%/}"/usr/sbin/${p}backup{,-tar} || die
-	mv "${ED%/}"/usr/sbin/${p}restore{,-tar} || die
-
-	if use minimal ; then
-		find "${ED%/}"/etc "${ED%/}"/*bin/ "${ED%/}"/usr/*bin/ \
-			-type f -a '!' '(' -name tar -o -name ${p}tar ')' \
-			-delete || die
-	fi
-}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2020-12-23 10:11 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2020-12-23 10:11 UTC (permalink / raw
  To: gentoo-commits

commit:     a71cd47ebab295e3cf66b83e89b615f42befc1ab
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 23 10:09:59 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Dec 23 10:09:59 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a71cd47e

Revert "app-arch/tar: add patch for macOS Big Sur 11.1"

This reverts commit fa9750b4c24e402475d4edaa1b2ef34f17d945c3.

It appears I was mistaken, and we don't need this patch in the tree, for
within Prefix itself, this issue doesn't occur.  See comment #5

Bug: https://bugs.gentoo.org/761322
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 ...tar-1.32-check-sys-ioctl-header-configure.patch | 53 ----------------------
 app-arch/tar/tar-1.32.90.ebuild                    |  4 --
 app-arch/tar/tar-1.32.ebuild                       |  3 --
 3 files changed, 60 deletions(-)

diff --git a/app-arch/tar/files/tar-1.32-check-sys-ioctl-header-configure.patch b/app-arch/tar/files/tar-1.32-check-sys-ioctl-header-configure.patch
deleted file mode 100644
index c8aee2fcce8..00000000000
--- a/app-arch/tar/files/tar-1.32-check-sys-ioctl-header-configure.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-[buildsys] macOS Big Sur 11.1 doesn't have sys/ioctl.h
-
-Author:  Alexei Colin 
-Bug: https://bugs.gentoo.org/761322
-Bug: https://savannah.gnu.org/bugs/index.php?59755
-
---- a/configure	2020-12-23 00:49:19.000000000 -0500
-+++ b/configure	2020-12-23 00:49:52.000000000 -0500
-@@ -3422,6 +3422,7 @@
- as_fn_append ac_header_list " sys/device.h"
- as_fn_append ac_header_list " sys/gentape.h"
- as_fn_append ac_header_list " sys/inet.h"
-+as_fn_append ac_header_list " sys/ioctl.h"
- as_fn_append ac_header_list " sys/io/trioctl.h"
- as_fn_append ac_header_list " sys/mtio.h"
- as_fn_append ac_header_list " sys/time.h"
---- a/config.h.in	2019-02-23 07:56:20.000000000 -0500
-+++ b/config.h.in	2020-12-23 01:04:49.000000000 -0500
-@@ -1480,6 +1480,9 @@
- /* Define to 1 if you have the <sys/inttypes.h> header file. */
- #undef HAVE_SYS_INTTYPES_H
- 
-+/* Define to 1 if you have the <sys/ioctl.h> header file. */
-+#undef HAVE_SYS_IOCTL_H
-+
- /* Define to 1 if you have the <sys/io/trioctl.h> header file. */
- #undef HAVE_SYS_IO_TRIOCTL_H
- 
---- a/lib/system-ioctl.h	2020-12-22 20:57:00.000000000 -0500
-+++ b/lib/system-ioctl.h	2020-12-22 20:57:35.000000000 -0500
-@@ -41,8 +41,10 @@
- #  endif
- #  include <sys/tape.h>
- # else
--#  if HAVE_SYS_MTIO_H
-+#  if HAVE_SYS_IOCTL_H
- #   include <sys/ioctl.h>
-+#  endif
-+#  if HAVE_SYS_MTIO_H
- #   if HAVE_SGTTY_H
- #    include <sgtty.h>
- #   endif
---- a/src/checkpoint.c	2020-12-22 20:56:48.000000000 -0500
-+++ b/src/checkpoint.c	2020-12-22 20:58:29.000000000 -0500
-@@ -20,7 +20,7 @@
- #include <system.h>
- #include "common.h"
- #include "wordsplit.h"
--#include <sys/ioctl.h>
-+#include <system-ioctl.h>
- #include <termios.h>
- #include "fprintftime.h"
- #include <signal.h>

diff --git a/app-arch/tar/tar-1.32.90.ebuild b/app-arch/tar/tar-1.32.90.ebuild
index 43686c3c26d..87f3d927f1c 100644
--- a/app-arch/tar/tar-1.32.90.ebuild
+++ b/app-arch/tar/tar-1.32.90.ebuild
@@ -25,10 +25,6 @@ DEPEND="${RDEPEND}
 	xattr? ( elibc_glibc? ( sys-apps/attr ) )"
 BDEPEND="nls? ( sys-devel/gettext )"
 
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.32-check-sys-ioctl-header-configure.patch
-)
-
 src_prepare() {
 	default
 

diff --git a/app-arch/tar/tar-1.32.ebuild b/app-arch/tar/tar-1.32.ebuild
index d1fd7864919..81267f7aa85 100644
--- a/app-arch/tar/tar-1.32.ebuild
+++ b/app-arch/tar/tar-1.32.ebuild
@@ -33,9 +33,6 @@ src_prepare() {
 			scripts/{backup,dump-remind,restore}.in \
 			|| die "sed non-GNU"
 	fi
-
-	[[ ${CHOST} == *darwin20* ]] && \
-		eapply "${FILESDIR}"/${PN}-1.32-check-sys-ioctl-header-configure.patch
 }
 
 src_configure() {


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/
@ 2023-03-25  3:32 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-03-25  3:32 UTC (permalink / raw
  To: gentoo-commits

commit:     3d066acd267ec8028a79f4d085614245190f2a8a
Author:     Nobel Barakat <nobelbarakat <AT> google <DOT> com>
AuthorDate: Fri Feb 24 22:48:47 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 25 03:32:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d066acd

app-arch/tar: Adding a patch to fix CVE-2022-48303

This patch is cherry-picked from the upstream gnu/tar repository
which fixes a heap buffer overflow issue in the utility. This fix is
needed to resolve CVE-2022-48303.

Bug: https://bugs.gentoo.org/898176
Signed-off-by: Nobel Barakat <nobelbarakat <AT> google.com>
Closes: https://github.com/gentoo/gentoo/pull/29776
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../tar/files/tar-1.34-fix-cve-2022-48303.patch    | 32 ++++++++
 app-arch/tar/tar-1.34-r3.ebuild                    | 94 ++++++++++++++++++++++
 2 files changed, 126 insertions(+)

diff --git a/app-arch/tar/files/tar-1.34-fix-cve-2022-48303.patch b/app-arch/tar/files/tar-1.34-fix-cve-2022-48303.patch
new file mode 100644
index 000000000000..7ef604b52378
--- /dev/null
+++ b/app-arch/tar/files/tar-1.34-fix-cve-2022-48303.patch
@@ -0,0 +1,32 @@
+Gentoo Bug: https://bugs.gentoo.org/898176
+Upstream Commit Link: https://git.savannah.gnu.org/cgit/tar.git/commit/?id=3da78400eafcccb97e2f2fd4b227ea40d794ede8
+
+From 3da78400eafcccb97e2f2fd4b227ea40d794ede8 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org>
+Date: Sat, 11 Feb 2023 11:57:39 +0200
+Subject: [PATCH] Fix boundary checking in base-256 decoder
+
+* src/list.c (from_header): Base-256 encoding is at least 2 bytes
+long.
+---
+ src/list.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/list.c b/src/list.c
+index 9fafc425..86bcfdd1 100644
+--- a/src/list.c
++++ b/src/list.c
+@@ -881,8 +881,9 @@ from_header (char const *where0, size_t digs, char const *type,
+ 	  where++;
+ 	}
+     }
+-  else if (*where == '\200' /* positive base-256 */
+-	   || *where == '\377' /* negative base-256 */)
++  else if (where <= lim - 2
++	   && (*where == '\200' /* positive base-256 */
++	       || *where == '\377' /* negative base-256 */))
+     {
+       /* Parse base-256 output.  A nonnegative number N is
+ 	 represented as (256**DIGS)/2 + N; a negative number -N is
+--
+2.39.2.637.g21b0678d19-goog

diff --git a/app-arch/tar/tar-1.34-r3.ebuild b/app-arch/tar/tar-1.34-r3.ebuild
new file mode 100644
index 000000000000..abf8af8f3d94
--- /dev/null
+++ b/app-arch/tar/tar-1.34-r3.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/tar.asc
+inherit verify-sig
+
+DESCRIPTION="Use this to make tarballs :)"
+HOMEPAGE="https://www.gnu.org/software/tar/"
+SRC_URI="mirror://gnu/tar/${P}.tar.xz
+	https://alpha.gnu.org/gnu/tar/${P}.tar.xz"
+SRC_URI+=" verify-sig? (
+		mirror://gnu/tar/${P}.tar.xz.sig
+		https://alpha.gnu.org/gnu/tar/${P}.tar.xz.sig
+	)"
+
+LICENSE="GPL-3+"
+SLOT="0"
+if [[ -z "$(ver_cut 3)" ]] || [[ "$(ver_cut 3)" -lt 90 ]] ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="acl minimal nls selinux xattr"
+
+RDEPEND="
+	acl? ( virtual/acl )
+	selinux? ( sys-libs/libselinux )
+"
+DEPEND="${RDEPEND}
+	xattr? ( elibc_glibc? ( sys-apps/attr ) )
+"
+BDEPEND="
+	nls? ( sys-devel/gettext )
+	verify-sig? ( sec-keys/openpgp-keys-tar )
+"
+PDEPEND="
+	app-alternatives/tar
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-fix-cve-2022-48303.patch
+)
+
+src_configure() {
+	local myeconfargs=(
+		--bindir="${EPREFIX}"/bin
+		--enable-backup-scripts
+		--libexecdir="${EPREFIX}"/usr/sbin
+		$(use_with acl posix-acls)
+		$(use_enable nls)
+		$(use_with selinux)
+		$(use_with xattr xattrs)
+
+		# autoconf looks for gtar before tar (in configure scripts), hence
+		# in Prefix it is important that it is there, otherwise, a gtar from
+		# the host system (FreeBSD, Solaris, Darwin) will be found instead
+		# of the Prefix provided (GNU) tar
+		--program-prefix=g
+	)
+
+	FORCE_UNSAFE_CONFIGURE=1 econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+
+	# a nasty yet required piece of baggage
+	exeinto /etc
+	doexe "${FILESDIR}"/rmt
+
+	mv "${ED}"/usr/sbin/{gbackup,backup-tar} || die
+	mv "${ED}"/usr/sbin/{grestore,restore-tar} || die
+	mv "${ED}"/usr/sbin/{g,}backup.sh || die
+	mv "${ED}"/usr/sbin/{g,}dump-remind || die
+
+	if use minimal ; then
+		find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
+			-type f -a '!' -name gtar \
+			-delete || die
+	fi
+
+	if ! use minimal; then
+		dosym grmt /usr/sbin/rmt
+	fi
+	dosym grmt.8 /usr/share/man/man8/rmt.8
+}
+
+pkg_postinst() {
+	# ensure to preserve the symlink before app-alternatives/tar
+	# is installed
+	if [[ ! -h ${EROOT}/bin/tar ]]; then
+		ln -s gtar "${EROOT}/bin/tar" || die
+	fi
+}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-25  3:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-23 10:11 [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/files/, app-arch/tar/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2023-03-25  3:32 Sam James
2019-04-08  6:57 Mikle Kolyada
2019-03-10 16:16 Mikle Kolyada
2018-07-16  6:45 Lars Wendler
2017-12-18 18:34 Thomas Deutschmann
2016-12-20 22:21 Mike Frysinger
2016-10-28 17:56 Patrick McLean
2016-05-16 21:08 Lars Wendler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox