rpcrt4: If the authorisation failed during a send then we should return ERROR_ACCESS_DENIED.

This commit is contained in:
Robert Shearman 2006-05-18 03:39:50 +01:00 committed by Alexandre Julliard
parent 4fae04b2f5
commit 2aa52b07d6
1 changed files with 8 additions and 3 deletions

View File

@ -393,7 +393,10 @@ static RPC_STATUS RPCRT_AuthorizeConnection(RpcConnection* conn,
ISC_REQ_DELEGATE, 0, SECURITY_NETWORK_DREP,
&inp_desc, 0, &conn->ctx, &out_desc, &conn->attr, &conn->exp);
if (r)
return r;
{
WARN("InitializeSecurityContext failed with error 0x%08lx\n", r);
return ERROR_ACCESS_DENIED;
}
resp_hdr = RPCRT4_BuildAuthHeader(NDR_LOCAL_DATA_REPRESENTATION);
if (!resp_hdr)
@ -571,8 +574,10 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
unsigned int offset;
offset = common_hdr.frag_len - hdr_length - common_hdr.auth_len;
RPCRT_AuthorizeConnection(Connection, (LPBYTE)pMsg->Buffer + offset,
common_hdr.auth_len);
status = RPCRT_AuthorizeConnection(Connection, (LPBYTE)pMsg->Buffer + offset,
common_hdr.auth_len);
if (status)
goto fail;
}
/* success */