mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Prevent PyXML from importing, causing crashes
http://seclists.org/nmap-dev/2014/q2/318 Essentially, we import the xml name, then override its search path, stripping out the _xmlplus paths that PyXML uses. This leaves only the Python 2 standard library path, which is what Zenmap was written for.
This commit is contained in:
@@ -18,6 +18,11 @@ import difflib
|
|||||||
import getopt
|
import getopt
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
import xml.sax.saxutils
|
import xml.sax.saxutils
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
|
|||||||
@@ -5,6 +5,11 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
import StringIO
|
import StringIO
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,11 @@
|
|||||||
# * *
|
# * *
|
||||||
# ***************************************************************************/
|
# ***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
import xml.sax.saxutils
|
import xml.sax.saxutils
|
||||||
from xml.sax.xmlreader import AttributesImpl as Attributes
|
from xml.sax.xmlreader import AttributesImpl as Attributes
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
|
|
||||||
directory = None
|
directory = None
|
||||||
|
|||||||
@@ -125,6 +125,10 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
|
|
||||||
from zenmapCore.Name import APP_NAME
|
from zenmapCore.Name import APP_NAME
|
||||||
|
|||||||
@@ -128,6 +128,10 @@ import socket
|
|||||||
import StringIO
|
import StringIO
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
from types import StringTypes
|
from types import StringTypes
|
||||||
from xml.sax import make_parser
|
from xml.sax import make_parser
|
||||||
from xml.sax import SAXException
|
from xml.sax import SAXException
|
||||||
|
|||||||
@@ -139,6 +139,11 @@ from zenmapCore.Version import VERSION
|
|||||||
from zenmapCore.Paths import Path
|
from zenmapCore.Paths import Path
|
||||||
import zenmapCore.I18N
|
import zenmapCore.I18N
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
# For escaping text in marked-up labels.
|
# For escaping text in marked-up labels.
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ from zenmapGUI.higwidgets.higboxes import HIGVBox
|
|||||||
from zenmapCore.Name import APP_DISPLAY_NAME, NMAP_DISPLAY_NAME, NMAP_WEB_SITE
|
from zenmapCore.Name import APP_DISPLAY_NAME, NMAP_DISPLAY_NAME, NMAP_WEB_SITE
|
||||||
import zenmapCore.I18N
|
import zenmapCore.I18N
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
# For escaping text in marked-up labels.
|
# For escaping text in marked-up labels.
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,11 @@ from zenmapCore.Name import APP_DISPLAY_NAME
|
|||||||
from zenmapCore.Version import VERSION
|
from zenmapCore.Version import VERSION
|
||||||
import zenmapCore.I18N
|
import zenmapCore.I18N
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
# For escaping text in marked-up labels.
|
# For escaping text in marked-up labels.
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,11 @@ import pango
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
|
|
||||||
from zenmapGUI.higwidgets.higdialogs import HIGAlertDialog, HIGDialog
|
from zenmapGUI.higwidgets.higdialogs import HIGAlertDialog, HIGDialog
|
||||||
|
|||||||
@@ -125,6 +125,11 @@ import gtk
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from os.path import split, isfile, join, abspath, exists
|
from os.path import split, isfile, join, abspath, exists
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax.saxutils
|
import xml.sax.saxutils
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
|
|||||||
@@ -123,6 +123,11 @@
|
|||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
|
||||||
from zenmapGUI.higwidgets.higboxes import HIGHBox
|
from zenmapGUI.higwidgets.higboxes import HIGHBox
|
||||||
|
|||||||
@@ -125,6 +125,11 @@ import gtk
|
|||||||
import gobject
|
import gobject
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
|
|
||||||
from zenmapGUI.higwidgets.hignotebooks import HIGNotebook, HIGAnimatedTabLabel
|
from zenmapGUI.higwidgets.hignotebooks import HIGNotebook, HIGAnimatedTabLabel
|
||||||
|
|||||||
@@ -125,6 +125,11 @@ import gobject
|
|||||||
import gtk
|
import gtk
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
# Prevent loading PyXML
|
||||||
|
import xml
|
||||||
|
xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x]
|
||||||
|
|
||||||
import xml.sax
|
import xml.sax
|
||||||
|
|
||||||
from zenmapGUI.higwidgets.higwindows import HIGWindow
|
from zenmapGUI.higwidgets.higwindows import HIGWindow
|
||||||
|
|||||||
Reference in New Issue
Block a user