diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-20 19:44:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 19:44:00 -0500 |
commit | 6ab33d51713d6d60c7677c0d020910a8cb37e513 (patch) | |
tree | 546c2ff099b2757e75cf34ddace874f1220f740e /net/sunrpc | |
parent | 7be6065b39c3f1cfa796667eac1a2170465acc91 (diff) | |
parent | 13d428afc007fcfcd6deeb215618f54cf9c0cae6 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/ixgbe/ixgbe_main.c
include/net/mac80211.h
net/phonet/af_phonet.c
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth_generic.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index 744b79fdcb19..4028502f0528 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
@@ -133,13 +133,29 @@ static int | |||
133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) | 133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) |
134 | { | 134 | { |
135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); | 135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); |
136 | int i; | ||
136 | 137 | ||
137 | if (gcred->acred.uid != acred->uid || | 138 | if (gcred->acred.uid != acred->uid || |
138 | gcred->acred.gid != acred->gid || | 139 | gcred->acred.gid != acred->gid || |
139 | gcred->acred.group_info != acred->group_info || | ||
140 | gcred->acred.machine_cred != acred->machine_cred) | 140 | gcred->acred.machine_cred != acred->machine_cred) |
141 | return 0; | 141 | goto out_nomatch; |
142 | |||
143 | /* Optimisation in the case where pointers are identical... */ | ||
144 | if (gcred->acred.group_info == acred->group_info) | ||
145 | goto out_match; | ||
146 | |||
147 | /* Slow path... */ | ||
148 | if (gcred->acred.group_info->ngroups != acred->group_info->ngroups) | ||
149 | goto out_nomatch; | ||
150 | for (i = 0; i < gcred->acred.group_info->ngroups; i++) { | ||
151 | if (GROUP_AT(gcred->acred.group_info, i) != | ||
152 | GROUP_AT(acred->group_info, i)) | ||
153 | goto out_nomatch; | ||
154 | } | ||
155 | out_match: | ||
142 | return 1; | 156 | return 1; |
157 | out_nomatch: | ||
158 | return 0; | ||
143 | } | 159 | } |
144 | 160 | ||
145 | void __init rpc_init_generic_auth(void) | 161 | void __init rpc_init_generic_auth(void) |