From 1e08db938d54fbe606fd1794fe6662679a54d916 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Wed, 30 Aug 2017 21:04:47 +0300 Subject: [PATCH] added chech that root starts with '/' in zookeeper config file [#CLICKHOUSE-3031] --- dbms/src/Common/ZooKeeper/ZooKeeper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbms/src/Common/ZooKeeper/ZooKeeper.cpp b/dbms/src/Common/ZooKeeper/ZooKeeper.cpp index 591cc6171ba..1154310ef42 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeper.cpp +++ b/dbms/src/Common/ZooKeeper/ZooKeeper.cpp @@ -151,7 +151,12 @@ struct ZooKeeperArgs hosts += host; } - hosts += root; + if (!root.empty()) + { + if (root.front() != '/') + throw KeeperException(std::string("Root path in config file should starts with '/', but got ") + root); + hosts += root; + } } std::string hosts;