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>
This commit is contained in:
parent
7eaf040b72
commit
0b4d51b02a
4 changed files with 8 additions and 8 deletions
|
@ -129,8 +129,8 @@ machine_cred_match(struct auth_cred *acred, struct generic_cred *gcred, int flag
|
|||
{
|
||||
if (!gcred->acred.machine_cred ||
|
||||
gcred->acred.principal != acred->principal ||
|
||||
gcred->acred.uid != acred->uid ||
|
||||
gcred->acred.gid != acred->gid)
|
||||
!uid_eq(gcred->acred.uid, acred->uid) ||
|
||||
!gid_eq(gcred->acred.gid, acred->gid))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -147,8 +147,8 @@ generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
|
|||
if (acred->machine_cred)
|
||||
return machine_cred_match(acred, gcred, flags);
|
||||
|
||||
if (gcred->acred.uid != acred->uid ||
|
||||
gcred->acred.gid != acred->gid ||
|
||||
if (!uid_eq(gcred->acred.uid, acred->uid) ||
|
||||
!gid_eq(gcred->acred.gid, acred->gid) ||
|
||||
gcred->acred.machine_cred != 0)
|
||||
goto out_nomatch;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue