aboutsummaryrefslogtreecommitdiff
path: root/session.py
diff options
context:
space:
mode:
authorDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2020-07-23 13:52:37 +0200
committerDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2020-07-24 15:37:02 +0200
commit10e98e827e71c7a415e46b633381d56dbb1cc97c (patch)
tree7be8aebb3bf777be35e4a7a402840327852a97bb /session.py
parent81e570931adc37054460e3f05d0325888050e386 (diff)
downloadRWA.Support.SessionService-10e98e827e71c7a415e46b633381d56dbb1cc97c.tar.gz
RWA.Support.SessionService-10e98e827e71c7a415e46b633381d56dbb1cc97c.tar.bz2
RWA.Support.SessionService-10e98e827e71c7a415e46b633381d56dbb1cc97c.zip
Prevent crashing when asking for status with invalid pid & mockup-mode: make sessionid's positive
Diffstat (limited to 'session.py')
-rw-r--r--session.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/session.py b/session.py
index 40a091f..2f3accb 100644
--- a/session.py
+++ b/session.py
@@ -86,10 +86,8 @@ class Session:
self.ws_port = port_for.select_random()
self.vnc_port = port_for.select_random()
- # Use negative values to ensure we don't do something harmful
- # to random processes
- self.ws_pid = int("-" + random_digits(5))
- self.vnc_pid = int("-" + random_digits(5))
+ self.ws_pid = int(random_digits(5))
+ self.vnc_pid = int(random_digits(5))
# Create a temporary file to indicate that this process is still 'Running'
filename = f"/tmp/rwa/{str(self.ws_port) + str(self.vnc_port) + str(self.ws_pid) + str(self.vnc_pid)}.lock"