SUNRPC: Move upcall out of auth->au_ops->crcreate()

This fixes a bug whereby if two processes try to look up the same auth_gss
 credential, they may end up creating two creds, and triggering two upcalls
 because the upcall is performed before the credential is added to the
 credcache.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust 2006-02-01 12:19:27 -05:00
parent adb12f63e0
commit fba3bad488
3 changed files with 23 additions and 9 deletions

View file

@ -232,6 +232,14 @@ retry:
goto retry;
} else
cred = new;
} else if ((cred->cr_flags & RPCAUTH_CRED_NEW)
&& cred->cr_ops->cr_init != NULL
&& !(flags & RPCAUTH_LOOKUP_NEW)) {
int res = cred->cr_ops->cr_init(auth, cred);
if (res < 0) {
put_rpccred(cred);
cred = ERR_PTR(res);
}
}
return (struct rpc_cred *) cred;