r43500 - in /packages/unstable/alacarte/debian: changelog patches/40-itemeditor-command-validation.patch patches/series
althaser-guest at users.alioth.debian.org
althaser-guest at users.alioth.debian.org
Sun Oct 12 19:04:24 UTC 2014
Author: althaser-guest
Date: Sun Oct 12 19:04:24 2014
New Revision: 43500
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=43500
Log:
* Add debian/patches/40-itemeditor-command-validation.patch
- Fix bad command validation (Closes: #736166, #752671) thanks
to OmegaPhil
Added:
packages/unstable/alacarte/debian/patches/40-itemeditor-command-validation.patch
Modified:
packages/unstable/alacarte/debian/changelog
packages/unstable/alacarte/debian/patches/series
Modified: packages/unstable/alacarte/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/alacarte/debian/changelog?rev=43500&op=diff
==============================================================================
--- packages/unstable/alacarte/debian/changelog [utf-8] (original)
+++ packages/unstable/alacarte/debian/changelog [utf-8] Sun Oct 12 19:04:24 2014
@@ -1,3 +1,11 @@
+alacarte (3.11.91-2) UNRELEASED; urgency=medium
+
+ * Add debian/patches/40-itemeditor-command-validation.patch
+ - Fix bad command validation (Closes: #736166, #752671) thanks
+ to OmegaPhil
+
+ -- Pedro Beja <althaser at gmail.com> Sat, 11 Oct 2014 18:02:32 +0100
+
alacarte (3.11.91-1) unstable; urgency=medium
* Team upload.
Added: packages/unstable/alacarte/debian/patches/40-itemeditor-command-validation.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/alacarte/debian/patches/40-itemeditor-command-validation.patch?rev=43500&op=file
==============================================================================
--- packages/unstable/alacarte/debian/patches/40-itemeditor-command-validation.patch (added)
+++ packages/unstable/alacarte/debian/patches/40-itemeditor-command-validation.patch [utf-8] Sun Oct 12 19:04:24 2014
@@ -0,0 +1,30 @@
+diff --git a/Alacarte/ItemEditor.py b/Alacarte/ItemEditor.py
+index 3b48324..e89c0ff 100644
+--- a/Alacarte/ItemEditor.py
++++ b/Alacarte/ItemEditor.py
+@@ -179,10 +179,24 @@ class LauncherEditor(ItemEditor):
+ self.builder.get_object('name-entry').connect('changed', self.resync_validity)
+ self.builder.get_object('exec-entry').connect('changed', self.resync_validity)
+
++ def exec_line_is_valid(self, exec_text):
++ try:
++ # Attempting to parse command - commands are not simply program names or paths... Errors are raised for blank or invalid input (e.g. missing closing quote)
++ result = GLib.shell_parse_argv(exec_text)
++ if result[0]:
++ # Parsing succeeded - making sure program (first part of the command) is in the path
++ command = result[1][0]
++ return (GLib.find_program_in_path(command) is not None)
++ else:
++ # Parsing failure, but not reported via raised GError?
++ return False
++ except GLib.GError:
++ return False
++
+ def resync_validity(self, *args):
+ name_text = self.builder.get_object('name-entry').get_text()
+ exec_text = self.builder.get_object('exec-entry').get_text()
+- valid = (name_text != "" and GLib.find_program_in_path(exec_text) is not None)
++ valid = (name_text != "" and self.exec_line_is_valid(exec_text))
+ self.builder.get_object('ok').set_sensitive(valid)
+
+ def load(self):
Modified: packages/unstable/alacarte/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/alacarte/debian/patches/series?rev=43500&op=diff
==============================================================================
--- packages/unstable/alacarte/debian/patches/series [utf-8] (original)
+++ packages/unstable/alacarte/debian/patches/series [utf-8] Sun Oct 12 19:04:24 2014
@@ -1,2 +1,3 @@
03-bind_textdomain_codeset.patch
30-python_private_dir.patch
+40-itemeditor-command-validation.patch
More information about the pkg-gnome-commits
mailing list