]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use get_gid()/get_uid() instead of pick_my_perms() directly
authorGreg Farnum <gfarnum@redhat.com>
Wed, 27 Jul 2016 22:34:43 +0000 (15:34 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 31 Aug 2016 21:38:49 +0000 (14:38 -0700)
By the time we're done we don't want to be setting any permissions in the
Client code directly, and this open-coding will make it more obvious if
we miss something (when removing the get_uid() and get_gid() functions).

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc

index 3311311d3d7c5ab06b84b8fe63e9773cc86038b1..99f0bddca9701edd755f2b4e6a65b7666d1a26b7 100644 (file)
@@ -6242,7 +6242,7 @@ int Client::mkdirs(const char *relpath, mode_t mode)
   tout(cct) << relpath << std::endl;
   tout(cct) << mode << std::endl;
 
-  UserPerm perms = pick_my_perms();
+  UserPerm perms(get_uid(), get_gid());
 
   //get through existing parts of path
   filepath path(relpath);
@@ -6294,7 +6294,7 @@ int Client::rmdir(const char *relpath)
   string name = path.last_dentry();
   path.pop_dentry();
   InodeRef dir;
-  UserPerm perms = pick_my_perms();
+  UserPerm perms(get_uid(), get_gid());
   int r = path_walk(path, &dir, perms);
   if (r < 0)
     return r;
@@ -6317,7 +6317,7 @@ int Client::mknod(const char *relpath, mode_t mode, dev_t rdev)
   string name = path.last_dentry();
   path.pop_dentry();
   InodeRef dir;
-  UserPerm perms = pick_my_perms();
+  UserPerm perms(get_uid(), get_gid());
   int r = path_walk(path, &dir, perms);
   if (r < 0)
     return r;
@@ -6342,7 +6342,7 @@ int Client::symlink(const char *target, const char *relpath)
   string name = path.last_dentry();
   path.pop_dentry();
   InodeRef dir;
-  UserPerm perms = pick_my_perms();
+  UserPerm perms(get_uid(), get_gid());
   int r = path_walk(path, &dir, perms);
   if (r < 0)
     return r;