]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
add link check_access
authorJashan Kamboj <jashank42@gmail.com>
Tue, 21 Jul 2015 19:36:50 +0000 (01:06 +0530)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:39:33 +0000 (09:39 -0400)
Signed-off-by: Jashan Kamboj <jashank42@gmail.com>
src/mds/Server.cc

index eb1ae6442ac91469b912994436bf58a679d2356e..a714363a16fc3473018cc6bcabbbc99f17b227c1 100644 (file)
@@ -4686,6 +4686,12 @@ void Server::handle_client_link(MDRequestRef& mdr)
   if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
     return;
 
+  if (!check_access(mdr, targeti, MAY_WRITE))
+    return;
+
+  if (!check_access(mdr, dir->get_inode(), MAY_WRITE))
+    return;
+
   // go!
   assert(g_conf->mds_kill_link_at != 1);