summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2021-07-09 10:03:37 +0200
committernicolargo <nicolas@nicolargo.com>2021-07-09 10:03:37 +0200
commit9d6051be4a42f692392049fdbfc85d5dfa458b32 (patch)
treedf10f3f97d338619f229fbbf9feca55da97d8a12
parent5daa2a8282add9bbc397d95cd4e5dcdf5fad85b8 (diff)
Security audit - B411 #1025
-rw-r--r--README.rst6
-rw-r--r--glances/compat.py8
-rw-r--r--optional-requirements.txt2
-rw-r--r--requirements.txt1
-rwxr-xr-xsetup.py7
5 files changed, 21 insertions, 3 deletions
diff --git a/README.rst b/README.rst
index 90cc80f3..78ef7a87 100644
--- a/README.rst
+++ b/README.rst
@@ -59,6 +59,8 @@ Requirements
- ``python>=2.7`` or ``python>=3.4``
- ``psutil>=5.3.0`` (better with latest version)
+- ``defusedxml`` (in order to monkey path xmlrpc)
+- ``future`` (for Python 2 support)
*Note for Python 2.6 users*
@@ -66,6 +68,10 @@ Glances no longer supports Python 2.6. Please upgrade
to a minimum Python version of 2.7/3.4+ or downgrade to Glances 2.6.2 (last version
with Python 2.6 support).
+*Deprecation warning note for Python 2.x users*
+
+Glances version 4.0 will no longer supports Python 2.x.
+
Optional dependencies:
- ``bernhard`` (for the Riemann export module)
diff --git a/glances/compat.py b/glances/compat.py
index a0d14d89..86d72860 100644
--- a/glances/compat.py
+++ b/glances/compat.py
@@ -44,6 +44,10 @@ if PY3:
from urllib.error import HTTPError, URLError
from urllib.parse import urlparse
+ # Correct issue #1025 by monkey path the xmlrpc lib
+ from defusedxml.xmlrpc import monkey_patch
+ monkey_patch()
+
input = input
range = range
map = map
@@ -132,6 +136,10 @@ else:
from urllib2 import urlopen, HTTPError, URLError
from urlparse import urlparse
+ # Correct issue #1025 by monkey path the xmlrpc lib
+ from defusedxml.xmlrpc import monkey_patch
+ monkey_patch()
+
input = raw_input
range = xrange
ConfigParser.read_file = ConfigParser.readfp
diff --git a/optional-requirements.txt b/optional-requirements.txt
index dab6ba49..69a91a45 100644
--- a/optional-requirements.txt
+++ b/optional-requirements.txt
@@ -10,7 +10,7 @@ docker>=2.0.0
elasticsearch
graphitesender
hddtemp
-influxdb
+influxdb>=1.0.0
influxdb-client; python_version >= "3.6"
kafka-python
netifaces
diff --git a/requirements.txt b/requirements.txt
index 71439c7c..db8f5c38 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
psutil>=5.3.0
+defusedxml
future
diff --git a/setup.py b/setup.py
index 98fcf6d9..0e80732a 100755
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ def get_data_files():
def get_install_requires():
- requires = ['psutil>=5.3.0', 'future']
+ requires = ['psutil>=5.3.0', 'defusedxml', 'future']
if sys.platform.startswith('win'):
requires.append('bottle')
requires.append('requests')
@@ -60,7 +60,6 @@ def get_install_extras_require():
'paho-mqtt', 'potsdb', 'prometheus_client', 'pyzmq',
'statsd'],
'folders': ['scandir'], # python_version<"3.5"
- 'gpu': ['py3nvml'],
'graph': ['pygal'],
'ip': ['netifaces'],
'raid': ['pymdstat'],
@@ -70,6 +69,10 @@ def get_install_extras_require():
'web': ['bottle', 'requests'],
'wifi': ['wifi']
}
+ if PY3:
+ extras_require['export'].append('influxdb-client')
+ extras_require['gpu'] = ['py3nvml']
+
# Add automatically the 'all' target
extras_require.update({'all': [i[0] for i in extras_require.values()]})