]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Server: clean up check_access a bit
authorSage Weil <sage@redhat.com>
Tue, 21 Jul 2015 16:50:24 +0000 (12:50 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:39:32 +0000 (09:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/Server.cc

index fce3760ca207e5860fb703838ffb78b9b5e99827..d34f8f8372fa858a28b2e70b3784d50e276df83d 100644 (file)
@@ -2111,18 +2111,13 @@ bool Server::check_access(MDRequestRef& mdr, CInode *in, unsigned mask)
 
   uid_t uid = mdr->client_request->get_caller_uid();
 
-  // FIXME: generate a real path
   // FIXME: behave with inodes in stray dir
   // FIXME: behave with hard links
   string path;
-
-  //path calculation
   in->make_path_string(path, false, in->get_projected_parent_dn());
+  if (path.length())
+    path = path.substr(1);    // drop leading /
 
-  //drop leading /
-  if (path.length()) path = path.substr(1);
-
-  // FIXME: it depends on the inode!
   if (s->auth_caps.is_capable(path, in->inode.uid, in->inode.gid, in->inode.mode,
                              uid, mask)) {
     return true;