NFS client bugfixes for Linux 3.3 (pull 3)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPJcPiAAoJEGcL54qWCgDyLegQAITxsoM1yYiXUQ70dksWIn8q y/ieLyrrTa0X3k3pHjSi305ar5d41ebEdq3aPk7tnXkpVEAPBKu4gmgx2ZQmb/G4 uS0jiPQMjakORpBQ3RPviPDy+Yb/xWZa8iZFSq8F1pjWggPYVaNaDQmZXY+h1luN JSgaLSwefw3eTBuY9sqN1+qr0/F1Cbri5fYDMeA6GlJfdDkt4qO7Rep6VRc8xghk Pb5CnyiIziGB8qZnWI2dxQVUZRUYMGA+E6cAZzBxBAyLVxWmZGHJWB6VceNIilaT 3CWXgQ8XRbOeYWx1q/Lnbf2s1ebRGWj5JxLoMSDYo4U6q5BEjngG0vzf5wHpMToR 8JZB6PXmD9riCsm6xHIdu5Q+5Ku4cttGDT0PeCci/lwhgf9/u7YxwpTF8zdec0e5 IWYIA9n+i8pot6XDOrlfmXARIGmtz7CDnPlmXCg0hKujfEj5Tmx7v4DKtGZSxQay e83/uuMfSWoaM3/RKG5Y0DhcbweuMMdybno4jgiYilKMCSiP4A+6YOaBSP0Y60DO PJmaK5E5BAhGfljCjQkvNZjpIMLUfFKKTjpB1e09ZmNs3q0lSnglX2MEOizaoHLI qZ7ZtFY4GVoZDV9d0zqWjUqZK0+L7YWo9M5el2ApBYt/K9gc8bpK9NLB4wrF6aPV DSe4flw4d8uTxkFvES3s =Fin9 -----END PGP SIGNATURE----- Merge tag 'nfs-for-3.3-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs NFS client bugfixes for Linux 3.3 (pull 3) * tag 'nfs-for-3.3-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: SUNRPC: Fix machine creds in generic_create_cred and generic_match
This commit is contained in:
commit
f94f72ee67
|
@ -92,6 +92,7 @@ generic_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
|
|||
if (gcred->acred.group_info != NULL)
|
||||
get_group_info(gcred->acred.group_info);
|
||||
gcred->acred.machine_cred = acred->machine_cred;
|
||||
gcred->acred.principal = acred->principal;
|
||||
|
||||
dprintk("RPC: allocated %s cred %p for uid %d gid %d\n",
|
||||
gcred->acred.machine_cred ? "machine" : "generic",
|
||||
|
@ -123,6 +124,17 @@ generic_destroy_cred(struct rpc_cred *cred)
|
|||
call_rcu(&cred->cr_rcu, generic_free_cred_callback);
|
||||
}
|
||||
|
||||
static int
|
||||
machine_cred_match(struct auth_cred *acred, struct generic_cred *gcred, int flags)
|
||||
{
|
||||
if (!gcred->acred.machine_cred ||
|
||||
gcred->acred.principal != acred->principal ||
|
||||
gcred->acred.uid != acred->uid ||
|
||||
gcred->acred.gid != acred->gid)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Match credentials against current process creds.
|
||||
*/
|
||||
|
@ -132,9 +144,12 @@ generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
|
|||
struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base);
|
||||
int i;
|
||||
|
||||
if (acred->machine_cred)
|
||||
return machine_cred_match(acred, gcred, flags);
|
||||
|
||||
if (gcred->acred.uid != acred->uid ||
|
||||
gcred->acred.gid != acred->gid ||
|
||||
gcred->acred.machine_cred != acred->machine_cred)
|
||||
gcred->acred.machine_cred != 0)
|
||||
goto out_nomatch;
|
||||
|
||||
/* Optimisation in the case where pointers are identical... */
|
||||
|
|
Loading…
Reference in a new issue