upgrade to 1.19

This commit is contained in:
Radek Brich 2007-12-17 11:14:16 +00:00
parent 7254d79420
commit dc3617eb6b
7 changed files with 2675 additions and 12193 deletions

View File

@ -1,15 +0,0 @@
--- tar-1.17/src/names.c.dot_dot_vuln 2007-06-28 18:19:13.000000000 +0200
+++ tar-1.17/src/names.c 2007-08-15 16:29:20.000000000 +0200
@@ -1009,11 +1009,10 @@ contains_dot_dot (char const *name)
if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
return 1;
- do
+ while (! ISSLASH (*p))
{
if (! *p++)
return 0;
}
- while (! ISSLASH (*p));
}
}

View File

@ -1,89 +0,0 @@
diff -up tar-1.17/lib/paxnames.c.safer_name_suffix tar-1.17/lib/paxnames.c
--- tar-1.17/lib/paxnames.c.safer_name_suffix 2005-05-22 00:55:55.000000000 +0200
+++ tar-1.17/lib/paxnames.c 2007-10-22 17:32:54.000000000 +0200
@@ -36,15 +36,27 @@ hash_string_compare (void const *name1,
return strcmp (name1, name2) == 0;
}
-/* Return zero if TABLE contains a copy of STRING; otherwise, insert a
- copy of STRING to TABLE and return 1. */
-bool
-hash_string_insert (Hash_table **table, char const *string)
+/* Return zero if TABLE contains a LEN-character long prefix of STRING,
+ otherwise, insert a newly allocated copy of this prefix to TABLE and
+ return 1. If RETURN_PREFIX is not NULL, point it to the allocated
+ copy. */
+static bool
+hash_string_insert_prefix (Hash_table **table, char const *string, size_t len,
+ const char **return_prefix)
{
Hash_table *t = *table;
- char *s = xstrdup (string);
+ char *s;
char *e;
+ if (len)
+ {
+ s = xmalloc (len + 1);
+ memcpy (s, string, len);
+ s[len] = 0;
+ }
+ else
+ s = xstrdup (string);
+
if (! ((t
|| (*table = t = hash_initialize (0, 0, hash_string_hasher,
hash_string_compare, 0)))
@@ -52,7 +64,11 @@ hash_string_insert (Hash_table **table,
xalloc_die ();
if (e == s)
- return 1;
+ {
+ if (return_prefix)
+ *return_prefix = s;
+ return 1;
+ }
else
{
free (s);
@@ -60,6 +76,14 @@ hash_string_insert (Hash_table **table,
}
}
+/* Return zero if TABLE contains a copy of STRING; otherwise, insert a
+ copy of STRING to TABLE and return 1. */
+bool
+hash_string_insert (Hash_table **table, char const *string)
+{
+ return hash_string_insert_prefix (table, string, 0, NULL);
+}
+
/* Return 1 if TABLE contains STRING. */
bool
hash_string_lookup (Hash_table const *table, char const *string)
@@ -88,7 +112,8 @@ removed_prefixes_p (void)
If ABSOLUTE_NAMES is 0, strip filesystem prefix from the file name. */
char *
-safer_name_suffix (char const *file_name, bool link_target, bool absolute_names)
+safer_name_suffix (char const *file_name, bool link_target,
+ bool absolute_names)
{
char const *p;
@@ -121,11 +146,9 @@ safer_name_suffix (char const *file_name
if (prefix_len)
{
- char *prefix = alloca (prefix_len + 1);
- memcpy (prefix, file_name, prefix_len);
- prefix[prefix_len] = '\0';
-
- if (hash_string_insert (&prefix_table[link_target], prefix))
+ const char *prefix;
+ if (hash_string_insert_prefix (&prefix_table[link_target], file_name,
+ prefix_len, &prefix))
{
static char const *const diagnostic[] =
{

View File

@ -1,138 +0,0 @@
--- tar-1.17/tests/exclude.at.testsuite 2007-01-23 11:25:57.000000000 +0100
+++ tar-1.17/tests/exclude.at 2007-06-27 11:30:42.000000000 +0200
@@ -24,6 +24,8 @@ AT_SETUP([exclude])
AT_KEYWORDS([exclude])
AT_TAR_CHECK([
+AT_SORT_PREREQ
+
mkdir dir
echo blues > dir/blues
echo jazz > dir/jazz
@@ -37,79 +39,79 @@ echo "test" > dir/rock/file
for option in exclude-caches exclude-caches-under exclude-caches-all
do
echo OPTION $option
- tar -cf archive.tar --$option -v dir 2>err
+ tar -cf archive.tar --$option -v dir 2>err | sort
cat err
echo ARCHIVE
- tar tf archive.tar
+ tar tf archive.tar | sort
done
for option in exclude-tag exclude-tag-under exclude-tag-all
do
echo OPTION $option
- tar -cf archive.tar --${option}=tagfile -v dir 2>err
+ tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort
cat err
echo ARCHIVE
- tar tf archive.tar
+ tar tf archive.tar | sort
done
],
[0],
[OPTION exclude-caches
dir/
dir/blues
-dir/jazz
dir/folk/
-dir/folk/tagfile
dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
dir/rock/
dir/rock/CACHEDIR.TAG
tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
ARCHIVE
dir/
dir/blues
-dir/jazz
dir/folk/
-dir/folk/tagfile
dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
dir/rock/
dir/rock/CACHEDIR.TAG
OPTION exclude-caches-under
dir/
dir/blues
-dir/jazz
dir/folk/
-dir/folk/tagfile
dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
dir/rock/
tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
ARCHIVE
dir/
dir/blues
-dir/jazz
dir/folk/
-dir/folk/tagfile
dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
dir/rock/
OPTION exclude-caches-all
dir/
dir/blues
-dir/jazz
dir/folk/
-dir/folk/tagfile
dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped
ARCHIVE
dir/
dir/blues
-dir/jazz
dir/folk/
-dir/folk/tagfile
dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
OPTION exclude-tag
dir/
dir/blues
-dir/jazz
dir/folk/
dir/folk/tagfile
+dir/jazz
dir/rock/
dir/rock/CACHEDIR.TAG
dir/rock/file
@@ -117,17 +119,17 @@ tar: dir/folk/: contains a cache directo
ARCHIVE
dir/
dir/blues
-dir/jazz
dir/folk/
dir/folk/tagfile
+dir/jazz
dir/rock/
dir/rock/CACHEDIR.TAG
dir/rock/file
OPTION exclude-tag-under
dir/
dir/blues
-dir/jazz
dir/folk/
+dir/jazz
dir/rock/
dir/rock/CACHEDIR.TAG
dir/rock/file
@@ -135,8 +137,8 @@ tar: dir/folk/: contains a cache directo
ARCHIVE
dir/
dir/blues
-dir/jazz
dir/folk/
+dir/jazz
dir/rock/
dir/rock/CACHEDIR.TAG
dir/rock/file

File diff suppressed because it is too large Load Diff

2607
tar-1.19-xattrs-conf.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -97,79 +97,6 @@ diff -up tar-1.17/doc/tar.texi.xattrs tar-1.17/doc/tar.texi
@end table
@node Portability
diff -up tar-1.17/src/Makefile.in.xattrs tar-1.17/src/Makefile.in
--- tar-1.17/src/Makefile.in.xattrs 2007-06-08 10:35:58.000000000 +0200
+++ tar-1.17/src/Makefile.in 2007-12-10 15:31:54.000000000 +0100
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10a from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -22,9 +22,8 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -134,12 +133,13 @@ am_tar_OBJECTS = buffer.$(OBJEXT) compar
incremen.$(OBJEXT) list.$(OBJEXT) misc.$(OBJEXT) \
names.$(OBJEXT) sparse.$(OBJEXT) system.$(OBJEXT) \
tar.$(OBJEXT) transform.$(OBJEXT) update.$(OBJEXT) \
- utf8.$(OBJEXT)
+ utf8.$(OBJEXT) xattrs.$(OBJEXT)
tar_OBJECTS = $(am_tar_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = ../lib/libtar.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-tar_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+tar_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
@@ -459,7 +459,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-noinst_HEADERS = arith.h common.h tar.h
+noinst_HEADERS = arith.h common.h tar.h xattrs.h
tar_SOURCES = \
buffer.c\
compare.c\
@@ -476,11 +476,12 @@ tar_SOURCES = \
tar.c\
transform.c\
update.c\
- utf8.c
+ utf8.c\
+ xattrs.c
INCLUDES = -I$(top_srcdir)/lib -I../ -I../lib
LDADD = ../lib/libtar.a $(LIBINTL) $(LIBICONV)
-tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME)
all: all-am
.SUFFIXES:
@@ -578,6 +579,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transform.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattrs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xheader.Po@am__quote@
.c.o:
diff -up tar-1.17/src/common.h.xattrs tar-1.17/src/common.h
--- tar-1.17/src/common.h.xattrs 2007-06-08 10:14:42.000000000 +0200
+++ tar-1.17/src/common.h 2007-12-10 15:31:54.000000000 +0100
@ -1284,9 +1211,52 @@ diff -up /dev/null tar-1.17/src/xattrs.h
+ char const *file_name, char typeflag);
+extern void xattrs_xattrs_set(struct tar_stat_info const *st,
+ char const *file_name, char typeflag);
diff -up tar-1.17/src/extract.c.xattrs tar-1.17/src/extract.c
--- tar-1.17/src/extract.c.xattrs 2007-06-08 10:14:42.000000000 +0200
+++ tar-1.17/src/extract.c 2007-12-10 15:31:54.000000000 +0100
diff -up tar-1.17/src/tar.h.xattrs tar-1.17/src/tar.h
--- tar-1.17/src/tar.h.xattrs 2007-06-01 12:17:10.000000000 +0200
+++ tar-1.17/src/tar.h 2007-12-10 15:31:54.000000000 +0100
@@ -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,15 @@ struct tar_stat_info
char *uname; /* user name of owner */
char *gname; /* group name of owner */
+
+ char *cntx_name; /* SELinux context for the current archive entry. */
+
+ char *acls_a_ptr; /* Access ACLs for the current archive entry. */
+ size_t acls_a_len; /* Access ACLs for the current archive entry. */
+
+ char *acls_d_ptr; /* Default ACLs for the current archive entry. */
+ size_t acls_d_len; /* Default ACLs for the current archive entry. */
+
struct stat stat; /* regular filesystem stat */
/* STAT doesn't always have access, data modification, and status
@@ -309,6 +326,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;
--- tar-1.19/src/extract.c.xattrs 2007-08-26 10:56:55.000000000 +0200
+++ tar-1.19/src/extract.c 2007-12-17 10:32:56.000000000 +0100
@@ -69,6 +69,13 @@ struct delayed_set_stat
mode_t invert_permissions;
enum permstatus permstatus;
@ -1356,17 +1326,17 @@ diff -up tar-1.17/src/extract.c.xattrs tar-1.17/src/extract.c
delayed_set_stat_head = data;
}
@@ -599,11 +639,22 @@ apply_nonancestor_delayed_set_stat (char
st.stat.st_gid = data->gid;
st.atime = data->atime;
st.mtime = data->mtime;
+ st.cntx_name = data->cntx_name;
+ st.acls_a_ptr = data->acls_a_ptr;
+ st.acls_a_len = data->acls_a_len;
+ st.acls_d_ptr = data->acls_d_ptr;
+ st.acls_d_len = data->acls_d_len;
+ st.xattr_map = data->xattr_map;
+ st.xattr_map_size = data->xattr_map_size;
set_stat (data->file_name, &st, cur_info,
sb.stat.st_gid = data->gid;
sb.atime = data->atime;
sb.mtime = data->mtime;
+ sb.cntx_name = data->cntx_name;
+ sb.acls_a_ptr = data->acls_a_ptr;
+ sb.acls_a_len = data->acls_a_len;
+ sb.acls_d_ptr = data->acls_d_ptr;
+ sb.acls_d_len = data->acls_d_len;
+ sb.xattr_map = data->xattr_map;
+ sb.xattr_map_size = data->xattr_map_size;
set_stat (data->file_name, &sb, cur_info,
data->invert_permissions, data->permstatus, DIRTYPE);
}
@ -1406,47 +1376,3 @@ diff -up tar-1.17/src/extract.c.xattrs tar-1.17/src/extract.c
set_stat (source, &st1, NULL, 0, 0, SYMTYPE);
valid_source = source;
}
diff -up tar-1.17/src/tar.h.xattrs tar-1.17/src/tar.h
--- tar-1.17/src/tar.h.xattrs 2007-06-01 12:17:10.000000000 +0200
+++ tar-1.17/src/tar.h 2007-12-10 15:31:54.000000000 +0100
@@ -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,15 @@ struct tar_stat_info
char *uname; /* user name of owner */
char *gname; /* group name of owner */
+
+ char *cntx_name; /* SELinux context for the current archive entry. */
+
+ char *acls_a_ptr; /* Access ACLs for the current archive entry. */
+ size_t acls_a_len; /* Access ACLs for the current archive entry. */
+
+ char *acls_d_ptr; /* Default ACLs for the current archive entry. */
+ size_t acls_d_len; /* Default ACLs for the current archive entry. */
+
struct stat stat; /* regular filesystem stat */
/* STAT doesn't always have access, data modification, and status
@@ -309,6 +326,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;

View File

@ -1,8 +1,8 @@
Summary: A GNU file archiving program
Name: tar
Epoch: 2
Version: 1.17
Release: 5%{?dist}
Version: 1.19
Release: 1%{?dist}
License: GPLv2+
Group: Applications/Archiving
URL: http://www.gnu.org/software/tar/
@ -11,12 +11,10 @@ Source1: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.gz.sig
Source2: tar.1
Patch1: tar-1.14-loneZeroWarning.patch
Patch2: tar-1.15.1-vfatTruncate.patch
Patch3: tar-1.17-testsuite.patch
Patch4: tar-1.17-xattrs.patch
Patch3: tar-1.19-xattrs.patch
Patch4: tar-1.19-xattrs-conf.patch
Patch5: tar-1.17-wildcards.patch
Patch6: tar-1.17-dot_dot_vuln.patch
Patch7: tar-1.17-safer_name_suffix.patch
Patch8: tar-1.17-xattrs-conf.patch
Prereq: info
BuildRequires: autoconf automake gzip texinfo gettext libacl-devel libselinux-devel gawk
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -39,12 +37,9 @@ the rmt package.
%setup -q
%patch1 -p1 -b .loneZeroWarning
%patch2 -p1 -b .vfatTruncate
%patch3 -p1 -b .testsuite
%patch4 -p1 -b .xattrs
%patch3 -p1 -b .xattrs
%patch4 -p1 -b .xattrs-conf
%patch5 -p1 -b .wildcards
%patch6 -p1 -b .dot_dot_vuln
%patch7 -p1 -b .safer_name_suffix
%patch8 -p1 -b .xattrs-conf
%build
%configure --bindir=/bin --libexecdir=/sbin
@ -95,6 +90,10 @@ fi
%{_infodir}/tar.info*
%changelog
* Mon Dec 17 2007 Radek Brich <rbrich@redhat.com> 2:1.19-1
- upgrade to 1.19
- updated xattrs patch, removed 3 upstream patches
* Wed Dec 12 2007 Radek Brich <rbrich@redhat.com> 2:1.17-5
- fix (non)detection of xattrs
- move configure stuff from -xattrs patch to -xattrs-conf,