mon: MSG_LOG uses an in-handler cap check instead of a macro

This commit is contained in:
Greg Farnum 2010-03-22 15:41:05 -07:00
parent ccb5cff408
commit 45f8072b52
2 changed files with 6 additions and 1 deletions

View File

@ -229,6 +229,12 @@ void LogMonitor::committed()
bool LogMonitor::preprocess_log(MLog *m)
{
dout(10) << "preprocess_log " << *m << " from " << m->get_orig_source() << dendl;
if (!m->caps->check_privileges(PAXOS_LOG, MON_CAP_X)) {
dout(0) << "Received MLog from entity with insufficient privileges "
<< m->caps << dendl;
return true; //no reply expected
}
int num_new = 0;
for (deque<LogEntry>::iterator p = m->entries.begin();

View File

@ -663,7 +663,6 @@ do { \
// log
case MSG_LOG:
ALLOW_CAPS(PAXOS_LOG, MON_CAP_RW);
fill_caps(m);
paxos_service[PAXOS_LOG]->dispatch((PaxosServiceMessage*)m);
break;