If a given client doesn't have the required caps when running a command,
it must receive an EACCES or EPERM reply. This is already handled by
Monitor::handle_command(), which does an exceptionally good job at it.
Therefore, and unlike other messages that do not expect return values,
we can't simply drop the message if the client doesn't have the
appropriate capabilities, or things can get very weird very fast from
the user's perspective. Dropping the message for a command without a
reply has roughly the same effect as loss of quorum (timeout, pipes
failing) and confusion may ensue from it.
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
paxos_service[PAXOS_LOG]->dispatch((PaxosServiceMessage*)m);
break;
+ // handle_command() does its own caps checking
+ case MSG_MON_COMMAND:
+ handle_command(static_cast<MMonCommand*>(m));
+ break;
+
default:
dealt_with = false;
break;
handle_get_version(static_cast<MMonGetVersion*>(m));
break;
- case MSG_MON_COMMAND:
- handle_command(static_cast<MMonCommand*>(m));
- break;
-
case CEPH_MSG_MON_SUBSCRIBE:
/* FIXME: check what's being subscribed, filter accordingly */
handle_subscribe(static_cast<MMonSubscribe*>(m));