aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 37bafb290c11..6dc0cfb37541 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1201,11 +1201,31 @@ same_clid(clientid_t *cl1, clientid_t *cl2)
1201 return (cl1->cl_boot == cl2->cl_boot) && (cl1->cl_id == cl2->cl_id); 1201 return (cl1->cl_boot == cl2->cl_boot) && (cl1->cl_id == cl2->cl_id);
1202} 1202}
1203 1203
1204static bool groups_equal(struct group_info *g1, struct group_info *g2)
1205{
1206 int i;
1207
1208 if (g1->ngroups != g2->ngroups)
1209 return false;
1210 for (i=0; i<g1->ngroups; i++)
1211 if (GROUP_AT(g1, i) != GROUP_AT(g2, i))
1212 return false;
1213 return true;
1214}
1215
1204/* XXX what about NGROUP */ 1216/* XXX what about NGROUP */
1205static int 1217static int
1206same_creds(struct svc_cred *cr1, struct svc_cred *cr2) 1218same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
1207{ 1219{
1208 return cr1->cr_uid == cr2->cr_uid; 1220 if ((cr1->cr_uid != cr2->cr_uid)
1221 || (cr1->cr_gid != cr2->cr_gid)
1222 || !groups_equal(cr1->cr_group_info, cr2->cr_group_info))
1223 return false;
1224 if (cr1->cr_principal == cr2->cr_principal)
1225 return true;
1226 if (!cr1->cr_principal || !cr2->cr_principal)
1227 return false;
1228 return 0 == strcmp(cr1->cr_principal, cr1->cr_principal);
1209} 1229}
1210 1230
1211static void gen_clid(struct nfs4_client *clp) 1231static void gen_clid(struct nfs4_client *clp)