]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client/Client.cc: remove only once used variable
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 18 Aug 2015 10:34:01 +0000 (12:34 +0200)
committerYan, Zheng <zyan@redhat.com>
Thu, 3 Mar 2016 12:30:07 +0000 (20:30 +0800)
Fix for:
[src/client/Client.cc:4555]: (style) The scope of the variable
 'initial_group_count' can be reduced.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit a29dd45dd89f59ff15018f541601ac5ede162174)

src/client/Client.cc

index 43131f8d257e1cbb8dffec27ddea4115b22e6511..a966b1702116675ae26dc2a7d891e69c53c21a3b 100644 (file)
@@ -4388,10 +4388,6 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, MClient
 
 int Client::check_permissions(Inode *in, int flags, int uid, int gid)
 {
-  // initial number of group entries, defaults to posix standard of 16
-  // PAM implementations may provide more than 16 groups....
-  int initial_group_count = 16;
-
   gid_t *sgids = NULL;
   int sgid_count = 0;
   if (getgroups_cb) {
@@ -4403,8 +4399,10 @@ int Client::check_permissions(Inode *in, int flags, int uid, int gid)
   }
 #if HAVE_GETGROUPLIST
   else {
-    //use PAM to get the group list
-    sgid_count = initial_group_count;
+    // use PAM to get the group list
+    // initial number of group entries, defaults to posix standard of 16
+    // PAM implementations may provide more than 16 groups....
+    sgid_count = 16;
     sgids = (gid_t*)malloc(sgid_count * sizeof(gid_t));
     if (sgids == NULL) {
       ldout(cct, 3) << "allocating group memory failed" << dendl;