[SCM] KDE Development Platform Libraries module packaging branch, squeeze, updated. debian/4.4.5-2+squeeze1-7-g66efdda
Modestas Vainius
modax at alioth.debian.org
Sat May 14 23:29:47 UTC 2011
The following commit has been merged in the squeeze branch:
commit 66efdda447a8cab41e953f46be2cce6149c7c5aa
Author: Modestas Vainius <modax at debian.org>
Date: Sat May 14 20:05:48 2011 +0300
Fix KTar longlink support when filenames are encoded in the UTF-8 locale.
tar archives have to use "longlink trick" to store names longer than 100 bytes.
KTar class has functions implementing longlink, but they check name length in
_characters_, not in bytes. For non-ASCII characters in UTF-8 length of string
in bytes and length in characters do not match. In my case file had
character-length less than 100 and byte-length greater than 100, so name simply
truncated. Such behavior can be observed on non-ASCII UTF-8 or any other
multibyte encoding. If file name is very long, resulting .tar may become
unreadable.
Implemented in ktar_longlink_length_in_bytes.diff patch (thanks to Ibragimov
Rinat). Closes: #612675
---
debian/changelog | 3 +
debian/patches/ktar_longlink_length_in_bytes.diff | 50 +++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2bdb245..aac9418 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,9 @@ kde4libs (4:4.4.5-2+squeeze2) UNRELEASED; urgency=low
checksum by calculating it both ways (unsigned and signed) and accept if
either matches (partially solves #612675). Implemented in
ktar_header_checksum_fix.diff patch.
+ * Fix KTar longlink support when filenames are encoded in the UTF-8 (or other
+ multibyte) locale. Implemented in ktar_longlink_length_in_bytes.diff patch
+ (thanks to Ibragimov Rinat). Closes: #612675
-- José Manuel Santamaría Lema <panfaust at gmail.com> Tue, 12 Apr 2011 21:16:20 +0200
diff --git a/debian/patches/ktar_longlink_length_in_bytes.diff b/debian/patches/ktar_longlink_length_in_bytes.diff
new file mode 100644
index 0000000..8fc6d0b
--- /dev/null
+++ b/debian/patches/ktar_longlink_length_in_bytes.diff
@@ -0,0 +1,50 @@
+From: Ibragimov Rinat <ibragimovrinat at mail.ru>
+Subject: Fix longlink UTF-8 support in KTar
+Bug: http://bugs.kde.org/show_bug.cgi?id=266141
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612675
+Last-Update: 2011-05-14
+Forwarded: yes
+Origin: other, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612675#5
+Acked-By: Modestas Vainius <modax at debian.org>
+
+tar archives have to use "longlink trick" to store names longer than 100 bytes.
+KTar class has functions implementing longlink, but they check name length in
+_characters_, not in bytes. For non-ASCII characters in UTF-8 length of string
+in bytes and length in characters do not match. In my case file had
+character-length less than 100 and byte-length greater than 100, so name simply
+truncated. Such behavior can be observed on non-ASCII UTF-8 or any other
+multibyte encoding. If file name is very long, resulting .tar may become
+unreadable.
+
+--- a/kio/kio/ktar.cpp
++++ b/kio/kio/ktar.cpp
+@@ -750,7 +750,7 @@ bool KTar::doPrepareWriting(const QStrin
+ const QByteArray gname = group.toLocal8Bit();
+
+ // If more than 100 chars, we need to use the LongLink trick
+- if ( fileName.length() > 99 )
++ if ( encodedFileName.length() > 99 )
+ d->writeLonglink(buffer,encodedFileName,'L',uname,gname);
+
+ // Write (potentially truncated) name
+@@ -803,7 +803,7 @@ bool KTar::doWriteDir(const QString &nam
+ QByteArray gname = group.toLocal8Bit();
+
+ // If more than 100 chars, we need to use the LongLink trick
+- if ( dirName.length() > 99 )
++ if ( encodedDirname.length() > 99 )
+ d->writeLonglink(buffer,encodedDirname,'L',uname,gname);
+
+ // Write (potentially truncated) name
+@@ -855,9 +855,9 @@ bool KTar::doWriteSymLink(const QString
+ QByteArray gname = group.toLocal8Bit();
+
+ // If more than 100 chars, we need to use the LongLink trick
+- if (target.length() > 99)
++ if (encodedTarget.length() > 99)
+ d->writeLonglink(buffer,encodedTarget,'K',uname,gname);
+- if ( fileName.length() > 99 )
++ if ( encodedFileName.length() > 99 )
+ d->writeLonglink(buffer,encodedFileName,'L',uname,gname);
+
+ // Write (potentially truncated) name
diff --git a/debian/patches/series b/debian/patches/series
index ca529c8..487a3b0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -22,3 +22,4 @@ cve_2011_1168_konqueror_xss.diff
cve_2010_3170_cn_wildcards.diff
cve_2011_1094_ssl_verify_hostname.diff
ktar_header_checksum_fix.diff
+ktar_longlink_length_in_bytes.diff
--
KDE Development Platform Libraries module packaging
More information about the pkg-kde-commits
mailing list