Skip to content

Commit

Permalink
config: replace '~' by '$home' in CEPH_CONF_FILE_DEFAULT
Browse files Browse the repository at this point in the history
And expand "$home" to get the actual path to ceph.conf.

Fixes: http://tracker.ceph.com/issues/23215
Signed-off-by: Rishabh Dave <ridave@redhat.com>
  • Loading branch information
rishabh-d-dave committed Mar 13, 2018
1 parent 6432786 commit 697959c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/config.cc
Expand Up @@ -42,7 +42,7 @@ using std::ostringstream;
using std::pair;
using std::string;

static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config, /etc/ceph/$cluster.conf, ~/.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"
#endif
Expand Down Expand Up @@ -1156,6 +1156,8 @@ Option::value_t md_config_t::_expand_meta(
out += stringify(getpid());
} else if (var == "cctid") {
out += stringify((unsigned long long)this);
} else if (var == "home") {
out = string(getenv("HOME"));
} else {
if (var == "data_dir") {
var = data_dir_option;
Expand Down

0 comments on commit 697959c

Please sign in to comment.