1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

a couple of tidyups

* don't try to map the epmapper uuid !

 * some preliminary support for alter context pdus
(This used to be commit f9857e56850cabfac06534fb33ff7a7a04346a9b)
This commit is contained in:
Andrew Tridgell 2003-11-27 04:02:15 +00:00
parent 1cab707f0b
commit a9203bf02b
4 changed files with 23 additions and 3 deletions

View File

@ -44,6 +44,8 @@ struct dcerpc_pipe *dcerpc_pipe_init(void)
p->auth_info = NULL;
p->ntlmssp_state = NULL;
p->flags = 0;
p->srv_max_xmit_frag = 0;
p->srv_max_recv_frag = 0;
return p;
}
@ -360,14 +362,16 @@ NTSTATUS dcerpc_bind(struct dcerpc_pipe *p,
return status;
}
if (pkt.ptype != DCERPC_PKT_BIND_ACK ||
if ((pkt.ptype != DCERPC_PKT_BIND_ACK && pkt.ptype != DCERPC_PKT_ALTER_ACK) ||
pkt.u.bind_ack.num_results == 0 ||
pkt.u.bind_ack.ctx_list[0].result != 0) {
status = NT_STATUS_UNSUCCESSFUL;
}
if (pkt.ptype != DCERPC_PKT_ALTER_ACK) {
p->srv_max_xmit_frag = pkt.u.bind_ack.max_xmit_frag;
p->srv_max_recv_frag = pkt.u.bind_ack.max_recv_frag;
}
/* the bind_ack might contain a reply set of credentials */
if (p->auth_info && pkt.u.bind_ack.auth_info.length) {
@ -526,6 +530,7 @@ NTSTATUS dcerpc_request(struct dcerpc_pipe *p,
}
if (pkt.ptype == DCERPC_PKT_FAULT) {
p->last_fault_code = pkt.u.fault.status;
return NT_STATUS_NET_WRITE_FAULT;
}
@ -559,6 +564,11 @@ NTSTATUS dcerpc_request(struct dcerpc_pipe *p,
return NT_STATUS_UNSUCCESSFUL;
}
if (pkt.ptype == DCERPC_PKT_FAULT) {
p->last_fault_code = pkt.u.fault.status;
return NT_STATUS_NET_WRITE_FAULT;
}
if (pkt.ptype != DCERPC_PKT_RESPONSE) {
return NT_STATUS_UNSUCCESSFUL;
}

View File

@ -48,6 +48,9 @@ struct dcerpc_pipe {
NTSTATUS (*shutdown_pipe)(struct dcerpc_pipe *);
const char *(*peer_name)(struct dcerpc_pipe *);
} transport;
/* the last fault code from a DCERPC fault */
uint32 last_fault_code;
};
/* dcerpc pipe flags */

View File

@ -136,6 +136,7 @@ done:
if (!NT_STATUS_IS_OK(status)) {
p->ntlmssp_state = NULL;
p->auth_info = NULL;
}
return status;

View File

@ -62,6 +62,12 @@ NTSTATUS dcerpc_epm_map_tcp_port(const char *server,
GUID guid;
struct epm_twr_t twr, *twr_r;
if (strcmp(uuid, DCERPC_EPMAPPER_UUID) == 0) {
/* don't lookup epmapper via epmapper! */
*port = 135;
return NT_STATUS_OK;
}
status = dcerpc_pipe_open_tcp(&p, server, 135);
if (!NT_STATUS_IS_OK(status)) {
return status;