[SCM] kamera packaging branch, master, updated. debian/4.8.4-1-3-gd9a5254

Lisandro Damián Nicanor Pérez lisandro at alioth.debian.org
Thu Aug 23 22:24:27 UTC 2012


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-sc/kamera.git;a=commitdiff;h=36e61f1

The following commit has been merged in the master branch:
commit 36e61f154505b4ac781726c817f9cea761be290f
Author: Lisandro Damián Nicanor Pérez Meyer <perezmeyer at gmail.com>
Date:   Thu Aug 23 19:06:58 2012 -0300

    Add patch to solve crashes in cameras with / in their names.
---
 debian/changelog                                   |    3 +-
 debian/patches/quote_unquote_path_components.patch |  124 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 127 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a7ee41a..21d4ce8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 kamera (4:4.8.4-2) UNRELEASED; urgency=low
 
-
+  * Add a patch to avoid crashes in kameras which contain '/' in their names
+    (Closes: #685676).
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Thu, 23 Aug 2012 19:00:57 -0300
 
diff --git a/debian/patches/quote_unquote_path_components.patch b/debian/patches/quote_unquote_path_components.patch
new file mode 100644
index 0000000..a0472da
--- /dev/null
+++ b/debian/patches/quote_unquote_path_components.patch
@@ -0,0 +1,124 @@
+Author: Marcus Meissner <marcus at jet.franken.de>
+Description: quote/unquote path components
+ This helps with cameras with / in their names, avoiding segfaults.
+Author: Marcus Meissner <marcus at jet.franken.de>
+Forwarded: not-needed
+Origin: http://bugsfiles.kde.org/attachment.cgi?id=72002
+
+---
+ kioslave/kamera.cpp |   34 +++++++++++++++++++++-------------
+ 1 files changed, 21 insertions(+), 13 deletions(-)
+
+diff --git a/kioslave/kamera.cpp b/kioslave/kamera.cpp
+index 9596b16..3f9e6e1 100644
+--- a/kioslave/kamera.cpp
++++ b/kioslave/kamera.cpp
+@@ -3,6 +3,7 @@
+     Copyright (C) 2001 The Kompany
+ 		  2001-2003	Ilya Konstantinov <kde-devel at future.shiny.co.il>
+ 		  2001-2008	Marcus Meissner <marcus at jet.franken.de>
++		  2012		Marcus Meissner <marcus at jet.franken.de>
+ 
+     This program is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published by
+@@ -86,6 +87,9 @@ int kdemain(int argc, char **argv)
+ 	return 0;
+ }
+ 
++static QString path_quote(QString path)   { return path.replace("/","%2F").replace(" ","%20"); }
++static QString path_unquote(QString path) { return path.replace("%2F","/").replace("%20"," "); }
++
+ KameraProtocol::KameraProtocol(const QByteArray &pool, const QByteArray &app)
+ : SlaveBase("camera", pool, app),
+ m_camera(NULL)
+@@ -405,19 +409,19 @@ void KameraProtocol::split_url2camerapath(QString url,
+ 	components	= url.split('/', QString::SkipEmptyParts);
+ 	if (components.size() == 0)
+ 		return;
+-	cam		= components.takeFirst();
++	cam		= path_unquote(components.takeFirst());
+ 	if (!cam.isEmpty()) {
+ 		camarr		= cam.split('@');
+-		camera		= camarr.takeFirst();
+-		port		= camarr.takeLast();
++		camera		= path_unquote(camarr.takeFirst());
++		port		= path_unquote(camarr.takeLast());
+ 		setCamera (camera, port);
+ 	}
+ 	if (components.size() == 0)  {
+ 		directory = "/";
+ 		return;
+ 	}
+-	file		= components.takeLast();
+-	directory 	= "/"+components.join("/");
++	file		= path_unquote(components.takeLast());
++	directory 	= path_unquote("/"+components.join("/"));
+ }
+ 
+ // Implements a regular stat() of a file / directory, returning all we know about it
+@@ -440,10 +444,10 @@ void KameraProtocol::statRegular(const KUrl &xurl)
+ 		KIO::UDSEntry entry;
+ 
+ 		QString xname = current_camera + "@" + current_port;
+-		entry.insert( KIO::UDSEntry::UDS_NAME, xname);
++		entry.insert( KIO::UDSEntry::UDS_NAME, path_quote(xname));
+ 		entry.insert( KIO::UDSEntry::UDS_DISPLAY_NAME, current_camera);
+-		entry.insert(KIO::UDSEntry::UDS_FILE_TYPE,S_IFDIR);
+-		entry.insert(KIO::UDSEntry::UDS_ACCESS,(S_IRUSR | S_IRGRP | S_IROTH));
++		entry.insert( KIO::UDSEntry::UDS_FILE_TYPE,S_IFDIR);
++		entry.insert( KIO::UDSEntry::UDS_ACCESS,(S_IRUSR | S_IRGRP | S_IROTH));
+ 		statEntry(entry);
+ 		finished();
+ 		return;
+@@ -645,7 +649,7 @@ void KameraProtocol::listDir(const KUrl &yurl)
+ 			} else {
+ 				xname = (*it)+"@"+m_cfgPath;
+ 			}
+-			entry.insert(KIO::UDSEntry::UDS_NAME,xname);
++			entry.insert(KIO::UDSEntry::UDS_NAME,path_quote(xname));
+ 			// do not confuse regular users with the @usb... 
+ 			entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME,*it);
+ 			listEntry(entry, false);
+@@ -658,7 +662,7 @@ void KameraProtocol::listDir(const KUrl &yurl)
+ 			entry.insert(KIO::UDSEntry::UDS_FILE_TYPE,S_IFDIR);
+ 			// do not confuse regular users with the @usb... 
+ 			entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME,portsit.value());
+-			entry.insert(KIO::UDSEntry::UDS_NAME, portsit.value()+"@"+portsit.key());
++			entry.insert(KIO::UDSEntry::UDS_NAME, path_quote(portsit.value()+"@"+portsit.key()));
+ 
+ 			entry.insert(KIO::UDSEntry::UDS_ACCESS,(S_IRUSR | S_IRGRP | S_IROTH |S_IWUSR | S_IWGRP | S_IWOTH));
+ 			listEntry(entry, false);
+@@ -864,7 +868,9 @@ void KameraProtocol::translateTextToUDS(KIO::UDSEntry &udsEntry, const QString &
+ 
+ 	udsEntry.insert(KIO::UDSEntry::UDS_FILE_TYPE,S_IFREG);
+ 
+-	udsEntry.insert(KIO::UDSEntry::UDS_NAME,fn);
++	udsEntry.insert(KIO::UDSEntry::UDS_NAME,path_quote(fn));
++
++	udsEntry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME,fn);
+ 
+ 	udsEntry.insert(KIO::UDSEntry::UDS_SIZE,strlen(text));
+ 
+@@ -878,7 +884,8 @@ void KameraProtocol::translateFileToUDS(KIO::UDSEntry &udsEntry, const CameraFil
+ 	udsEntry.clear();
+ 
+ 	udsEntry.insert(KIO::UDSEntry::UDS_FILE_TYPE,S_IFREG);
+-	udsEntry.insert(KIO::UDSEntry::UDS_NAME,name);
++	udsEntry.insert(KIO::UDSEntry::UDS_NAME,path_quote(name));
++	udsEntry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME,name);
+ 
+ 	if (info.file.fields & GP_FILE_INFO_SIZE) {
+ 		udsEntry.insert(KIO::UDSEntry::UDS_SIZE,info.file.size);
+@@ -909,7 +916,8 @@ void KameraProtocol::translateDirectoryToUDS(KIO::UDSEntry &udsEntry, const QStr
+ 	udsEntry.clear();
+ 
+ 	udsEntry.insert(KIO::UDSEntry::UDS_FILE_TYPE,S_IFDIR);
+-	udsEntry.insert(KIO::UDSEntry::UDS_NAME,dirname);
++	udsEntry.insert(KIO::UDSEntry::UDS_NAME,path_quote(dirname));
++	udsEntry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, dirname);
+ 	udsEntry.insert(KIO::UDSEntry::UDS_ACCESS,S_IRUSR | S_IRGRP | S_IROTH |S_IWUSR | S_IWGRP | S_IWOTH | S_IXUSR | S_IXOTH | S_IXGRP);
+         udsEntry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QString("inode/directory"));
+ }
+-- 
+1.7.3.4
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2a9f130
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+quote_unquote_path_components.patch

-- 
kamera packaging



More information about the pkg-kde-commits mailing list