]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MSG_LOG uses an in-handler cap check instead of a macro
authorGreg Farnum <gregf@hq.newdream.net>
Mon, 22 Mar 2010 22:41:05 +0000 (15:41 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Tue, 23 Mar 2010 18:41:52 +0000 (11:41 -0700)
src/mon/LogMonitor.cc
src/mon/Monitor.cc

index c53565172cc3b1b944df0f97c97c97a7d370afff..aed7e1ebb6140e8aefe296b871c1e48a20412638 100644 (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();
index e94ae0a47f02e14be2abc2e222bdd2488b3eeb31..d0570e593d92001a80122ba9d3038ad7584dd432 100644 (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;