new upstream release 1.24, use .xz archive (still needs some improvement in xattrs patch)

This commit is contained in:
Ondřej Vašík 2010-10-26 15:19:12 +02:00
parent 463fa8a6e3
commit 9934f5707a
12 changed files with 278 additions and 328 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
tar-1.23.tar.bz2 tar-1.23.tar.bz2
tar-1.23.tar.bz2.sig tar-1.23.tar.bz2.sig
/tar-1.24.tar.xz
/tar-1.24.tar.xz.sig

View File

@ -1,2 +1,2 @@
41e2ca4b924ec7860e51b43ad06cdb7e tar-1.23.tar.bz2 debae443de7e1c61cd24c2d53bca50c6 tar-1.24.tar.xz
d7a3e49d66c50a046c536b987f25e891 tar-1.23.tar.bz2.sig c4beee21bbab83cd022093825371eed5 tar-1.24.tar.xz.sig

View File

@ -15,7 +15,7 @@ diff -ruNp tar-1.22.orig/src/list.c tar-1.22/src/list.c
+ +
char buf[UINTMAX_STRSIZE_BOUND]; char buf[UINTMAX_STRSIZE_BOUND];
status = read_header (&current_header, &current_stat_info, status = read_header (&current_header, &current_stat_info,
@@ -147,6 +155,9 @@ read_and (void (*do_something) (void)) @@ -147,6 +155,9 @@ read_and (void (*do_something) (void))
WARNOPT (WARN_ALONE_ZERO_BLOCK, WARNOPT (WARN_ALONE_ZERO_BLOCK,
(0, 0, _("A lone zero block at %s"), (0, 0, _("A lone zero block at %s"),

View File

@ -61,7 +61,7 @@
--- tar-1.17/src/names.c.wildcards 2007-04-03 14:17:13.000000000 +0200 --- tar-1.17/src/names.c.wildcards 2007-04-03 14:17:13.000000000 +0200
+++ tar-1.17/src/names.c 2007-06-28 13:30:48.000000000 +0200 +++ tar-1.17/src/names.c 2007-06-28 13:30:48.000000000 +0200
@@ -812,10 +812,7 @@ collect_and_sort_names (void) @@ -812,10 +812,7 @@ collect_and_sort_names (void)
{
if (name->found_count || name->directory) if (name->found_count || name->directory)
continue; continue;
- if (name->matching_flags & EXCLUDE_WILDCARDS) - if (name->matching_flags & EXCLUDE_WILDCARDS)

View File

@ -5,8 +5,8 @@ diff -urNp tar-1.22-orig/src/create.c tar-1.22/src/create.c
set_exit_status (TAREXIT_DIFFERS); set_exit_status (TAREXIT_DIFFERS);
} }
else if (atime_preserve_option == replace_atime_preserve else if (atime_preserve_option == replace_atime_preserve
- && set_file_atime (fd, p, restore_times) != 0) - && set_file_atime (fd, parentfd, name, st->atime) != 0)
+ && set_file_atime (fd, p, restore_times) != 0 + && set_file_atime (fd, parentfd, name, st->atime) != 0
+ && errno != EROFS ) + && errno != EROFS )
utime_error (p); utime_error (p);
} }

View File

@ -1,18 +0,0 @@
diff --git a/src/incremen.c b/src/incremen.c
index dc880cd..3da1349 100644
--- a/src/incremen.c
+++ b/src/incremen.c
@@ -894,8 +894,11 @@ append_incremental_renames (struct directory *dir)
if (obstack_object_size (&stk) != size)
{
obstack_1grow (&stk, 0);
- dumpdir_free (dir->dump);
- dir->dump = dumpdir_create (obstack_finish (&stk));
+ if (dir)
+ {
+ dumpdir_free (dir->dump);
+ dir->dump = dumpdir_create (obstack_finish (&stk));
+ }
}
obstack_free (&stk, NULL);
}

View File

@ -1,142 +0,0 @@
src/compare.c | 1 -
src/extract.c | 2 +-
src/list.c | 7 ++-----
tests/Makefile.am | 1 +
tests/exclude06.at | 47 +++++++++++++++++++++++++++++++++++++++++++++++
tests/testsuite.at | 1 +
6 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/src/compare.c b/src/compare.c
index f4e92da..437ffb3 100644
--- a/src/compare.c
+++ b/src/compare.c
@@ -452,7 +452,6 @@ diff_archive (void)
{
set_next_block_after (current_header);
- decode_header (current_header, &current_stat_info, &current_format, 1);
/* Print the block from current_header and current_stat_info. */
diff --git a/src/extract.c b/src/extract.c
index 947e3ed..71f4e4f 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -1349,7 +1349,7 @@ extract_archive (void)
priv_set_remove_linkdir ();
set_next_block_after (current_header);
- decode_header (current_header, &current_stat_info, &current_format, 1);
+
if (!current_stat_info.file_name[0]
|| (interactive_option
&& !confirm ("extract", current_stat_info.file_name)))
diff --git a/src/list.c b/src/list.c
index 6e1971f..1edd504 100644
--- a/src/list.c
+++ b/src/list.c
@@ -90,7 +90,8 @@ read_and (void (*do_something) (void))
/* Valid header. We should decode next field (mode) first.
Ensure incoming names are null terminated. */
-
+ decode_header (current_header, &current_stat_info,
+ &current_format, 1);
if (! name_match (current_stat_info.file_name)
|| (NEWER_OPTION_INITIALIZED (newer_mtime_option)
/* FIXME: We get mtime now, and again later; this causes
@@ -116,8 +117,6 @@ read_and (void (*do_something) (void))
quotearg_colon (current_stat_info.file_name)));
/* Fall through. */
default:
- decode_header (current_header,
- &current_stat_info, &current_format, 0);
skip_member ();
continue;
}
@@ -221,8 +220,6 @@ list_archive (void)
off_t block_ordinal = current_block_ordinal ();
/* Print the header block. */
-
- decode_header (current_header, &current_stat_info, &current_format, 0);
if (verbose_option)
print_header (&current_stat_info, current_header, block_ordinal);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e9b753c..fe2535a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -66,6 +66,7 @@ TESTSUITE_AT = \
exclude03.at\
exclude04.at\
exclude05.at\
+ exclude06.at\
extrac01.at\
extrac02.at\
extrac03.at\
diff --git a/tests/exclude06.at b/tests/exclude06.at
new file mode 100644
index 0000000..f7ab141
--- /dev/null
+++ b/tests/exclude06.at
@@ -0,0 +1,47 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+
+# 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 3, 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, see <http://www.gnu.org/licenses/>.
+
+# Tar 1.23 would fail to exclude names longer that 100 characters from
+# pax format archives.
+#
+# Reported-by: Matthew Peterson <mrpeterson2@gmail.com>
+# References: <AANLkTin0teb1dcl0HCNquHxvN4HQnJmP6aK7CJCqy0sd@mail.gmail.com>
+# http://lists.gnu.org/archive/html/help-tar/2010-06/msg00000.html
+
+AT_SETUP([exclude: long files in pax archives])
+AT_KEYWORDS([exclude exclude06])
+
+m4_define([test_base_dir],[one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen])
+
+AT_TAR_CHECK([
+AT_TAR_MKHIER(test_base_dir)
+genfile --length 20 -f test_base_dir[/1.txt]
+genfile --length 20 -f test_base_dir[/1.c]
+
+tar cf archive.tar test_base_dir
+mkdir out
+tar -C out -xf archive.tar --exclude='*.txt'
+find out -type f
+],
+[0],
+[[out/]test_base_dir[/1.c]
+],
+[],
+[],
+[],
+[pax])
+
+AT_CLEANUP
diff --git a/tests/testsuite.at b/tests/testsuite.at
index f581071..ef70b99 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -130,6 +130,7 @@ m4_include([exclude02.at])
m4_include([exclude03.at])
m4_include([exclude04.at])
m4_include([exclude05.at])
+m4_include([exclude06.at])
m4_include([delete01.at])
m4_include([delete02.at])

View File

@ -9,15 +9,6 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
+ case OLD_ARCHIVE_OPTION: + case OLD_ARCHIVE_OPTION:
+ set_archive_format ("v7"); + set_archive_format ("v7");
+ break; + break;
case OVERWRITE_DIR_OPTION: case OVERWRITE_DIR_OPTION:
old_files_option = DEFAULT_OLD_FILES; old_files_option = DEFAULT_OLD_FILES;
@@ -1955,7 +1959,7 @@ parse_opt (int key, char *arg, struct ar
case POSIX_OPTION:
set_archive_format ("posix");
break;
-
+
case PRESERVE_OPTION:
/* FIXME: What it is good for? */
same_permissions_option = true;

View File

@ -31,7 +31,7 @@ index 4cadab9..3a36b9b 100644
+void transform_name_from_header(union block *header, struct tar_stat_info *); +void transform_name_from_header(union block *header, struct tar_stat_info *);
char const *tartime (struct timespec t, bool full_time); char const *tartime (struct timespec t, bool full_time);
#define GID_FROM_HEADER(where) gid_from_header (where, sizeof (where)) #define OFF_FROM_HEADER(where) off_from_header (where, sizeof (where))
diff --git a/src/list.c b/src/list.c diff --git a/src/list.c b/src/list.c
index 1edd504..4e0e1a0 100644 index 1edd504..4e0e1a0 100644
--- a/src/list.c --- a/src/list.c
@ -66,11 +66,11 @@ index 1edd504..4e0e1a0 100644
switch (current_header->header.typeflag) switch (current_header->header.typeflag)
{ {
@@ -659,7 +663,11 @@ decode_header (union block *header, struct tar_stat_info *stat_info, @@ -659,7 +663,11 @@ decode_header (union block *header, struct tar_stat_info *stat_info,
|| stat_info->dumpdir) if (header->header.typeflag == GNUTYPE_VOLHDR)
stat_info->is_dumpdir = true; /* Name transformations don't apply to volume headers. */
} return;
+} +}
+void +void
+transform_name_from_header(union block *header, struct tar_stat_info *stat_info) +transform_name_from_header(union block *header, struct tar_stat_info *stat_info)
+{ +{
@ -86,7 +86,7 @@ index 1edd504..4e0e1a0 100644
simple_print_header (&vstat, &vblk, 0); simple_print_header (&vstat, &vblk, 0);
tar_stat_destroy (&vstat); tar_stat_destroy (&vstat);
@@ -1431,6 +1440,7 @@ test_archive_label () @@ -1431,6 +1440,7 @@ test_archive_label ()
{
decode_header (current_header, decode_header (current_header,
&current_stat_info, &current_format, 0); &current_stat_info, &current_format, 0);
+ transform_name_from_header (current_header, &current_stat_info); + transform_name_from_header (current_header, &current_stat_info);
@ -177,3 +177,15 @@ index ef70b99..8b533ed 100644
m4_include([delete01.at]) m4_include([delete01.at])
m4_include([delete02.at]) m4_include([delete02.at])
diff -urNp tar-1.24-orig/tests/xform01.at tar-1.24/tests/xform01.at
--- tar-1.24-orig/tests/xform01.at 2010-10-24 20:07:47.000000000 +0200
+++ tar-1.24/tests/xform01.at 2010-10-25 15:49:42.866904079 +0200
@@ -29,7 +29,7 @@ AT_KEYWORDS([transform xform xform01 vol
AT_TAR_CHECK([
genfile --file file
tar -cf archive.tar -V /label/ file
-tar tf archive.tar
+tar Ptf archive.tar
],
[0],
[/label/

View File

@ -0,0 +1,98 @@
tar: fix bug with -C and extracting directories
Problem reported by Denis Excoffier in
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.
* src/extract.c (extract_dir): Use mkdirat, not mkdir.
* tests/extrac16.at: New file, to test for this bug.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.
---
src/extract.c | 2 +-
tests/Makefile.am | 1 +
tests/extrac16.at | 36 ++++++++++++++++++++++++++++++++++++
tests/testsuite.at | 1 +
4 files changed, 39 insertions(+), 1 deletions(-)
create mode 100644 tests/extrac16.at
diff --git a/src/extract.c b/src/extract.c
index 0d23d4a..98236ac 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -777,7 +777,7 @@ extract_dir (char *file_name, int typeflag)
for (;;)
{
- status = mkdir (file_name, mode);
+ status = mkdirat (chdir_fd, file_name, mode);
if (status == 0)
{
current_mode = mode & ~ current_umask;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d29563a..b71e83c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -82,6 +82,7 @@ TESTSUITE_AT = \
extrac13.at\
extrac14.at\
extrac15.at\
+ extrac16.at\
filerem01.at\
filerem02.at\
gzip.at\
diff --git a/tests/extrac16.at b/tests/extrac16.at
new file mode 100644
index 0000000..625e579
--- /dev/null
+++ b/tests/extrac16.at
@@ -0,0 +1,36 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+
+# Test suite for GNU tar.
+# Copyright (C) 2010 Free Software Foundation, Inc.
+
+# 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 3, 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, see <http://www.gnu.org/licenses/>.
+
+# written by Paul Eggert from a bug report by Denis Excoffier
+# <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>
+
+# Check extraction of empty directory with -C.
+
+AT_SETUP([extract empty directory with -C])
+AT_KEYWORDS([extract extrac16])
+
+AT_TAR_CHECK([
+mkdir src src/a src/a/b dest
+touch src/a/c
+
+tar -cf archive.tar -C src a &&
+tar -xf archive.tar -C dest
+],
+[0],[],[],[],[],[gnu])
+
+AT_CLEANUP
diff --git a/tests/testsuite.at b/tests/testsuite.at
index c386892..40f0e41 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -154,6 +154,7 @@ m4_include([extrac12.at])
m4_include([extrac13.at])
m4_include([extrac14.at])
m4_include([extrac15.at])
+m4_include([extrac16.at])
m4_include([label01.at])
m4_include([label02.at])
--
1.7.2

View File

@ -1,8 +1,8 @@
diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac diff -urNp tar-1.24-orig/configure.ac tar-1.24/configure.ac
--- tar-1.23-orig/configure.ac 2010-03-10 11:47:54.000000000 +0100 --- tar-1.24-orig/configure.ac 2010-10-24 23:35:35.000000000 +0200
+++ tar-1.23/configure.ac 2010-08-16 14:32:11.448178888 +0200 +++ tar-1.24/configure.ac 2010-10-25 10:24:52.548214037 +0200
@@ -44,7 +44,7 @@ AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h @@ -44,7 +44,7 @@ AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h
sys/param.h sys/device.h sys/filio.h sys/gentape.h \ sys/param.h sys/device.h sys/gentape.h \
sys/inet.h sys/io/trioctl.h \ sys/inet.h sys/io/trioctl.h \
sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \ sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \
- unistd.h locale.h) - unistd.h locale.h)
@ -13,7 +13,7 @@ diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac
@@ -91,6 +91,12 @@ gl_INIT @@ -91,6 +91,12 @@ gl_INIT
tar_PAXUTILS tar_PAXUTILS
AC_CHECK_FUNCS(fsync getdtablesize lstat mkfifo readlink symlink setlocale utimes) AC_CHECK_FUNCS_ONCE([fchmod fchown fsync lstat mkfifo readlink symlink])
+AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \ +AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \
+ setxattr fsetxattr lsetxattr \ + setxattr fsetxattr lsetxattr \
+ listxattr flistxattr llistxattr, + listxattr flistxattr llistxattr,
@ -49,10 +49,10 @@ diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac
# Gettext. # Gettext.
AM_GNU_GETTEXT([external], [need-formatstring-macros]) AM_GNU_GETTEXT([external], [need-formatstring-macros])
AM_GNU_GETTEXT_VERSION([0.16]) AM_GNU_GETTEXT_VERSION([0.16])
diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi diff -urNp tar-1.24-orig/doc/tar.texi tar-1.24/doc/tar.texi
--- tar-1.23-orig/doc/tar.texi 2010-08-16 14:29:00.421912230 +0200 --- tar-1.24-orig/doc/tar.texi 2010-10-24 20:07:54.000000000 +0200
+++ tar-1.23/doc/tar.texi 2010-08-16 14:32:11.459923196 +0200 +++ tar-1.24/doc/tar.texi 2010-10-25 10:24:52.554213688 +0200
@@ -2364,6 +2364,10 @@ Normally when creating an archive, @comm @@ -2370,6 +2370,10 @@ Normally when creating an archive, @comm
@samp{/} from member names. This option disables that behavior. @samp{/} from member names. This option disables that behavior.
@xref{absolute}. @xref{absolute}.
@ -63,7 +63,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@opsummary{after-date} @opsummary{after-date}
@item --after-date @item --after-date
@@ -2885,6 +2889,10 @@ contents have changed (as opposed to jus @@ -2915,6 +2919,10 @@ contents have changed (as opposed to jus
also back up files for which any status information has also back up files for which any status information has
changed). @xref{after}. changed). @xref{after}.
@ -74,7 +74,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@opsummary{no-anchored} @opsummary{no-anchored}
@item --no-anchored @item --no-anchored
An exclude pattern can match any subsequence of the name's components. An exclude pattern can match any subsequence of the name's components.
@@ -2968,11 +2976,21 @@ locations. Usually @command{tar} determ @@ -2998,11 +3006,21 @@ locations. Usually @command{tar} determ
the archive can be seeked or not. Use this option to disable this the archive can be seeked or not. Use this option to disable this
mechanism. mechanism.
@ -96,7 +96,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@opsummary{no-wildcards} @opsummary{no-wildcards}
@item --no-wildcards @item --no-wildcards
Do not use wildcards. Do not use wildcards.
@@ -3202,6 +3220,11 @@ in cases when such recognition fails. I @@ -3235,6 +3253,11 @@ in cases when such recognition fails. I
archive is open for reading (e.g. with @option{--list} or archive is open for reading (e.g. with @option{--list} or
@option{--extract} options). @option{--extract} options).
@ -108,7 +108,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@opsummary{show-defaults} @opsummary{show-defaults}
@item --show-defaults @item --show-defaults
@@ -3411,6 +3434,11 @@ Enable or disable warning messages ident @@ -3448,6 +3471,11 @@ Enable or disable warning messages ident
messages are suppressed if @var{keyword} is prefixed with @samp{no-}. messages are suppressed if @var{keyword} is prefixed with @samp{no-}.
@xref{warnings}. @xref{warnings}.
@ -120,7 +120,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@opsummary{wildcards} @opsummary{wildcards}
@item --wildcards @item --wildcards
Use wildcards when matching member names with patterns. Use wildcards when matching member names with patterns.
@@ -8599,6 +8627,8 @@ implementation able to read @samp{ustar} @@ -8643,6 +8671,8 @@ implementation able to read @samp{ustar}
most @samp{posix} archives as well, with the only exception that any most @samp{posix} archives as well, with the only exception that any
additional information (such as long file names etc.) will in such 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. case be extracted as plain text files along with the files it refers to.
@ -129,7 +129,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
This archive format will be the default format for future versions This archive format will be the default format for future versions
of @GNUTAR{}. of @GNUTAR{}.
@@ -9160,6 +9190,51 @@ Same as both @option{--same-permissions} @@ -9259,6 +9289,51 @@ Same as both @option{--same-permissions}
This option is deprecated, and will be removed in @GNUTAR{} version 1.23. This option is deprecated, and will be removed in @GNUTAR{} version 1.23.
@ -181,10 +181,10 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@end table @end table
@node Portability @node Portability
diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h diff -urNp tar-1.24-orig/src/common.h tar-1.24/src/common.h
--- tar-1.23-orig/src/common.h 2010-01-26 13:21:18.000000000 +0100 --- tar-1.24-orig/src/common.h 2010-10-24 20:07:54.000000000 +0200
+++ tar-1.23/src/common.h 2010-08-16 14:32:11.464922567 +0200 +++ tar-1.24/src/common.h 2010-10-25 10:24:52.558475456 +0200
@@ -251,6 +251,15 @@ GLOBAL int same_owner_option; @@ -253,6 +253,15 @@ GLOBAL int same_owner_option;
/* If positive, preserve permissions when extracting. */ /* If positive, preserve permissions when extracting. */
GLOBAL int same_permissions_option; GLOBAL int same_permissions_option;
@ -200,7 +200,7 @@ diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h
/* When set, strip the given number of file name components from the file name /* When set, strip the given number of file name components from the file name
before extracting */ before extracting */
GLOBAL size_t strip_name_components; GLOBAL size_t strip_name_components;
@@ -732,6 +741,9 @@ extern char *output_start; @@ -706,6 +715,9 @@ extern char *output_start;
void update_archive (void); void update_archive (void);
@ -209,8 +209,8 @@ diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h
+ +
/* Module xheader.c. */ /* Module xheader.c. */
void xheader_init (struct xheader *xhdr); void xheader_decode (struct tar_stat_info *stat);
@@ -753,6 +765,12 @@ bool xheader_string_end (struct xheader @@ -726,6 +738,12 @@ bool xheader_string_end (struct xheader
bool xheader_keyword_deleted_p (const char *kw); bool xheader_keyword_deleted_p (const char *kw);
char *xheader_format_name (struct tar_stat_info *st, const char *fmt, char *xheader_format_name (struct tar_stat_info *st, const char *fmt,
size_t n); size_t n);
@ -223,9 +223,9 @@ diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h
/* Module system.c */ /* Module system.c */
diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c diff -urNp tar-1.24-orig/src/create.c tar-1.24/src/create.c
--- tar-1.23-orig/src/create.c 2010-08-16 14:29:00.431912370 +0200 --- tar-1.24-orig/src/create.c 2010-10-24 20:07:54.000000000 +0200
+++ tar-1.23/src/create.c 2010-08-16 14:32:11.465912091 +0200 +++ tar-1.24/src/create.c 2010-10-25 10:24:52.560213618 +0200
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include <quotearg.h> #include <quotearg.h>
@ -233,8 +233,8 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
+ +
#include <hash.h> #include <hash.h>
struct link /* Error number to use when an impostor is discovered.
@@ -954,6 +955,30 @@ start_header (struct tar_stat_info *st) @@ -934,6 +935,30 @@ start_header (struct tar_stat_info *st)
GNAME_TO_CHARS (st->gname, header->header.gname); GNAME_TO_CHARS (st->gname, header->header.gname);
} }
@ -265,9 +265,9 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
return header; return header;
} }
@@ -1587,6 +1612,10 @@ dump_file0 (struct tar_stat_info *st, co @@ -1709,6 +1734,10 @@ dump_file0 (struct tar_stat_info *st, ch
} bool ok;
} struct stat final_stat;
+ xattrs_acls_get(st, p, fd, !is_dir); + xattrs_acls_get(st, p, fd, !is_dir);
+ xattrs_selinux_get(st, p, fd); + xattrs_selinux_get(st, p, fd);
@ -276,7 +276,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
if (is_dir) if (is_dir)
{ {
const char *tag_file_name; const char *tag_file_name;
@@ -1710,6 +1739,9 @@ dump_file0 (struct tar_stat_info *st, co @@ -1826,6 +1855,9 @@ dump_file0 (struct tar_stat_info *st, ch
if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size) if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size)
write_long_link (st); write_long_link (st);
@ -286,7 +286,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
block_ordinal = current_block_ordinal (); block_ordinal = current_block_ordinal ();
st->stat.st_size = 0; /* force 0 size on symlink */ st->stat.st_size = 0; /* force 0 size on symlink */
header = start_header (st); header = start_header (st);
@@ -1728,11 +1760,23 @@ dump_file0 (struct tar_stat_info *st, co @@ -1844,11 +1876,23 @@ dump_file0 (struct tar_stat_info *st, ch
} }
#endif #endif
else if (S_ISCHR (st->stat.st_mode)) else if (S_ISCHR (st->stat.st_mode))
@ -313,13 +313,14 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
else if (S_ISSOCK (st->stat.st_mode)) else if (S_ISSOCK (st->stat.st_mode))
{ {
WARNOPT (WARN_FILE_IGNORED, WARNOPT (WARN_FILE_IGNORED,
diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c diff -urNp tar-1.24-orig/src/extract.c tar-1.24/src/extract.c
--- tar-1.23-orig/src/extract.c 2010-01-26 12:28:09.000000000 +0100 --- tar-1.24-orig/src/extract.c 2010-10-24 20:07:54.000000000 +0200
+++ tar-1.23/src/extract.c 2010-08-16 14:32:11.467922288 +0200 +++ tar-1.24/src/extract.c 2010-10-25 10:35:10.903214037 +0200
@@ -70,6 +70,13 @@ struct delayed_set_stat @@ -97,6 +97,14 @@ struct delayed_set_stat
mode_t invert_permissions; /* Directory that the name is relative to. */
enum permstatus permstatus; int change_dir;
bool after_links;
+ /* extended attributes*/
+ char *cntx_name; + char *cntx_name;
+ char *acls_a_ptr; + char *acls_a_ptr;
+ size_t acls_a_len; + size_t acls_a_len;
@ -327,10 +328,10 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
+ size_t acls_d_len; + size_t acls_d_len;
+ size_t xattr_map_size; /* Size of the xattr map */ + size_t xattr_map_size; /* Size of the xattr map */
+ struct xattr_array *xattr_map; + struct xattr_array *xattr_map;
/* Length and contents of name. */
size_t file_name_len;
char file_name[1]; char file_name[1];
}; @@ -134,6 +142,18 @@ struct delayed_link
@@ -97,6 +104,18 @@ struct delayed_link
hard-linked together. */ hard-linked together. */
struct string_list *sources; struct string_list *sources;
@ -349,21 +350,21 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
/* The desired target of the desired link. */ /* The desired target of the desired link. */
char target[1]; char target[1];
}; };
@@ -290,6 +309,10 @@ set_stat (char const *file_name, @@ -335,6 +355,10 @@ set_stat (char const *file_name,
give files away. */ utime_error (file_name);
} }
+ xattrs_acls_set(st, file_name, typeflag); + xattrs_acls_set(st, file_name, typeflag);
+ xattrs_selinux_set(st, file_name, typeflag); + xattrs_selinux_set(st, file_name, typeflag);
+ xattrs_xattrs_set(st, file_name, typeflag); + xattrs_xattrs_set(st, file_name, typeflag);
+ +
if (0 < same_owner_option && permstatus != INTERDIR_PERMSTATUS) if (0 < same_owner_option && ! interdir)
{ {
/* When lchown exists, it should be used to change the attributes of /* Some systems allow non-root users to give files away. Once this
@@ -366,6 +389,29 @@ delay_set_stat (char const *file_name, s @@ -431,6 +455,29 @@ delay_set_stat (char const *file_name, s
data->invert_permissions = invert_permissions; data->atflag = atflag;
data->permstatus = permstatus;
data->after_links = 0; data->after_links = 0;
data->change_dir = chdir_current;
+ data->cntx_name = NULL; + data->cntx_name = NULL;
+ assign_string (&data->cntx_name, st->cntx_name); + assign_string (&data->cntx_name, st->cntx_name);
+ if (st->acls_a_ptr) + if (st->acls_a_ptr)
@ -389,9 +390,9 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
+ xheader_xattr_copy (st, &data->xattr_map, &data->xattr_map_size); + xheader_xattr_copy (st, &data->xattr_map, &data->xattr_map_size);
strcpy (data->file_name, file_name); strcpy (data->file_name, file_name);
delayed_set_stat_head = data; delayed_set_stat_head = data;
} if (must_be_dot_or_slash (file_name))
@@ -571,6 +617,31 @@ maybe_recoverable (char *file_name, int @@ -661,6 +708,31 @@ maybe_recoverable (char *file_name, bool
} return RECOVER_NO;
} }
+/* Restore stat extended attributes (xattr) for FILE_NAME, using information +/* Restore stat extended attributes (xattr) for FILE_NAME, using information
@ -412,7 +413,7 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
+ +
+ do + do
+ status = mknod (file_name, mode ^ invert_permissions, 0); + status = mknod (file_name, mode ^ invert_permissions, 0);
+ while (status && maybe_recoverable ((char *)file_name, &interdir_made)); + while (status && maybe_recoverable ((char *)file_name, false, &interdir_made));
+ xattrs_xattrs_set(st, file_name, typeflag); + xattrs_xattrs_set(st, file_name, typeflag);
+ *file_created = 1; + *file_created = 1;
+ } + }
@ -422,19 +423,20 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
/* Fix the statuses of all directories whose statuses need fixing, and /* Fix the statuses of all directories whose statuses need fixing, and
which are not ancestors of FILE_NAME. If AFTER_LINKS is which are not ancestors of FILE_NAME. If AFTER_LINKS is
nonzero, do this for all such directories; otherwise, stop at the nonzero, do this for all such directories; otherwise, stop at the
@@ -624,11 +695,22 @@ apply_nonancestor_delayed_set_stat (char @@ -721,12 +793,23 @@ apply_nonancestor_delayed_set_stat (char
sb.stat.st_gid = data->gid; sb.stat.st_gid = data->gid;
sb.atime = data->atime; sb.atime = data->atime;
sb.mtime = data->mtime; sb.mtime = data->mtime;
+ sb.cntx_name = data->cntx_name; + sb.cntx_name = data->cntx_name;
+ sb.acls_a_ptr = data->acls_a_ptr; + sb.acls_a_ptr = data->acls_a_ptr;
+ sb.acls_a_len = data->acls_a_len; + sb.acls_a_len = data->acls_a_len;
+ sb.acls_d_ptr = data->acls_d_ptr; + sb.acls_d_ptr = data->acls_d_ptr;
+ sb.acls_d_len = data->acls_d_len; + sb.acls_d_len = data->acls_d_len;
+ sb.xattr_map = data->xattr_map; + sb.xattr_map = data->xattr_map;
+ sb.xattr_map_size = data->xattr_map_size; + sb.xattr_map_size = data->xattr_map_size;
set_stat (data->file_name, &sb, cur_info, set_stat (data->file_name, &sb,
data->invert_permissions, data->permstatus, DIRTYPE); -1, current_mode, current_mode_mask,
DIRTYPE, data->interdir, data->atflag);
} }
delayed_set_stat_head = data->next; delayed_set_stat_head = data->next;
@ -445,30 +447,37 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
free (data); free (data);
} }
} }
@@ -730,7 +812,7 @@ extract_dir (char *file_name, int typefl @@ -842,6 +925,7 @@ extract_dir (char *file_name, int typefl
static int static int
-open_output_file (char *file_name, int typeflag, mode_t mode) open_output_file (char const *file_name, int typeflag, mode_t mode,
+open_output_file (char *file_name, int typeflag, mode_t mode, int file_created) + int file_created,
mode_t *current_mode, mode_t *current_mode_mask)
{ {
int fd; int fd;
int openflag = (O_WRONLY | O_BINARY | O_CREAT @@ -852,6 +936,10 @@ open_output_file (char const *file_name,
@@ -738,6 +820,10 @@ open_output_file (char *file_name, int t ? O_TRUNC | (dereference_option ? 0 : O_NOFOLLOW)
? O_TRUNC
: O_EXCL)); : O_EXCL));
+ /* File might be created in set_xattr. So clear O_EXCL to avoid open() failure */ + /* File might be created in set_xattr. So clear O_EXCL to avoid open() failure */
+ if (file_created) + if (file_created)
+ openflag = openflag & ~O_EXCL; + openflag = openflag & ~O_EXCL;
+ +
#if O_CTG if (typeflag == CONTTYPE)
/* Contiguous files (on the Masscomp) have to specify the size in {
the open call that creates them. */ static int conttype_diagnosed;
@@ -796,8 +882,18 @@ extract_file (char *file_name, int typef @@ -908,6 +996,7 @@ extract_file (char *file_name, int typef
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;
@@ -924,7 +1013,17 @@ extract_file (char *file_name, int typef
}
else else
{ {
int recover = RECOVER_NO;
+ int file_created = 0; + int file_created = 0;
+ if (set_xattr (file_name, &current_stat_info, invert_permissions, + if (set_xattr (file_name, &current_stat_info, invert_permissions,
+ typeflag, &file_created)) + typeflag, &file_created))
@ -478,14 +487,12 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
+ return 1; + return 1;
+ } + }
+ +
do while ((fd = open_output_file (file_name, typeflag, mode,
- fd = open_output_file (file_name, typeflag, mode ^ invert_permissions); + file_created,
+ fd = open_output_file (file_name, typeflag, mode ^ invert_permissions, &current_mode, &current_mode_mask))
+ file_created); < 0)
while (fd < 0 {
&& (recover = maybe_recoverable (file_name, &interdir_made)) @@ -1065,6 +1164,13 @@ create_placeholder_file (char *file_name
== RECOVER_OK);
@@ -922,6 +1018,13 @@ create_placeholder_file (char *file_name
+ strlen (file_name) + 1); + strlen (file_name) + 1);
p->sources->next = 0; p->sources->next = 0;
strcpy (p->sources->string, file_name); strcpy (p->sources->string, file_name);
@ -499,10 +506,10 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
strcpy (p->target, current_stat_info.link_name); strcpy (p->target, current_stat_info.link_name);
h = delayed_set_stat_head; h = delayed_set_stat_head;
@@ -1335,6 +1438,13 @@ apply_delayed_links (void) @@ -1499,6 +1605,13 @@ apply_delayed_links (void)
struct tar_stat_info st1;
st1.stat.st_uid = ds->uid;
st1.stat.st_gid = ds->gid; st1.stat.st_gid = ds->gid;
st1.atime = ds->atime;
st1.mtime = ds->mtime;
+ st1.cntx_name = ds->cntx_name; + st1.cntx_name = ds->cntx_name;
+ st1.acls_a_ptr = ds->acls_a_ptr; + st1.acls_a_ptr = ds->acls_a_ptr;
+ st1.acls_a_len = ds->acls_a_len; + st1.acls_a_len = ds->acls_a_len;
@ -510,10 +517,10 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
+ st1.acls_d_len = ds->acls_d_len; + st1.acls_d_len = ds->acls_d_len;
+ st1.xattr_map = ds->xattr_map; + st1.xattr_map = ds->xattr_map;
+ st1.xattr_map_size = ds->xattr_map_size; + st1.xattr_map_size = ds->xattr_map_size;
set_stat (source, &st1, NULL, 0, 0, SYMTYPE); set_stat (source, &st1, -1, 0, 0, SYMTYPE,
false, AT_SYMLINK_NOFOLLOW);
valid_source = source; valid_source = source;
} @@ -1513,6 +1626,9 @@ apply_delayed_links (void)
@@ -1348,6 +1458,9 @@ apply_delayed_links (void)
sources = next; sources = next;
} }
@ -523,10 +530,10 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
{ {
struct delayed_link *next = ds->next; struct delayed_link *next = ds->next;
free (ds); free (ds);
diff -urNp tar-1.23-orig/src/list.c tar-1.23/src/list.c diff -urNp tar-1.24-orig/src/list.c tar-1.24/src/list.c
--- tar-1.23-orig/src/list.c 2010-08-16 14:29:00.411912161 +0200 --- tar-1.24-orig/src/list.c 2010-10-25 09:15:14.216463863 +0200
+++ tar-1.23/src/list.c 2010-08-16 14:32:11.468912021 +0200 +++ tar-1.24/src/list.c 2010-10-25 10:24:52.563213968 +0200
@@ -586,6 +586,13 @@ decode_header (union block *header, stru @@ -597,6 +597,13 @@ decode_header (union block *header, stru
assign_string (&stat_info->gname, assign_string (&stat_info->gname,
header->header.gname[0] ? header->header.gname : NULL); header->header.gname[0] ? header->header.gname : NULL);
@ -540,9 +547,9 @@ diff -urNp tar-1.23-orig/src/list.c tar-1.23/src/list.c
if (format == OLDGNU_FORMAT && incremental_option) if (format == OLDGNU_FORMAT && incremental_option)
{ {
stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime); stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime);
diff -urNp tar-1.23-orig/src/Makefile.am tar-1.23/src/Makefile.am diff -urNp tar-1.24-orig/src/Makefile.am tar-1.24/src/Makefile.am
--- tar-1.23-orig/src/Makefile.am 2010-01-26 12:30:20.000000000 +0100 --- tar-1.24-orig/src/Makefile.am 2010-10-24 20:07:54.000000000 +0200
+++ tar-1.23/src/Makefile.am 2010-08-16 14:32:11.469911951 +0200 +++ tar-1.24/src/Makefile.am 2010-10-25 10:24:52.564214456 +0200
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
bin_PROGRAMS = tar bin_PROGRAMS = tar
@ -564,11 +571,11 @@ diff -urNp tar-1.23-orig/src/Makefile.am tar-1.23/src/Makefile.am
LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV) LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV)
-tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) -tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
+tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) +tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c diff -urNp tar-1.24-orig/src/tar.c tar-1.24/src/tar.c
--- tar-1.23-orig/src/tar.c 2010-08-16 14:29:00.433923894 +0200 --- tar-1.24-orig/src/tar.c 2010-10-24 20:07:55.000000000 +0200
+++ tar-1.23/src/tar.c 2010-08-16 14:32:11.472912580 +0200 +++ tar-1.24/src/tar.c 2010-10-25 10:24:52.565223676 +0200
@@ -255,7 +255,8 @@ tar_set_quoting_style (char *arg) @@ -255,7 +255,8 @@ tar_set_quoting_style (char *arg)
enum enum
@ -579,7 +586,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
ATIME_PRESERVE_OPTION, ATIME_PRESERVE_OPTION,
BACKUP_OPTION, BACKUP_OPTION,
CHECK_DEVICE_OPTION, CHECK_DEVICE_OPTION,
@@ -287,6 +288,7 @@ enum @@ -288,6 +289,7 @@ enum
MODE_OPTION, MODE_OPTION,
MTIME_OPTION, MTIME_OPTION,
NEWER_MTIME_OPTION, NEWER_MTIME_OPTION,
@ -587,7 +594,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
NO_ANCHORED_OPTION, NO_ANCHORED_OPTION,
NO_AUTO_COMPRESS_OPTION, NO_AUTO_COMPRESS_OPTION,
NO_CHECK_DEVICE_OPTION, NO_CHECK_DEVICE_OPTION,
@@ -300,9 +302,11 @@ enum @@ -301,9 +303,11 @@ enum
NO_SAME_OWNER_OPTION, NO_SAME_OWNER_OPTION,
NO_SAME_PERMISSIONS_OPTION, NO_SAME_PERMISSIONS_OPTION,
NO_SEEK_OPTION, NO_SEEK_OPTION,
@ -599,7 +606,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
NULL_OPTION, NULL_OPTION,
NUMERIC_OWNER_OPTION, NUMERIC_OWNER_OPTION,
OCCURRENCE_OPTION, OCCURRENCE_OPTION,
@@ -324,6 +328,7 @@ enum @@ -325,6 +329,7 @@ enum
RMT_COMMAND_OPTION, RMT_COMMAND_OPTION,
RSH_COMMAND_OPTION, RSH_COMMAND_OPTION,
SAME_OWNER_OPTION, SAME_OWNER_OPTION,
@ -607,9 +614,9 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
SHOW_DEFAULTS_OPTION, SHOW_DEFAULTS_OPTION,
SHOW_OMITTED_DIRS_OPTION, SHOW_OMITTED_DIRS_OPTION,
SHOW_TRANSFORMED_NAMES_OPTION, SHOW_TRANSFORMED_NAMES_OPTION,
@@ -339,7 +344,8 @@ enum @@ -340,7 +345,8 @@ enum
VOLNO_FILE_OPTION, VOLNO_FILE_OPTION,
WARNING_OPTION, WARNING_OPTION,
WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_MATCH_SLASH_OPTION,
- WILDCARDS_OPTION - WILDCARDS_OPTION
+ WILDCARDS_OPTION, + WILDCARDS_OPTION,
@ -617,7 +624,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
}; };
const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION; const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION;
@@ -485,6 +491,10 @@ static struct argp_option options[] = { @@ -486,6 +492,10 @@ static struct argp_option options[] = {
{NULL, 0, NULL, 0, {NULL, 0, NULL, 0,
N_("Handling of file attributes:"), GRID }, N_("Handling of file attributes:"), GRID },
@ -628,7 +635,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
{"owner", OWNER_OPTION, N_("NAME"), 0, {"owner", OWNER_OPTION, N_("NAME"), 0,
N_("force NAME as owner for added files"), GRID+1 }, N_("force NAME as owner for added files"), GRID+1 },
{"group", GROUP_OPTION, N_("NAME"), 0, {"group", GROUP_OPTION, N_("NAME"), 0,
@@ -515,6 +525,14 @@ static struct argp_option options[] = { @@ -516,6 +526,14 @@ static struct argp_option options[] = {
{"preserve-order", 's', 0, 0, {"preserve-order", 's', 0, 0,
N_("sort names to extract to match archive"), GRID+1 }, N_("sort names to extract to match archive"), GRID+1 },
{"same-order", 0, 0, OPTION_ALIAS, NULL, GRID+1 }, {"same-order", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
@ -643,7 +650,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
{"preserve", PRESERVE_OPTION, 0, 0, {"preserve", PRESERVE_OPTION, 0, 0,
N_("same as both -p and -s"), GRID+1 }, N_("same as both -p and -s"), GRID+1 },
{"delay-directory-restore", DELAY_DIRECTORY_RESTORE_OPTION, 0, 0, {"delay-directory-restore", DELAY_DIRECTORY_RESTORE_OPTION, 0, 0,
@@ -2063,6 +2081,37 @@ parse_opt (int key, char *arg, struct ar @@ -2079,6 +2097,37 @@ parse_opt (int key, char *arg, struct ar
same_permissions_option = -1; same_permissions_option = -1;
break; break;
@ -681,7 +688,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
case RECURSION_OPTION: case RECURSION_OPTION:
recursion_option = FNM_LEADING_DIR; recursion_option = FNM_LEADING_DIR;
break; break;
@@ -2445,6 +2494,29 @@ decode_options (int argc, char **argv) @@ -2461,6 +2510,29 @@ decode_options (int argc, char **argv)
|| subcommand_option != LIST_SUBCOMMAND)) || subcommand_option != LIST_SUBCOMMAND))
USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives"))); USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives")));
@ -711,10 +718,10 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
/* If ready to unlink hierarchies, so we are for simpler files. */ /* If ready to unlink hierarchies, so we are for simpler files. */
if (recursive_unlink_option) if (recursive_unlink_option)
old_files_option = UNLINK_FIRST_OLD_FILES; old_files_option = UNLINK_FIRST_OLD_FILES;
@@ -2665,11 +2737,15 @@ tar_stat_init (struct tar_stat_info *st) @@ -2713,11 +2785,15 @@ void
void
tar_stat_destroy (struct tar_stat_info *st) tar_stat_destroy (struct tar_stat_info *st)
{ {
tar_stat_close (st);
+ xheader_xattr_free (st->xattr_map, st->xattr_map_size); + xheader_xattr_free (st->xattr_map, st->xattr_map_size);
free (st->orig_file_name); free (st->orig_file_name);
free (st->file_name); free (st->file_name);
@ -727,9 +734,9 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
free (st->sparse_map); free (st->sparse_map);
free (st->dumpdir); free (st->dumpdir);
xheader_destroy (&st->xhdr); xheader_destroy (&st->xhdr);
diff -urNp tar-1.23-orig/src/tar.h tar-1.23/src/tar.h diff -urNp tar-1.24-orig/src/tar.h tar-1.24/src/tar.h
--- tar-1.23-orig/src/tar.h 2010-01-26 12:30:20.000000000 +0100 --- tar-1.24-orig/src/tar.h 2010-10-24 20:07:46.000000000 +0200
+++ tar-1.23/src/tar.h 2010-08-16 14:32:11.473924383 +0200 +++ tar-1.24/src/tar.h 2010-10-25 10:24:52.567223606 +0200
@@ -276,6 +276,14 @@ struct xheader @@ -276,6 +276,14 @@ struct xheader
uintmax_t string_length; uintmax_t string_length;
}; };
@ -770,10 +777,10 @@ diff -urNp tar-1.23-orig/src/tar.h tar-1.23/src/tar.h
+ +
/* Extended headers */ /* Extended headers */
struct xheader xhdr; struct xheader xhdr;
diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c diff -urNp tar-1.24-orig/src/xattrs.c tar-1.24/src/xattrs.c
--- tar-1.23-orig/src/xattrs.c 1970-01-01 01:00:00.000000000 +0100 --- tar-1.24-orig/src/xattrs.c 1970-01-01 01:00:00.000000000 +0100
+++ tar-1.23/src/xattrs.c 2010-08-16 14:34:12.554509938 +0200 +++ tar-1.24/src/xattrs.c 2010-10-25 10:24:52.568214736 +0200
@@ -0,0 +1,489 @@ @@ -0,0 +1,489 @@
+/* Create a tar archive. +/* Create a tar archive.
+ +
@ -1264,9 +1271,9 @@ diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c
+#endif +#endif
+ } + }
+} +}
diff -urNp tar-1.23-orig/src/xattrs.h tar-1.23/src/xattrs.h diff -urNp tar-1.24-orig/src/xattrs.h tar-1.24/src/xattrs.h
--- tar-1.23-orig/src/xattrs.h 1970-01-01 01:00:00.000000000 +0100 --- tar-1.24-orig/src/xattrs.h 1970-01-01 01:00:00.000000000 +0100
+++ tar-1.23/src/xattrs.h 2010-08-16 14:32:11.475920821 +0200 +++ tar-1.24/src/xattrs.h 2010-10-25 10:24:52.569214526 +0200
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
+ +
+extern void xattrs_acls_get(struct tar_stat_info *st, +extern void xattrs_acls_get(struct tar_stat_info *st,
@ -1282,10 +1289,10 @@ diff -urNp tar-1.23-orig/src/xattrs.h tar-1.23/src/xattrs.h
+ char const *file_name, char typeflag); + char const *file_name, char typeflag);
+extern void xattrs_xattrs_set(struct tar_stat_info const *st, +extern void xattrs_xattrs_set(struct tar_stat_info const *st,
+ char const *file_name, char typeflag); + char const *file_name, char typeflag);
diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c diff -urNp tar-1.24-orig/src/xheader.c tar-1.24/src/xheader.c
--- tar-1.23-orig/src/xheader.c 2010-02-12 11:03:09.000000000 +0100 --- tar-1.24-orig/src/xheader.c 2010-10-24 20:07:46.000000000 +0200
+++ tar-1.23/src/xheader.c 2010-08-16 14:38:39.480912020 +0200 +++ tar-1.24/src/xheader.c 2010-10-25 10:24:52.570223396 +0200
@@ -459,6 +459,74 @@ xheader_write_global (struct xheader *xh @@ -460,6 +460,74 @@ xheader_write_global (struct xheader *xh
} }
} }
@ -1360,7 +1367,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
/* General Interface */ /* General Interface */
@@ -472,6 +540,7 @@ struct xhdr_tab @@ -473,6 +541,7 @@ struct xhdr_tab
struct xheader *, void const *data); struct xheader *, void const *data);
void (*decoder) (struct tar_stat_info *, char const *, char const *, size_t); void (*decoder) (struct tar_stat_info *, char const *, char const *, size_t);
int flags; int flags;
@ -1368,7 +1375,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
}; };
/* This declaration must be extern, because ISO C99 section 6.9.2 /* This declaration must be extern, because ISO C99 section 6.9.2
@@ -488,8 +557,17 @@ locate_handler (char const *keyword) @@ -489,8 +558,17 @@ locate_handler (char const *keyword)
struct xhdr_tab const *p; struct xhdr_tab const *p;
for (p = xhdr_tab; p->keyword; p++) for (p = xhdr_tab; p->keyword; p++)
@ -1388,7 +1395,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
return NULL; return NULL;
} }
@@ -499,7 +577,7 @@ xheader_protected_pattern_p (const char @@ -500,7 +578,7 @@ xheader_protected_pattern_p (const char
struct xhdr_tab const *p; struct xhdr_tab const *p;
for (p = xhdr_tab; p->keyword; p++) for (p = xhdr_tab; p->keyword; p++)
@ -1397,7 +1404,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
return true; return true;
return false; return false;
} }
@@ -510,7 +588,7 @@ xheader_protected_keyword_p (const char @@ -511,7 +589,7 @@ xheader_protected_keyword_p (const char
struct xhdr_tab const *p; struct xhdr_tab const *p;
for (p = xhdr_tab; p->keyword; p++) for (p = xhdr_tab; p->keyword; p++)
@ -1406,7 +1413,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
return true; return true;
return false; return false;
} }
@@ -1469,6 +1547,71 @@ volume_filename_decoder (struct tar_stat @@ -1470,6 +1548,71 @@ volume_filename_decoder (struct tar_stat
} }
static void static void
@ -1478,7 +1485,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
sparse_major_coder (struct tar_stat_info const *st, char const *keyword, sparse_major_coder (struct tar_stat_info const *st, char const *keyword,
struct xheader *xhdr, void const *data) struct xheader *xhdr, void const *data)
{ {
@@ -1505,53 +1648,53 @@ sparse_minor_decoder (struct tar_stat_in @@ -1506,53 +1649,53 @@ sparse_minor_decoder (struct tar_stat_in
} }
struct xhdr_tab const xhdr_tab[] = { struct xhdr_tab const xhdr_tab[] = {
@ -1555,7 +1562,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
/* These may be present in a first global header of the archive. /* These may be present in a first global header of the archive.
They provide the same functionality as GNUTYPE_MULTIVOL header. They provide the same functionality as GNUTYPE_MULTIVOL header.
@@ -1560,11 +1703,41 @@ struct xhdr_tab const xhdr_tab[] = { @@ -1561,11 +1704,41 @@ struct xhdr_tab const xhdr_tab[] = {
GNU.volume.offset keeps the offset of the start of this volume, GNU.volume.offset keeps the offset of the start of this volume,
otherwise kept in oldgnu_header.offset. */ otherwise kept in oldgnu_header.offset. */
{ "GNU.volume.filename", volume_label_coder, volume_filename_decoder, { "GNU.volume.filename", volume_label_coder, volume_filename_decoder,

View File

@ -4,13 +4,13 @@
Summary: A GNU file archiving program Summary: A GNU file archiving program
Name: tar Name: tar
Epoch: 2 Epoch: 2
Version: 1.23 Version: 1.24
Release: 8%{?dist} Release: 1%{?dist}
License: GPLv3+ License: GPLv3+
Group: Applications/Archiving Group: Applications/Archiving
URL: http://www.gnu.org/software/tar/ URL: http://www.gnu.org/software/tar/
Source0: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.bz2 Source0: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.xz
Source1: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.bz2.sig Source1: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.xz.sig
#Manpage for tar and gtar, a bit modified help2man generated manpage #Manpage for tar and gtar, a bit modified help2man generated manpage
Source2: tar.1 Source2: tar.1
#Stop issuing lone zero block warnings #Stop issuing lone zero block warnings
@ -19,7 +19,7 @@ Patch1: tar-1.14-loneZeroWarning.patch
#when ftruncate may fail to grow the size of a file.(#179507) #when ftruncate may fail to grow the size of a file.(#179507)
Patch2: tar-1.15.1-vfatTruncate.patch Patch2: tar-1.15.1-vfatTruncate.patch
#Add support for selinux, acl and extended attributes #Add support for selinux, acl and extended attributes
Patch3: tar-1.23-xattrs.patch Patch3: tar-1.24-xattrs.patch
#change inclusion defaults of tar to "--wildcards --anchored #change inclusion defaults of tar to "--wildcards --anchored
#--wildcards-match-slash" for compatibility reasons (#206841) #--wildcards-match-slash" for compatibility reasons (#206841)
Patch4: tar-1.17-wildcards.patch Patch4: tar-1.17-wildcards.patch
@ -31,12 +31,10 @@ Patch5: tar-1.22-atime-rofs.patch
Patch6: tar-1.22-fortifysourcessigabrt.patch Patch6: tar-1.22-fortifysourcessigabrt.patch
#oldarchive option was not working(#594044) #oldarchive option was not working(#594044)
Patch7: tar-1.23-oldarchive.patch Patch7: tar-1.23-oldarchive.patch
#fix exclusion of long file names with --xattrs (#634866)
Patch8: tar-1.23-longnames.patch
#do not crash with --listed-incremental (#635318)
Patch9: tar-1.23-listedincremental.patch
#match non-stripped file names (#637085) #match non-stripped file names (#637085)
Patch10: tar-1.23-stripcomponents.patch Patch8: tar-1.23-stripcomponents.patch
#fix bug with -C and extracting directories
Patch9: tar-1.24-extractingdirs.patch
Requires: info Requires: info
BuildRequires: autoconf automake gzip texinfo gettext libacl-devel gawk rsh BuildRequires: autoconf automake gzip texinfo gettext libacl-devel gawk rsh
%if %{WITH_SELINUX} %if %{WITH_SELINUX}
@ -67,9 +65,8 @@ the rmt package.
%patch5 -p1 -b .rofs %patch5 -p1 -b .rofs
%patch6 -p1 -b .fortify %patch6 -p1 -b .fortify
%patch7 -p1 -b .oldarchive %patch7 -p1 -b .oldarchive
%patch8 -p1 -b .longnames %patch8 -p1 -b .stripcomponents
%patch9 -p1 -b .listedincremental %patch9 -p1 -b .extractC
%patch10 -p1 -b .stripcomponents
autoreconf autoreconf
@ -131,6 +128,9 @@ fi
%{_infodir}/tar.info* %{_infodir}/tar.info*
%changelog %changelog
* Mon Oct 25 2010 Ondrej Vasik <ovasik@redhat.com> 2:1.24-1
- new upstream release 1.24, use .xz archive
* Wed Sep 29 2010 jkeating - 2:1.23-8 * Wed Sep 29 2010 jkeating - 2:1.23-8
- Rebuilt for gcc bug 634757 - Rebuilt for gcc bug 634757