From: Lucian Petrut Date: Fri, 8 May 2020 09:08:43 +0000 (+0000) Subject: common: accept config files containing whitespaces X-Git-Tag: v16.1.0~652^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee7cfe916f9859eeb09189e124013bf2789cd44a;p=ceph.git common: accept config files containing whitespaces At the moment, the ceph config file location cannot contain whitespaces. This applies to all platforms but is quite an inconvenient on Windows in particular, where it's very common to have default paths containing white spaces. ceph_resolve_file_search expects a list of config files and uses "get_str_list" to separate them. No delimiter list is explicitly specified, so the default delimiter list is used, which includes white space. This change will explicitly set the delimiters to "," and ";". Signed-off-by: Lucian Petrut --- diff --git a/src/common/config.cc b/src/common/config.cc index 129cb344dac..1f61395283e 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -60,9 +60,9 @@ using ceph::decode; using ceph::encode; using ceph::Formatter; -static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config, /etc/ceph/$cluster.conf, $home/.ceph/$cluster.conf, $cluster.conf" +static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config,/etc/ceph/$cluster.conf,$home/.ceph/$cluster.conf,$cluster.conf" #if defined(__FreeBSD__) - ", /usr/local/etc/ceph/$cluster.conf" + ",/usr/local/etc/ceph/$cluster.conf" #endif ; @@ -87,7 +87,7 @@ int ceph_resolve_file_search(const std::string& filename_list, std::string& result) { list ls; - get_str_list(filename_list, ls); + get_str_list(filename_list, ";,", ls); int ret = -ENOENT; list::iterator iter; @@ -440,7 +440,7 @@ md_config_t::get_conffile_paths(const ConfigValues& values, } std::list paths; - get_str_list(conf_files_str, paths); + get_str_list(conf_files_str, ";,", paths); for (auto i = paths.begin(); i != paths.end(); ) { string& path = *i; if (path.find("$data_dir") != path.npos &&