aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_generic.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-02-01 19:39:32 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-02-13 09:15:17 -0500
commit0b4d51b02a2e941beec6f02a6c7a32c5a28c5b43 (patch)
treed25f90f6dbaf133865f9761b80e8a7324a5888f8 /net/sunrpc/auth_generic.c
parent7eaf040b720bc8c0ce5cd49151ca194ca2d56842 (diff)
sunrpc: Use uid_eq and gid_eq where appropriate
When comparing uids use uid_eq instead of ==. When comparing gids use gid_eq instead of ==. And unfortunate cost of type safety. Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'net/sunrpc/auth_generic.c')
-rw-r--r--net/sunrpc/auth_generic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c
index 9d2e0b045596..bff3e4730f6b 100644
--- a/net/sunrpc/auth_generic.c
+++ b/net/sunrpc/auth_generic.c
@@ -129,8 +129,8 @@ machine_cred_match(struct auth_cred *acred, struct generic_cred *gcred, int flag
129{ 129{
130 if (!gcred->acred.machine_cred || 130 if (!gcred->acred.machine_cred ||
131 gcred->acred.principal != acred->principal || 131 gcred->acred.principal != acred->principal ||
132 gcred->acred.uid != acred->uid || 132 !uid_eq(gcred->acred.uid, acred->uid) ||
133 gcred->acred.gid != acred->gid) 133 !gid_eq(gcred->acred.gid, acred->gid))
134 return 0; 134 return 0;
135 return 1; 135 return 1;
136} 136}
@@ -147,8 +147,8 @@ generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
147 if (acred->machine_cred) 147 if (acred->machine_cred)
148 return machine_cred_match(acred, gcred, flags); 148 return machine_cred_match(acred, gcred, flags);
149 149
150 if (gcred->acred.uid != acred->uid || 150 if (!uid_eq(gcred->acred.uid, acred->uid) ||
151 gcred->acred.gid != acred->gid || 151 !gid_eq(gcred->acred.gid, acred->gid) ||
152 gcred->acred.machine_cred != 0) 152 gcred->acred.machine_cred != 0)
153 goto out_nomatch; 153 goto out_nomatch;
154 154