SHA256
1
0
forked from pool/tar
OBS User unknown 2008-03-28 17:54:23 +00:00 committed by Git OBS Bridge
parent cc0cb52d71
commit 960bf0da8b
3 changed files with 154 additions and 46 deletions

View File

@ -0,0 +1,95 @@
Index: src/buffer.c
===================================================================
RCS file: /cvsroot/tar/tar/src/buffer.c,v
retrieving revision 1.115
diff -p -u -r1.115 buffer.c
--- src/buffer.c 31 Oct 2007 13:10:55 -0000 1.115
+++ src/buffer.c 5 Dec 2007 09:43:00 -0000
@@ -229,19 +229,21 @@ static struct zip_magic const magic[] =
/* Check if the file ARCHIVE is a compressed archive. */
enum compress_type
-check_compressed_archive ()
+check_compressed_archive (bool *pshort)
{
struct zip_magic const *p;
bool sfr;
- bool short_file = false;
+ bool temp;
+
+ if (!pshort)
+ pshort = &temp;
/* Prepare global data needed for find_next_block: */
record_end = record_start; /* set up for 1st record = # 0 */
sfr = read_full_records;
read_full_records = true; /* Suppress fatal error on reading a partial
record */
- if (find_next_block () == 0)
- short_file = true;
+ *pshort = find_next_block () == 0;
/* Restore global values */
read_full_records = sfr;
@@ -254,9 +256,6 @@ check_compressed_archive ()
if (memcmp (record_start->buffer, p->magic, p->length) == 0)
return p->type;
- if (short_file)
- ERROR ((0, 0, _("This does not look like a tar archive")));
-
return ct_none;
}
@@ -273,11 +272,16 @@ open_compressed_archive ()
if (!multi_volume_option)
{
- enum compress_type type = check_compressed_archive ();
+ bool shortfile;
+ enum compress_type type = check_compressed_archive (&shortfile);
if (type == ct_none)
- return archive;
-
+ {
+ if (shortfile)
+ ERROR ((0, 0, _("This does not look like a tar archive")));
+ return archive;
+ }
+
/* FD is not needed any more */
rmtclose (archive);
@@ -502,15 +506,18 @@ _open_archive (enum access_mode wanted_a
{
case ACCESS_READ:
{
+ bool shortfile;
enum compress_type type;
archive = STDIN_FILENO;
- type = check_compressed_archive ();
+ type = check_compressed_archive (&shortfile);
if (type != ct_none)
FATAL_ERROR ((0, 0,
_("Archive is compressed. Use %s option"),
compress_option (type)));
+ if (shortfile)
+ ERROR ((0, 0, _("This does not look like a tar archive")));
}
break;
@@ -554,7 +561,7 @@ _open_archive (enum access_mode wanted_a
O_RDWR | O_CREAT | O_BINARY,
MODE_RW, rsh_command_option);
- if (check_compressed_archive () != ct_none)
+ if (check_compressed_archive (NULL) != ct_none)
FATAL_ERROR ((0, 0,
_("Cannot update compressed archives")));
break;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 28 17:00:19 CET 2008 - mkoenig@suse.de
- apply upstream patch to avoid error message when updating
an archive that does not exist [bnc#347525]
-------------------------------------------------------------------
Wed Nov 14 18:09:03 CET 2007 - mkoenig@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package tar (Version 1.19)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@ -10,6 +10,7 @@
# norootforbuild
Name: tar
BuildRequires: help2man
Url: http://www.gnu.org/software/tar/
@ -19,13 +20,14 @@ Provides: base:/bin/tar
PreReq: %install_info_prereq
AutoReqProv: on
Version: 1.19
Release: 1
Release: 24
Summary: GNU implementation of tar ((t)ape (ar)chiver)
Source0: %name-%version.tar.bz2
Patch0: tar-disable_languages.patch
Patch1: tar-disable-listed02-test.diff
Patch2: tar-manpage.patch
Patch6: tar-gcc43.patch
Patch3: tar-gcc43.patch
Patch4: tar-1.19-update_flag.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define _bindir /bin
@ -64,7 +66,8 @@ Authors:
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch6
%patch3
%patch4
%build
rm -f po/no.* po/ky.*
@ -103,8 +106,12 @@ rm -r %buildroot/usr/libexec
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Nov 14 2007 - mkoenig@suse.de
* Fri Mar 28 2008 mkoenig@suse.de
- apply upstream patch to avoid error message when updating
an archive that does not exist [bnc#347525]
* Wed Nov 14 2007 mkoenig@suse.de
- update to version 1.19
* New option --exclude-vcs
* --exclude-tag and --exclude-cache options now work under
@ -115,22 +122,22 @@ rm -rf $RPM_BUILD_ROOT
- merged patches:
tar-1.15.1-CVE-2001-1267.patch
tar-1.17-paxlib-owl-alloca.patch
* Fri Oct 05 2007 - mkoenig@suse.de
* Fri Oct 05 2007 mkoenig@suse.de
- update to version 1.18
Licensed under the GPLv3
- merged patches:
tar-1.17-testsuite12.patch
* Mon Oct 01 2007 - mkoenig@suse.de
* Mon Oct 01 2007 mkoenig@suse.de
- fix build with gcc-4.3
* Fri Aug 31 2007 - mkoenig@suse.de
* Fri Aug 31 2007 mkoenig@suse.de
- fixed another directory traversal vulnerability, CVE-2001-1267,
CVE-2002-0399, [#29973]
* Mon Aug 20 2007 - mkoenig@suse.de
* Mon Aug 20 2007 mkoenig@suse.de
- use correct patch for paxlib stack overflow [#301416]
* Fri Aug 17 2007 - lmichnovic@suse.cz
* Fri Aug 17 2007 lmichnovic@suse.cz
- upstream fix: use of alloca can cause stack overflow
(paxlib-owl-alloca.patch)
* Thu Jun 21 2007 - mkoenig@suse.de
* Thu Jun 21 2007 mkoenig@suse.de
- update to version 1.17:
* Fix archivation of sparse files in posix mode
* Fix operation of --verify --listed-incremental
@ -141,11 +148,11 @@ rm -rf $RPM_BUILD_ROOT
tar-1.6.1-futimens.patch
- fix test 12
tar-1.17-testsuite12.patch
* Tue May 22 2007 - mkoenig@suse.de
* Tue May 22 2007 mkoenig@suse.de
- fix build
* Tue May 15 2007 - coolo@suse.de
* Tue May 15 2007 coolo@suse.de
- use %%find_lang
* Wed Jan 24 2007 - mkoenig@suse.de
* Wed Jan 24 2007 mkoenig@suse.de
- update to version 1.16.1:
* tar-1.16-CVE-2006-6097.patch merged upstream
* tar-1.16-xheader_unused.patch merged upstream
@ -155,7 +162,7 @@ rm -rf $RPM_BUILD_ROOT
* Race conditions have been fixed that in some cases briefly
allowed files extracted by 'tar -x --same-owner' to be
accessed by users that they shouldn't have been.
* Tue Dec 05 2006 - mkoenig@suse.de
* Tue Dec 05 2006 mkoenig@suse.de
- update to version 1.16:
Bugfixes:
* Avoid running off file descriptors when using multiple -C options.
@ -202,30 +209,30 @@ rm -rf $RPM_BUILD_ROOT
- create man page via help2man
- remove support for mangled names, due to security reasons
CVE-2006-6097 [#223185]
* Mon Jul 24 2006 - rguenther@suse.de
* Mon Jul 24 2006 rguenther@suse.de
- Do not build-depend on rsh, but provide the RSH environment.
* Mon Feb 27 2006 - kssingvo@suse.de
* Mon Feb 27 2006 kssingvo@suse.de
- fixed buffer overflow issue CVE-2006-0300 (bugzilla#151516)
- not affected: traversal bug CVE-2005-1918 (bugzilla#145081)
* Sat Feb 18 2006 - aj@suse.de
* Sat Feb 18 2006 aj@suse.de
- Fix build.
* Wed Jan 25 2006 - mls@suse.de
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Sep 01 2005 - mmj@suse.de
* Thu Sep 01 2005 mmj@suse.de
- Add patch from upstream for fixing sparse files > 4GB [#114540]
* Fri Jun 24 2005 - schwab@suse.de
* Fri Jun 24 2005 schwab@suse.de
- Fix broken test.
* Fri Apr 08 2005 - uli@suse.de
* Fri Apr 08 2005 uli@suse.de
- ignore test suite fails on ARM
* Wed Mar 09 2005 - mmj@suse.de
* Wed Mar 09 2005 mmj@suse.de
- Make gcc4 happy
* Tue Feb 01 2005 - mmj@suse.de
* Tue Feb 01 2005 mmj@suse.de
- Disable test that breaks on reiserfs due to that filesystems
limitations. Tar works fine on reiserfs.
* Tue Dec 21 2004 - mmj@suse.de
* Tue Dec 21 2004 mmj@suse.de
- Update to 1.15.1 which fixes a bug introduced in 1.15 which caused
tar to refuse to extract files from standard input.
* Tue Dec 21 2004 - mmj@suse.de
* Tue Dec 21 2004 mmj@suse.de
- Update to tar-1.15 including:
- Features:
o Compressed archives are recognised automatically, it is no
@ -277,43 +284,43 @@ rm -rf $RPM_BUILD_ROOT
o When attempting to delete a non-existing member from the
archive, previous versions of tar used to overwrite last
archive block with zeroes.
* Mon Aug 09 2004 - mmj@suse.de
* Tue Aug 10 2004 mmj@suse.de
- Add patch from snwint with long filename fix [#43538]
* Sun May 30 2004 - mmj@suse.de
* Sun May 30 2004 mmj@suse.de
- Update to 1.14 which is the first stable release of tar
since 1999.
* Thu Apr 15 2004 - mmj@suse.de
* Thu Apr 15 2004 mmj@suse.de
- Fix detection of remote paths [#38709]. Thanks Jürgen!
* Tue Apr 13 2004 - mmj@suse.de
* Tue Apr 13 2004 mmj@suse.de
- Update to 1.13.94 including fix for [#16531]
* Sat Jan 10 2004 - adrian@suse.de
* Sat Jan 10 2004 adrian@suse.de
- build as user
* Fri Jun 20 2003 - ro@suse.de
* Fri Jun 20 2003 ro@suse.de
- build with current gettext
* Thu May 15 2003 - pthomas@suse.de
* Thu May 15 2003 pthomas@suse.de
- Remove unneeded files from build root.
- Add autoconf tests to properly guard K&R prototypes
- Clean up signed/unsigned compares.
* Thu Apr 24 2003 - ro@suse.de
* Thu Apr 24 2003 ro@suse.de
- fix install_info --delete call and move from preun to postun
* Fri Feb 07 2003 - ro@suse.de
* Fri Feb 07 2003 ro@suse.de
- added install_info macros
* Mon Nov 18 2002 - ro@suse.de
* Mon Nov 18 2002 ro@suse.de
- add AM_GNU_GETTEXT_VERSION to configure.ac
* Thu Aug 01 2002 - ro@suse.de
* Thu Aug 01 2002 ro@suse.de
- add acinclude.m4 with missing macros
* Tue Jun 04 2002 - pthomas@suse.de
* Tue Jun 04 2002 pthomas@suse.de
- Make tar a package of its own.
- Update to tar-1.13.25.
- Make tar man page a seperate file instead of part of the patch.
- Patch de.po to reflect the addition of the --bunzip2 parameter
- Use AC_LIBOBJ instead of LIBOBJS
* Wed May 22 2002 - olh@suse.de
* Wed May 22 2002 olh@suse.de
- allow build as user, use buildroot
* Fri Feb 08 2002 - werner@suse.de
* Fri Feb 08 2002 werner@suse.de
- Fix bug #12797: back to builtin behaviour, the widly used -I for
bunzip2 can be reenabled with the environment var TAROLDOPT4BZIP2
* Mon Dec 17 2001 - werner@suse.de
* Mon Dec 17 2001 werner@suse.de
- draht@suse.de: package rsh is needed for build of tar(1) to
enable rsh remote command execution.
two successive execl() calls to /usr/bin/rsh with different
@ -321,18 +328,18 @@ rm -rf $RPM_BUILD_ROOT
successful if /usr/bin/rsh exists. Check for existence of /etc/rmt
on the remote side and execute it, else exec /sbin/rmt . (#12605)
- Use one contstant string for command line
* Tue Nov 20 2001 - werner@suse.de
* Tue Nov 20 2001 werner@suse.de
- Add rsh to needeforbuild to be sure that remote shell for remote
backup will be found.
* Wed Aug 01 2001 - werner@suse.de
* Wed Aug 01 2001 werner@suse.de
- Make /etc/rmt versus /sbin/rmt switch dynamic.
* Tue Mar 27 2001 - werner@suse.de
* Tue Mar 27 2001 werner@suse.de
- Fix man page of tar (#6741)
* Thu Dec 14 2000 - werner@suse.de
* Thu Dec 14 2000 werner@suse.de
- Update to tar 1.13.18
* should avoid some crashes
* avoid exclude file list problem
* Fri Nov 26 1999 - kukuk@suse.de
* Fri Nov 26 1999 kukuk@suse.de
- Add tar.1 to file list
- Remove obsolete entries from file list
- Build tar with locale support