Accepting request 29082 from Base:System

Copy from Base:System/tar based on submit request 29082 from user msmeissn

OBS-URL: https://build.opensuse.org/request/show/29082
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tar?expand=0&rev=19
This commit is contained in:
OBS User autobuild 2010-01-11 15:52:22 +00:00 committed by Git OBS Bridge
parent ce915c8361
commit b408088a50
3 changed files with 70 additions and 4 deletions

View File

@ -0,0 +1,52 @@
Index: tar-1.21/src/create.c
===================================================================
--- tar-1.21.orig/src/create.c
+++ tar-1.21/src/create.c
@@ -532,8 +532,8 @@ start_private_header (const char *name,
GID_TO_CHARS (getgid (), header->header.gid);
MAJOR_TO_CHARS (0, header->header.devmajor);
MINOR_TO_CHARS (0, header->header.devminor);
- strncpy (header->header.magic, TMAGIC, TMAGLEN);
- strncpy (header->header.version, TVERSION, TVERSLEN);
+ memcpy (header->header.magic, TMAGIC, TMAGLEN);
+ memcpy (header->header.version, TVERSION, TVERSLEN);
return header;
}
@@ -577,7 +577,10 @@ write_gnu_long_link (struct tar_stat_inf
GNAME_TO_CHARS (tmpname, header->header.gname);
free (tmpname);
- strcpy (header->header.magic, OLDGNU_MAGIC);
+ /* OLDGNU_MAGIC is string with 7 chars + NULL */
+ memcpy (header->header.magic, OLDGNU_MAGIC, sizeof(header->header.magic));
+ memcpy (header->header.version, OLDGNU_MAGIC+sizeof(header->header.magic),
+ sizeof(header->header.version));
header->header.typeflag = type;
finish_header (st, header, -1);
@@ -907,15 +910,19 @@ start_header (struct tar_stat_info *st)
break;
case OLDGNU_FORMAT:
- case GNU_FORMAT: /*FIXME?*/
- /* Overwrite header->header.magic and header.version in one blow. */
- strcpy (header->header.magic, OLDGNU_MAGIC);
+ case GNU_FORMAT:
+ /* OLDGNU_MAGIC is string with 7 chars + NULL */
+ memcpy (header->header.magic, OLDGNU_MAGIC,
+ sizeof(header->header.magic));
+ memcpy (header->header.version,
+ OLDGNU_MAGIC+sizeof(header->header.magic),
+ sizeof(header->header.version));
break;
case POSIX_FORMAT:
case USTAR_FORMAT:
- strncpy (header->header.magic, TMAGIC, TMAGLEN);
- strncpy (header->header.version, TVERSION, TVERSLEN);
+ memcpy (header->header.magic, TMAGIC, TMAGLEN);
+ memcpy (header->header.version, TVERSION, TVERSLEN);
break;
default:

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sun Dec 6 17:52:57 CET 2009 - jengelh@medozas.de
- enable parallel building
-------------------------------------------------------------------
Fri Dec 4 21:46:24 CET 2009 - meissner@suse.de
- fixed FORTIFY_SOURCE=2 issue with gcc 4.5.
-------------------------------------------------------------------
Sun Aug 30 18:36:08 UTC 2009 - aj@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package tar (Version 1.21)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,13 +21,13 @@
Name: tar
BuildRequires: help2man
Url: http://www.gnu.org/software/tar/
License: GPL v3 or later
License: GPLv3+
Group: System/Base
Provides: base:/bin/tar
PreReq: %install_info_prereq
AutoReqProv: on
Version: 1.21
Release: 3
Release: 4
Summary: GNU implementation of tar ((t)ape (ar)chiver)
Source0: %name-%version.tar.bz2
# merged
@ -39,6 +39,7 @@ Patch1: tar-disable-listed02-test.diff
Patch2: tar-manpage.patch
Patch3: tar-wildcards.patch
Patch4: tar-recognize_xz.patch
Patch5: tar-1.22-fortifysourcessigabrt.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Recommends: xz
Recommends: tar-lang = %version
@ -82,6 +83,7 @@ Authors:
%patch2 -p1
%patch3 -p1
%patch4
%patch5 -p1
%build
rm -f po/no.* po/ky.*
@ -93,7 +95,9 @@ export CFLAGS="$RPM_OPT_FLAGS %my_cflags"
export RSH="/usr/bin/rsh"
./configure --prefix=%_prefix --bindir=%_bindir --mandir=%_mandir \
--infodir=%_infodir --build=%{_target_cpu}-suse-linux
make
make %{?jobs:-j%jobs};
%check
#%ifarch %arm
#make check || true
#%else