]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: don't use get_priv() without put!
authorGreg Farnum <gregf@hq.newdream.net>
Wed, 17 Mar 2010 18:57:18 +0000 (11:57 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Wed, 17 Mar 2010 21:57:12 +0000 (14:57 -0700)
src/mon/Monitor.cc
src/mon/OSDMonitor.cc

index e9a448b646a2cf52ac619e000ee0bb8339bbc12a..e33c7d3bf6552f490a4ee72a5f5ad8be1a49b679 100644 (file)
@@ -748,8 +748,11 @@ void Monitor::fill_caps(Message *m)
   Session *s = NULL;
   if (m->get_connection()) {
     s = (Session *) m->get_connection()->get_priv();
+    if (s) {
+      msg->caps = &s->caps;
+      s->put();
+    }
   }
-  if (s) msg->caps = &s->caps;
 }
 
 void Monitor::handle_subscribe(MMonSubscribe *m)
index 29de8643295b342f83797cba812bb38a567e39ae..24c06e144f69a33d8170ca8a5c22ff584f645d1e 100644 (file)
@@ -1006,8 +1006,8 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
 int OSDMonitor::prepare_new_pool(MPoolOp *m)
 {
   //check permissions for the auid, then pass off to next function
-  dout(10) << "prepare_new_pool from Session " << std::endl
-          << ((Session *) m->get_connection()->get_priv()) << dendl;
+  dout(10) << "prepare_new_pool from "
+          << (m->get_connection()) << dendl;
   if (m->auid) {
     if(m->caps->check_privileges(PAXOS_OSDMAP, MON_CAP_W, m->auid)) {
       return prepare_new_pool(m->name, m->auid);