Skip to content
Permalink
Browse files

plugins: Use subprocess.check_output() with a sequence of program arg…

…uments

All subprocess.get*output() should be replaced with either
subprocess.Popen or subprocess.check_output now.

String args were converted to sequences of program arguments.
  • Loading branch information...
bachradsusi committed Jun 21, 2016
1 parent dda55aa commit eaccf4c0d20a27d3df5ff6de8c9dcc80f6f40718
Showing with 7 additions and 7 deletions.
  1. +4 −4 plugins/src/allow_execstack.py
  2. +3 −3 plugins/src/findexecstack
@@ -23,19 +23,19 @@
from setroubleshoot.util import *
from setroubleshoot.Plugin import Plugin

import commands
import subprocess
import sys

def is_execstack(path):
if path[0] != "/":
return False

x = commands.getoutput("execstack -q %s" % path).split()
return ( x[0] == "X" )
x = subprocess.check_output(["execstack", "-q", path], universal_newlines=True).split()
return ( x[0] == "X" )

def find_execstack(exe, pid):
execstacklist = []
for path in commands.getoutput("ldd %s" % exe).split():
for path in subprocess.check_output(["ldd", exe], universal_newlines=True).split():
if is_execstack(path) and path not in execstacklist:
execstacklist.append(path)
try:
@@ -1,17 +1,17 @@
#! /usr/bin/python
import commands
import subprocess
import sys

def is_execstack(path):
if path[0] != "/":
return False

x = commands.getoutput("execstack -q %s" % path).split()
x = subprocess.check_output(["execstack", "-q", path], universal_newlines=True).split()
return ( x[0] == "X" )

def find_execstack(exe, pid):
execstacklist = []
for path in commands.getoutput("ldd %s" % sys.argv[1]).split():
for path in subprocess.check_output(["ldd", sys.argv[1]], universal_newlines=True).split():
if is_execstack(path) and path not in execstacklist:
execstacklist.append(path)
try:

0 comments on commit eaccf4c

Please sign in to comment.
You can’t perform that action at this time.