From ee5db5b67fad20b112e7d29f6e2f66dbdf969bed Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Wed, 11 Sep 2019 20:58:39 -0700 Subject: [PATCH] Raise error if space in redis password (#5673) --- doc/source/configure.rst | 3 +++ python/ray/services.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/doc/source/configure.rst b/doc/source/configure.rst index a5c4b4c41..2c8bac625 100644 --- a/doc/source/configure.rst +++ b/doc/source/configure.rst @@ -116,6 +116,9 @@ behind a firewall, this feature is useful for instances exposed to the internet where configuring a firewall is not possible. Because Redis is very fast at serving queries, the chosen password should be long. + +.. note:: The Redis passwords provided below may not contain spaces. + Redis authentication is only supported on the raylet code path. To add authentication via the Python API, start Ray using: diff --git a/python/ray/services.py b/python/ray/services.py index 5b806f8dc..e4247d7f2 100644 --- a/python/ray/services.py +++ b/python/ray/services.py @@ -772,6 +772,8 @@ def _start_redis_instance(executable, # Construct the command to start the Redis server. command = [executable] if password: + if " " in password: + raise ValueError("Spaces not permitted in redis password.") command += ["--requirepass", password] command += ( ["--port", str(port), "--loglevel", "warning"] + load_module_args)