Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309851
b: refs/heads/master
c: 8fbba96
h: refs/heads/master
i:
  309849: 9b776b6
  309847: 50debf4
v: v3
  • Loading branch information
J. Bruce Fields committed Jun 1, 2012
1 parent 97a8a58 commit 63a54c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03a4e1f6ddf25f48848e1bddcffc0ad489648331
refs/heads/master: 8fbba96e5b327665265ad02b7f331b68536828bf
22 changes: 21 additions & 1 deletion trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,11 +1201,31 @@ same_clid(clientid_t *cl1, clientid_t *cl2)
return (cl1->cl_boot == cl2->cl_boot) && (cl1->cl_id == cl2->cl_id);
}

static bool groups_equal(struct group_info *g1, struct group_info *g2)
{
int i;

if (g1->ngroups != g2->ngroups)
return false;
for (i=0; i<g1->ngroups; i++)
if (GROUP_AT(g1, i) != GROUP_AT(g2, i))
return false;
return true;
}

/* XXX what about NGROUP */
static int
same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
{
return cr1->cr_uid == cr2->cr_uid;
if ((cr1->cr_uid != cr2->cr_uid)
|| (cr1->cr_gid != cr2->cr_gid)
|| !groups_equal(cr1->cr_group_info, cr2->cr_group_info))
return false;
if (cr1->cr_principal == cr2->cr_principal)
return true;
if (!cr1->cr_principal || !cr2->cr_principal)
return false;
return 0 == strcmp(cr1->cr_principal, cr1->cr_principal);
}

static void gen_clid(struct nfs4_client *clp)
Expand Down

0 comments on commit 63a54c3

Please sign in to comment.