From: Jason Dillaman Date: Thu, 29 Jun 2017 18:54:40 +0000 (-0400) Subject: rbd: do not attempt to load key if auth is disabled X-Git-Tag: v11.2.1~4^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cf06edd36b176a10e6ce3d62eb957bfdb0146703;p=ceph.git rbd: do not attempt to load key if auth is disabled Fixes: http://tracker.ceph.com/issues/19035 Signed-off-by: Jason Dillaman (cherry picked from commit 8b9c8df6d7f0b75c5451953bb322bc1f9afb6299) --- diff --git a/src/krbd.cc b/src/krbd.cc index d1cdf5529779e..b6389712bb2a4 100644 --- a/src/krbd.cc +++ b/src/krbd.cc @@ -131,13 +131,15 @@ static int build_map_buf(CephContext *cct, const char *pool, const char *image, oss << " name=" << cct->_conf->name.get_id(); KeyRing keyring; - r = keyring.from_ceph_context(cct); - if (r == -ENOENT && !(cct->_conf->keyfile.length() || - cct->_conf->key.length())) - r = 0; - if (r < 0) { - cerr << "rbd: failed to get secret" << std::endl; - return r; + if (cct->_conf->auth_client_required != "none") { + r = keyring.from_ceph_context(cct); + if (r == -ENOENT && !(cct->_conf->keyfile.length() || + cct->_conf->key.length())) + r = 0; + if (r < 0) { + cerr << "rbd: failed to get secret" << std::endl; + return r; + } } CryptoKey secret;