]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: require name for 'auth add ...' command
authorSage Weil <sage@inktank.com>
Wed, 30 Jan 2013 02:41:52 +0000 (18:41 -0800)
committerSage Weil <sage@inktank.com>
Wed, 30 Jan 2013 02:42:00 +0000 (18:42 -0800)
Otherwise we interpret the empty string as 'unknown.'.

Fixes: #3956
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/AuthMonitor.cc

index 1afc215fa785b4eac432391aba5681cac79d3793..e4cd752f29b2cc92f0d1ffe6fed455c597f7b474 100644 (file)
@@ -610,7 +610,7 @@ 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] == "add" && m->cmd.size() >= 2) {
+    else if (m->cmd[1] == "add" && m->cmd.size() >= 3) {
       KeyServerData::Incremental auth_inc;
       if (m->cmd.size() >= 3) {
         if (!auth_inc.name.from_str(m->cmd[2])) {