diff --git a/gedit-2.22.3-fix-python-path.patch b/gedit-2.22.3-fix-python-path.patch new file mode 100644 index 0000000..5de1a2a --- /dev/null +++ b/gedit-2.22.3-fix-python-path.patch @@ -0,0 +1,13 @@ +diff -up gedit-2.25.5/plugin-loaders/python/gedit-plugin-loader-python.c.fix-python-path gedit-2.25.5/plugin-loaders/python/gedit-plugin-loader-python.c +--- gedit-2.24.3/gedit/gedit-python-module.c.fix-python-path 2009-01-26 12:36:50.289751027 -0500 ++++ gedit-2.24.3/gedit/gedit-python-module.c 2009-01-26 12:39:23.668963430 -0500 +@@ -541,6 +541,9 @@ gedit_python_init (GeditPluginLoaderPyth + + PySys_SetArgv (1, argv); + ++ /* Sanitize sys.path, see http://bugzilla.gnome.org/show_bug.cgi?id=569214 */ ++ PyRun_SimpleString ("import sys; sys.path = filter(None, sys.path)"); ++ + if (!gedit_check_pygtk2 ()) + { + /* Warning message already printed in check_pygtk2 */ diff --git a/gedit.spec b/gedit.spec index 6d3c352..22fc7af 100644 --- a/gedit.spec +++ b/gedit.spec @@ -18,7 +18,7 @@ Summary: gEdit is a small but powerful text editor for GNOME Name: gedit Version: 2.22.3 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: GPLv2+ and GFDL Group: Applications/Editors @@ -46,6 +46,9 @@ Patch1: gedit-2.13.90-libdir.patch # and I needed this patch to make autoconf happy Patch2: gedit-2.15.1-python.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=569214 +Patch3: gedit-2.22.3-fix-python-path.patch + BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: pango-devel >= %{pango_version} BuildRequires: gtk2-devel >= %{gtk2_version} @@ -107,6 +110,7 @@ Install gedit-devel if you want to write plug-ins for gEdit. %endif %patch2 -p1 -b .python +%patch3 -p1 -b .fix-python-path %build autoreconf @@ -193,6 +197,10 @@ fi %changelog +* Mon Jan 26 2009 Ray Strode - 1:2.22.3-2 +- Fix up python plugin path to close up a security attack + vectors (bug 481556). + * Wed May 28 2008 Matthias Clasen - 1:2.22.3-1 - Update to 2.22.3