[nautilus-python] Bug #569272. Sanitize the python sys.path



commit 412505c23ae90ae98ed00611d4004982724abb2c
Author: Mark Lee <marklee svn gnome org>
Date:   Mon Jan 11 16:23:11 2010 -0500

    Bug #569272. Sanitize the python sys.path

 src/nautilus-python.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index 1475eca..b5d7fe2 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -223,6 +223,13 @@ nautilus_python_init_python (void)
 		PyErr_Print();
 		return FALSE;
 	}
+	
+	/* Sanitize sys.path */
+	PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
+	if (PyErr_Occurred()) {
+		PyErr_Print();
+		return FALSE;
+	}
 
 	/* pygtk.require("2.0") */
 	debug("pygtk.require(\"2.0\")");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]