Merge pull request #1109 from johneiser/dev-SafeCheckFix
Fix python safe-check from spawning zombie processfix-for-1142
commit
2c41d660b5
|
@ -53,10 +53,9 @@ def get_sysinfo(nonce='00000000'):
|
|||
|
||||
language = 'python'
|
||||
cmd = 'ps %s' % (os.getpid())
|
||||
ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
out = ps.stdout.read()
|
||||
ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = ps.communicate()
|
||||
parts = out.split("\n")
|
||||
ps.stdout.close()
|
||||
if len(parts) > 2:
|
||||
processName = " ".join(parts[1].split()[4:])
|
||||
else:
|
||||
|
|
|
@ -298,9 +298,8 @@ class Listener:
|
|||
if safeChecks.lower() == 'true':
|
||||
launcherBase += "import re, subprocess;"
|
||||
launcherBase += "cmd = \"ps -ef | grep Little\ Snitch | grep -v grep\"\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)\n"
|
||||
launcherBase += "out = ps.stdout.read()\n"
|
||||
launcherBase += "ps.stdout.close()\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n"
|
||||
launcherBase += "out, err = ps.communicate()\n"
|
||||
launcherBase += "if re.search(\"Little Snitch\", out):\n"
|
||||
launcherBase += " sys.exit()\n"
|
||||
except Exception as e:
|
||||
|
|
|
@ -447,9 +447,8 @@ class Listener:
|
|||
if safeChecks.lower() == 'true':
|
||||
launcherBase += "import re, subprocess;"
|
||||
launcherBase += "cmd = \"ps -ef | grep Little\ Snitch | grep -v grep\"\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)\n"
|
||||
launcherBase += "out = ps.stdout.read()\n"
|
||||
launcherBase += "ps.stdout.close()\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n"
|
||||
launcherBase += "out, err = ps.communicate()\n"
|
||||
launcherBase += "if re.search(\"Little Snitch\", out):\n"
|
||||
launcherBase += " sys.exit()\n"
|
||||
except Exception as e:
|
||||
|
|
|
@ -279,9 +279,8 @@ class Listener:
|
|||
if safeChecks.lower() == 'true':
|
||||
launcherBase += "import re, subprocess;"
|
||||
launcherBase += "cmd = \"ps -ef | grep Little\ Snitch | grep -v grep\"\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)\n"
|
||||
launcherBase += "out = ps.stdout.read()\n"
|
||||
launcherBase += "ps.stdout.close()\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n"
|
||||
launcherBase += "out, err = ps.communicate()\n"
|
||||
launcherBase += "if re.search(\"Little Snitch\", out):\n"
|
||||
launcherBase += " sys.exit()\n"
|
||||
except Exception as e:
|
||||
|
|
|
@ -249,9 +249,8 @@ class Listener:
|
|||
if safeChecks.lower() == 'true':
|
||||
launcherBase += "import re, subprocess;"
|
||||
launcherBase += "cmd = \"ps -ef | grep Little\ Snitch | grep -v grep\"\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)\n"
|
||||
launcherBase += "out = ps.stdout.read()\n"
|
||||
launcherBase += "ps.stdout.close()\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n"
|
||||
launcherBase += "out, err = ps.communicate()\n"
|
||||
launcherBase += "if re.search(\"Little Snitch\", out):\n"
|
||||
launcherBase += " sys.exit()\n"
|
||||
except Exception as e:
|
||||
|
|
|
@ -253,9 +253,8 @@ class Listener:
|
|||
if safeChecks.lower() == 'true':
|
||||
launcherBase += "import re, subprocess;"
|
||||
launcherBase += "cmd = \"ps -ef | grep Little\ Snitch | grep -v grep\"\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)\n"
|
||||
launcherBase += "out = ps.stdout.read()\n"
|
||||
launcherBase += "ps.stdout.close()\n"
|
||||
launcherBase += "ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n"
|
||||
launcherBase += "out, err = ps.communicate()\n"
|
||||
launcherBase += "if re.search(\"Little Snitch\", out):\n"
|
||||
launcherBase += " sys.exit()\n"
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in New Issue