[cpio] Fix for splitting long file names while creating ustar archive

Pavel Raiskup praiskup at fedoraproject.org
Fri Oct 19 07:01:57 UTC 2012


commit 65fa937be7b3d036ad7661a83b3b4d649d8933d7
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Thu Oct 18 15:07:32 2012 +0200

    Fix for splitting long file names while creating ustar archive
    
    Resolves: #866467

 cpio-2.10-longnames-split.patch |   20 ++++++++++++++++++++
 cpio.spec                       |    8 +++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/cpio-2.10-longnames-split.patch b/cpio-2.10-longnames-split.patch
new file mode 100644
index 0000000..d4517b1
--- /dev/null
+++ b/cpio-2.10-longnames-split.patch
@@ -0,0 +1,20 @@
+diff --git a/src/tar.c b/src/tar.c
+index 97d74bc..6de8961 100644
+--- a/src/tar.c
++++ b/src/tar.c
+@@ -48,10 +48,12 @@ split_long_name (const char *name, size_t length)
+ {
+   size_t i;
+ 
+-  if (length > TARPREFIXSIZE)
+-    length = TARPREFIXSIZE+2;
++  if (length > TARPREFIXSIZE + 1)
++    length = TARPREFIXSIZE + 1;
++  else if (ISSLASH (name[length - 1]))
++    length--;
+   for (i = length - 1; i > 0; i--)
+-    if (name[i] == '/')
++    if (ISSLASH (name[i]))
+       break;
+   return i;
+ }
diff --git a/cpio.spec b/cpio.spec
index ca01032..bb3076a 100644
--- a/cpio.spec
+++ b/cpio.spec
@@ -3,7 +3,7 @@
 Summary: A GNU archiving program
 Name: cpio
 Version: 2.11
-Release: 11%{?dist}
+Release: 12%{?dist}
 License: GPLv3+
 Group: Applications/Archiving
 URL: http://www.gnu.org/software/cpio/
@@ -22,6 +22,8 @@ Patch4: cpio-2.9.90-defaultremoteshell.patch
 Patch5: cpio-2.10-patternnamesigsegv.patch
 #fix rawhide buildfailure by updating gnulib's stdio.in.h
 Patch6: cpio-2.11-stdio.in.patch
+# fix bad file name splitting while creating ustar archive (#866467)
+Patch7: cpio-2.10-longnames-split.patch
 Requires(post): /sbin/install-info
 Requires(preun): /sbin/install-info
 Provides: bundled(gnulib)
@@ -50,6 +52,7 @@ Install cpio if you need a program to manage file archives.
 %patch4 -p1 -b .defaultremote
 %patch5 -p1 -b .patternsegv
 %patch6 -p1 -b .gnulib
+%patch7 -p1 -b .longnames
 
 autoheader
 
@@ -99,6 +102,9 @@ fi
 %{_infodir}/*.info*
 
 %changelog
+* Thu Oct 18 2012 Pavel Raiskup <praiskup at redhat.com> 2:10-12
+- fix for bad file name splitting while creating ustar archive (#866467)
+
 * Wed Aug 29 2012 Ondrej Vasik <ovasik at redhat.com> 2.11-11
 - add missing options to manpage (#852765)
 


More information about the scm-commits mailing list