Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
Permalink
Browse files Browse the repository at this point in the history
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 eaccf4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions plugins/src/allow_execstack.py
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions plugins/src/findexecstack
@@ -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:
Expand Down

0 comments on commit eaccf4c

Please sign in to comment.