Skip to content
This repository was archived by the owner on Aug 26, 2019. It is now read-only.

Commit 554e095

Browse files
author
irmen
committed
changed pidfile location because of security vulnerability, debian bug #631912
1 parent 1df908f commit 554e095

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Pyro/ext/daemonizer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class Daemonizer:
4747
"""
4848
def __init__(self, pidfile=None):
4949
if not pidfile:
50-
self.pidfile = "/tmp/%s.pid" % self.__class__.__name__.lower()
50+
# PID file moved out of /tmp to avoid security vulnerability
51+
# changed by Debian maintainer per Debian bug #631912
52+
self.pidfile = "/var/run/pyro-%s.pid" % self.__class__.__name__.lower()
5153
else:
5254
self.pidfile = pidfile
5355

@@ -121,12 +123,16 @@ def main_loop(self):
121123

122124
def process_command_line(self, argv, verbose=1):
123125
usage = "usage: %s start | stop | restart | status | debug " \
126+
"[--pidfile=...] " \
124127
"(run as non-daemon)" % os.path.basename(argv[0])
125128
if len(argv) < 2:
126129
print usage
127130
raise SystemExit
128131
else:
129132
operation = argv[1]
133+
if len(argv) > 2 and argv[2].startswith('--pidfile=') and \
134+
len(argv[2]) > len('--pidfile='):
135+
self.pidfile = argv[2][len('--pidfile='):]
130136
pid = self.get_pid()
131137
if operation == 'status':
132138
if self.is_process_running():

0 commit comments

Comments
 (0)