Skip to content

Commit 65d652e

Browse files
committed
Disallow forward slash in process name. Closes #496
1 parent edb5341 commit 65d652e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
- Fixed a bug where ``supervisorctl fg`` would swallow most XML-RPC faults.
3838
``fg`` now prints the fault and exits.
3939

40+
- Parsing the config file will now fail with an error message if a process
41+
or group name contains a forward slash character (``/``) since it would
42+
break the URLs used by the web interface.
43+
4044
3.3.1 (2016-08-02)
4145
------------------
4246

supervisor/datatypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
def process_or_group_name(name):
1414
"""Ensures that a process or group name is not created with
15-
characters that break the eventlistener protocol"""
15+
characters that break the eventlistener protocol or web UI URLs"""
1616
s = str(name).strip()
17-
if ' ' in s or ':' in s:
17+
if ' ' in s or ':' in s or '/' in s:
1818
raise ValueError("Invalid name: " + repr(name))
1919
return s
2020

supervisor/tests/test_datatypes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ def test_strips_surrounding_whitespace(self):
1919
name = " foo\t"
2020
self.assertEqual(self._callFUT(name), "foo")
2121

22-
def test_disallows_inner_spaces(self):
22+
def test_disallows_inner_spaces_for_eventlister_protocol(self):
2323
name = "foo bar"
2424
self.assertRaises(ValueError, self._callFUT, name)
2525

26-
def test_disallows_colons(self):
26+
def test_disallows_colons_for_eventlistener_protocol(self):
2727
name = "foo:bar"
2828
self.assertRaises(ValueError, self._callFUT, name)
2929

30+
def test_disallows_slashes_for_web_ui_urls(self):
31+
name = "foo/bar"
32+
self.assertRaises(ValueError, self._callFUT, name)
33+
3034
class IntegerTests(unittest.TestCase):
3135
def _callFUT(self, arg):
3236
return datatypes.integer(arg)

0 commit comments

Comments
 (0)