Blame SOURCES/cpio-2.10-longnames-split.patch

ca6c51
From: Pavel Raiskup <praiskup@redhat.com>
ca6c51
Date: Mon, 14 Sep 2015 09:49:12 +0200
ca6c51
Subject: [PATCH 6/7] Fix for splitting long file names while creating ustar
ca6c51
 archive
ca6c51
ca6c51
Resolves: #866467
ca6c51
ca6c51
diff --git a/src/tar.c b/src/tar.c
ca6c51
index a2ce171..e2b5f45 100644
ca6c51
--- a/src/tar.c
ca6c51
+++ b/src/tar.c
ca6c51
@@ -49,10 +49,12 @@ split_long_name (const char *name, size_t length)
ca6c51
 {
ca6c51
   size_t i;
ca6c51
 
ca6c51
-  if (length > TARPREFIXSIZE)
ca6c51
-    length = TARPREFIXSIZE+2;
ca6c51
+  if (length > TARPREFIXSIZE + 1)
ca6c51
+    length = TARPREFIXSIZE + 1;
ca6c51
+  else if (ISSLASH (name[length - 1]))
ca6c51
+    length--;
ca6c51
   for (i = length - 1; i > 0; i--)
ca6c51
-    if (name[i] == '/')
ca6c51
+    if (ISSLASH (name[i]))
ca6c51
       break;
ca6c51
   return i;
ca6c51
 }