From: Greg Farnum Date: Wed, 27 Jul 2016 22:34:43 +0000 (-0700) Subject: client: use get_gid()/get_uid() instead of pick_my_perms() directly X-Git-Tag: v11.0.1~36^2~80 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5da1d0152527b34c104b699c208d6de6c9ae065;p=ceph.git client: use get_gid()/get_uid() instead of pick_my_perms() directly 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 3311311d3d7c..99f0bddca970 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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;