summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-01-20 12:47:35 +0100
committerAlvaro Neira Ayuso <aneira@soleta.eu>2020-01-21 17:32:48 +0100
commit9890d60300d4e2d2cd6d4a87de81471f943e975c (patch)
tree24aae4600b60fc0fcbe5aa1aecc778904ff18d1e /src
parent96c2ddea2d407845441cd740c8330f15fc75b7a0 (diff)
Fix /shell/run commands splitting
This patch splits shell commands either with ';' or '\n'.
Diffstat (limited to 'src')
-rw-r--r--src/linux/ogOperations.py2
-rw-r--r--src/ogRest.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index 505894b..357dd2f 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -49,7 +49,7 @@ def reboot():
def execCMD(request, ogRest):
cmd = request.getrun()
- cmds = cmd.split(" ")
+ cmds = cmd.split(";|\n")
try:
ogRest.proc = subprocess.Popen(cmds, stdout=subprocess.PIPE, shell=True)
(output, error) = ogRest.proc.communicate()
diff --git a/src/ogRest.py b/src/ogRest.py
index 781fb80..f46a331 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -62,7 +62,7 @@ class restResponse():
class ogThread():
def execcmd(client, request, ogRest):
- if request.getrun() == None:
+ if not request.getrun():
response = restResponse(ogResponses.BAD_REQUEST)
client.send(response.get())
return