Skip to content

Commit

Permalink
client/Client.cc: remove only once used variable
Browse files Browse the repository at this point in the history
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 a29dd45)
  • Loading branch information
dalgaaf authored and ukernel committed Nov 17, 2015
1 parent a3e69a6 commit 19b76aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/client/Client.cc
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 19b76aa

Please sign in to comment.