]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: 'auth list' is a read-only operation
authorSage Weil <sage@inktank.com>
Mon, 14 May 2012 22:19:31 +0000 (15:19 -0700)
committerSage Weil <sage@inktank.com>
Wed, 16 May 2012 23:36:52 +0000 (16:36 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/AuthMonitor.cc

index b9689fc778777078be6730ee05452316ed7fa237..c2f68b62a08fe6831212e40cb64fedf2d1ca9aa3 100644 (file)
@@ -431,8 +431,7 @@ bool AuthMonitor::preprocess_command(MMonCommand *m)
     if (m->cmd[1] == "add" ||
         m->cmd[1] == "del" ||
        m->cmd[1] == "get-or-create" ||
-       m->cmd[1] == "caps" ||
-        m->cmd[1] == "list") {
+       m->cmd[1] == "caps") {
       return false;
     }
     else if (m->cmd[1] == "export") {
@@ -498,6 +497,11 @@ bool AuthMonitor::preprocess_command(MMonCommand *m)
       ss << auth.key;
       r = 0;      
     }
+    else if (m->cmd[1] == "list") {
+      mon->key_server.list_secrets(ss);
+      r = 0;
+      goto done;
+    }
     else {
       auth_usage(ss);
       r = -EINVAL;
@@ -710,11 +714,6 @@ bool AuthMonitor::prepare_command(MMonCommand *m)
       paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
       return true;
     }
-    else if (m->cmd[1] == "list") {
-      mon->key_server.list_secrets(ss);
-      err = 0;
-      goto done;
-    }
     else {
       auth_usage(ss);
     }