Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19475
b: refs/heads/master
c: fba3bad
h: refs/heads/master
i:
  19473: 77bcd63
  19471: 2a6b210
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 1, 2006
1 parent 31dca47 commit 0dc9610
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: adb12f63e0f837078c6832fa2c90649ddeaab54f
refs/heads/master: fba3bad488a2eec2d76c067edb7a5ff92ef42431
1 change: 1 addition & 0 deletions trunk/include/linux/sunrpc/auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct rpc_authops {

struct rpc_credops {
const char * cr_name; /* Name of the auth flavour */
int (*cr_init)(struct rpc_auth *, struct rpc_cred *);
void (*crdestroy)(struct rpc_cred *);

int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
Expand Down
8 changes: 8 additions & 0 deletions trunk/net/sunrpc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred,
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;
Expand Down
23 changes: 14 additions & 9 deletions trunk/net/sunrpc/auth_gss/auth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,6 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
cred->gc_base.cr_ops = &gss_credops;
cred->gc_base.cr_flags = RPCAUTH_CRED_NEW;
cred->gc_service = gss_auth->service;
/* Is the caller prepared to initialise the credential? */
if (flags & RPCAUTH_LOOKUP_NEW)
goto out;
do {
err = gss_create_upcall(gss_auth, cred);
} while (err == -EAGAIN);
if (err < 0)
goto out_err;
out:
return &cred->gc_base;

out_err:
Expand All @@ -805,6 +796,19 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
return ERR_PTR(err);
}

static int
gss_cred_init(struct rpc_auth *auth, struct rpc_cred *cred)
{
struct gss_auth *gss_auth = container_of(auth, struct gss_auth, rpc_auth);
struct gss_cred *gss_cred = container_of(cred,struct gss_cred, gc_base);
int err;

do {
err = gss_create_upcall(gss_auth, gss_cred);
} while (err == -EAGAIN);
return err;
}

static int
gss_match(struct auth_cred *acred, struct rpc_cred *rc, int flags)
{
Expand Down Expand Up @@ -1254,6 +1258,7 @@ static struct rpc_authops authgss_ops = {
static struct rpc_credops gss_credops = {
.cr_name = "AUTH_GSS",
.crdestroy = gss_destroy_cred,
.cr_init = gss_cred_init,
.crmatch = gss_match,
.crmarshal = gss_marshal,
.crrefresh = gss_refresh,
Expand Down

0 comments on commit 0dc9610

Please sign in to comment.