Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18952
b: refs/heads/master
c: 822f100
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and Linus Torvalds committed Jan 19, 2006
1 parent feb633b commit b2f46b7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 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: fd44527707f2697fd2959e8bdb321ae588d150e2
refs/heads/master: 822f1005ae1f3a4a8b136f38a6933d3f719f4c4a
30 changes: 25 additions & 5 deletions trunk/net/sunrpc/auth_gss/svcauth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,20 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
return SVC_OK;
}

static int
gss_write_null_verf(struct svc_rqst *rqstp)
{
u32 *p;

svc_putu32(rqstp->rq_res.head, htonl(RPC_AUTH_NULL));
p = rqstp->rq_res.head->iov_base + rqstp->rq_res.head->iov_len;
/* don't really need to check if head->iov_len > PAGE_SIZE ... */
*p++ = 0;
if (!xdr_ressize_check(rqstp, p))
return -1;
return 0;
}

static int
gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
{
Expand Down Expand Up @@ -876,12 +890,18 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
case -ENOENT:
goto drop;
case 0:
rsci = gss_svc_searchbyctx(&rsip->out_handle);
if (!rsci) {
goto drop;
if (rsip->major_status == GSS_S_COMPLETE) {
rsci = gss_svc_searchbyctx(&rsip->out_handle);
if (!rsci) {
goto drop;
}
if (gss_write_verf(rqstp, rsci->mechctx,
GSS_SEQ_WIN))
goto drop;
} else {
if (gss_write_null_verf(rqstp))
goto drop;
}
if (gss_write_verf(rqstp, rsci->mechctx, GSS_SEQ_WIN))
goto drop;
if (resv->iov_len + 4 > PAGE_SIZE)
goto drop;
svc_putu32(resv, rpc_success);
Expand Down

0 comments on commit b2f46b7

Please sign in to comment.