]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: do not attempt to load key if auth is disabled 16298/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 29 Jun 2017 18:54:40 +0000 (14:54 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 12 Jul 2017 18:50:04 +0000 (20:50 +0200)
Fixes: http://tracker.ceph.com/issues/19035
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8b9c8df6d7f0b75c5451953bb322bc1f9afb6299)

src/krbd.cc

index d1cdf5529779e2276bc6c8c63eeb15edd94e8074..b6389712bb2a423122c08d5a1fd7bcbecd166216 100644 (file)
@@ -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;