Skip to content

Commit

Permalink
Fix sec issues
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Oct 11, 2022
1 parent ce2d45e commit 789b9b1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions IM/connectors/OpenNebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import defusedxml.xmlrpc
defusedxml.xmlrpc.monkey_patch()
from defusedxml import xmlrpc
xmlrpc.monkey_patch()

try:
from xmlrpclib import ServerProxy # nosec
Expand Down
3 changes: 2 additions & 1 deletion im_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ def im_stop():
def get_childs(parent_id=None):
if parent_id is None:
parent_id = os.getpid()
ps_command = subprocess.Popen("ps -o pid --ppid %d --noheaders" % parent_id, shell=True, stdout=subprocess.PIPE)
ps_command = subprocess.Popen(["ps", "-o", "pid", "--ppid", str(parent_id), "--noheaders"],
stdout=subprocess.PIPE)
ps_command.wait()
ps_output = str(ps_command.stdout.read())
childs = ps_output.strip().split("\n")[:-1]
Expand Down
3 changes: 3 additions & 0 deletions test/integration/QuickTestIM.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import sys
import os

from defusedxml import xmlrpc
xmlrpc.monkey_patch()

sys.path.append("..")
sys.path.append(".")

Expand Down
3 changes: 3 additions & 0 deletions test/integration/TestIM.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import sys
import os

from defusedxml import xmlrpc
xmlrpc.monkey_patch()

sys.path.append("..")
sys.path.append(".")

Expand Down
3 changes: 3 additions & 0 deletions test/loadtest/LoadTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
except ImportError:
from xmlrpc.client import ServerProxy

from defusedxml import xmlrpc
xmlrpc.monkey_patch()

sys.path.append("..")
sys.path.append(".")

Expand Down
3 changes: 3 additions & 0 deletions test/loadtest/LoadTestR.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
except ImportError:
from xmlrpc.client import ServerProxy

from defusedxml import xmlrpc
xmlrpc.monkey_patch()

sys.path.append("..")
sys.path.append(".")

Expand Down

0 comments on commit 789b9b1

Please sign in to comment.