[comix/f18] Prevent crash when non-utf8 path name is given to thumbnail file
Mamoru Tasaka
mtasaka at fedoraproject.org
Tue Dec 4 04:35:53 UTC 2012
commit 660ce56a86b4ad3cf923aa6316177a55d96eade4
Author: TASAKA Mamoru <mtasaka at localhost.localdomain>
Date: Tue Dec 4 13:35:33 2012 +0900
Prevent crash when non-utf8 path name is given to thumbnail file
(bug 877604)
comix-4.0.4-pathname2url-utf8.patch | 12 ++++++++++++
comix.spec | 12 ++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/comix-4.0.4-pathname2url-utf8.patch b/comix-4.0.4-pathname2url-utf8.patch
new file mode 100644
index 0000000..c0e01d5
--- /dev/null
+++ b/comix-4.0.4-pathname2url-utf8.patch
@@ -0,0 +1,12 @@
+--- comix-4.0.4/src/thumbnail.py.p2url 2008-12-13 01:04:28.000000000 +0900
++++ comix-4.0.4/src/thumbnail.py 2012-11-28 18:19:07.687627250 +0900
+@@ -154,6 +154,9 @@
+
+
+ def _path_to_thumbpath(path, dst_dir):
++ # https://bugzilla.redhat.com/show_bug.cgi?id=877604
++ if isinstance(path, unicode):
++ path = path.encode("utf-8")
+ uri = 'file://' + pathname2url(os.path.normpath(path))
+ return _uri_to_thumbpath(uri, dst_dir)
+
diff --git a/comix.spec b/comix.spec
index c2ece95..1d1091f 100644
--- a/comix.spec
+++ b/comix.spec
@@ -7,11 +7,11 @@
%undefine alphatag
%define comix4 1
-%define fedorarel 4
+%define fedorarel 5
Name: comix
Version: %{mainver}
-Release: %{?ifalpha:0.}%{fedorarel}%{?ifalpha:.%alphatag}%{?dist}.1
+Release: %{?ifalpha:0.}%{fedorarel}%{?ifalpha:.%alphatag}%{?dist}
Summary: A user-friendly, customizable image viewer
Group: Amusements/Graphics
@@ -31,6 +31,9 @@ Patch2: comix-4.0.4-thumb-imaging_error.patch
# Fix handling of exec path for finding gettext catalog file
# wrt usrmove
Patch3: comix-4.0.4-gettext-usrmove.patch
+# Prevent crash when non-utf8 path name is given to thumbnail file
+# (bug 877604)
+Patch4: comix-4.0.4-pathname2url-utf8.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -61,6 +64,7 @@ uses GTK+ through the PyGTK bindings.
%patch1 -p1 -b .missing
%patch2 -p1 -b .debug1
%patch3 -p1 -b .usrmove
+%patch4 -p1 -b .p2url
%{__mkdir_p} TMPBIN
cd TMPBIN
@@ -171,6 +175,10 @@ exit 0
%changelog
+* Tue Dec 4 2012 Mamoru TASAKA <mtasaka at fedoraproject.org> - 4.0.4-5
+- Prevent crash when non-utf8 path name is given to thumbnail file
+ (bug 877604)
+
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.0.4-4.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
More information about the scm-commits
mailing list