You need to sign in or sign up before continuing.
提交 2004c726 编写于 作者: J Jeff Layton 提交者: Trond Myklebust

auth_gss: fetch the acceptor name out of the downcall

If rpc.gssd sends us an acceptor name string trailing the context token,
stash it as part of the context.
Signed-off-by: NJeff Layton <jlayton@poochiereds.net>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 f1cdae87
...@@ -71,6 +71,7 @@ struct gss_cl_ctx { ...@@ -71,6 +71,7 @@ struct gss_cl_ctx {
spinlock_t gc_seq_lock; spinlock_t gc_seq_lock;
struct gss_ctx __rcu *gc_gss_ctx; struct gss_ctx __rcu *gc_gss_ctx;
struct xdr_netobj gc_wire_ctx; struct xdr_netobj gc_wire_ctx;
struct xdr_netobj gc_acceptor;
u32 gc_win; u32 gc_win;
unsigned long gc_expiry; unsigned long gc_expiry;
struct rcu_head gc_rcu; struct rcu_head gc_rcu;
......
...@@ -262,9 +262,22 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct ...@@ -262,9 +262,22 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
p = ERR_PTR(ret); p = ERR_PTR(ret);
goto err; goto err;
} }
dprintk("RPC: %s Success. gc_expiry %lu now %lu timeout %u\n",
__func__, ctx->gc_expiry, now, timeout); /* is there any trailing data? */
return q; if (q == end) {
p = q;
goto done;
}
/* pull in acceptor name (if there is one) */
p = simple_get_netobj(q, end, &ctx->gc_acceptor);
if (IS_ERR(p))
goto err;
done:
dprintk("RPC: %s Success. gc_expiry %lu now %lu timeout %u acceptor %.*s\n",
__func__, ctx->gc_expiry, now, timeout, ctx->gc_acceptor.len,
ctx->gc_acceptor.data);
return p;
err: err:
dprintk("RPC: %s returns error %ld\n", __func__, -PTR_ERR(p)); dprintk("RPC: %s returns error %ld\n", __func__, -PTR_ERR(p));
return p; return p;
...@@ -1225,6 +1238,7 @@ gss_do_free_ctx(struct gss_cl_ctx *ctx) ...@@ -1225,6 +1238,7 @@ gss_do_free_ctx(struct gss_cl_ctx *ctx)
gss_delete_sec_context(&ctx->gc_gss_ctx); gss_delete_sec_context(&ctx->gc_gss_ctx);
kfree(ctx->gc_wire_ctx.data); kfree(ctx->gc_wire_ctx.data);
kfree(ctx->gc_acceptor.data);
kfree(ctx); kfree(ctx);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册