]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: pass UserPerm to ll_walk()
authorGreg Farnum <gfarnum@redhat.com>
Wed, 3 Aug 2016 05:37:37 +0000 (22:37 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Sep 2016 23:33:53 +0000 (16:33 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc
src/client/Client.h
src/libcephfs.cc

index 597d2ae24a145f03f1390fa5a3286b7c723f98e9..4dc04b05afb86c5227e3851fb5dd8ef0f9caee9a 100644 (file)
@@ -9533,7 +9533,8 @@ int Client::ll_lookup(Inode *parent, const char *name, struct stat *attr,
   return r;
 }
 
-int Client::ll_walk(const char* name, Inode **out, struct stat *attr)
+int Client::ll_walk(const char* name, Inode **out, struct stat *attr,
+                   const UserPerm& perms)
 {
   Mutex::Locker lock(client_lock);
   filepath fp(name, 0);
@@ -9544,7 +9545,7 @@ int Client::ll_walk(const char* name, Inode **out, struct stat *attr)
   tout(cct) << "ll_walk" << std::endl;
   tout(cct) << name << std::endl;
 
-  rc = path_walk(fp, &in, false);
+  rc = path_walk(fp, &in, perms, false);
   if (rc < 0) {
     attr->st_ino = 0;
     *out = NULL;
index 9638fc4cfaa03d73a0ca6db87b19f1dd93617282..b02871e6e693e06b8f346864b928619ae1044947 100644 (file)
@@ -1245,7 +1245,8 @@ public:
   int ll_commit_blocks(Inode *in, uint64_t offset, uint64_t length);
 
   int ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms);
-  int ll_walk(const char* name, Inode **i, struct stat *attr); // XXX in?
+  int ll_walk(const char* name, Inode **i, struct stat *attr,
+             const UserPerm& perms); // XXX in?
   uint32_t ll_stripe_unit(Inode *in);
   int ll_file_layout(Inode *in, file_layout_t *layout);
   uint64_t ll_snap_seq(Inode *in);
index c85544ade262593a732c04000ee76de31de4cd71..ccace2907f0e0ac66efe6b0f70d971a6368a0549 100644 (file)
@@ -1438,7 +1438,8 @@ extern "C" int ceph_ll_walk(class ceph_mount_info *cmount, const char *name,
                            struct Inode **i,
                            struct stat *attr)
 {
-  return(cmount->get_client()->ll_walk(name, i, attr));
+  UserPerm perms = cmount->get_client()->pick_my_perms();
+  return (cmount->get_client()->ll_walk(name, i, attr, perms));
 }
 
 extern "C" int ceph_ll_getattr(class ceph_mount_info *cmount,