summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-03-25 11:40:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:12 -0500
commitff573597613e8253ff1b9d6c6a69cd127a9e4fb5 (patch)
treedcc6900f34122082b0e99565d6da9ddc1694dca7 /source4/rpc_server
parent57589e3b67c4fbe6412478bef9a46cdf5b1df795 (diff)
downloadsamba-ff573597613e8253ff1b9d6c6a69cd127a9e4fb5.tar.gz
samba-ff573597613e8253ff1b9d6c6a69cd127a9e4fb5.tar.bz2
samba-ff573597613e8253ff1b9d6c6a69cd127a9e4fb5.zip
r14715: Correct the definition of the DCE/RPC bind_nak, per the OpenGroup spec.
This allows us to correctly parse the bind_nak from NT4, when we use an invalid auth type (the unsupported SPNEGO).. Andrew Bartlett (This used to be commit ce0c7f86fd5eeeacad885d732b66c65ac9103ace)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/dcerpc_server.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 37026f901f..4c39333e86 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -433,7 +433,9 @@ static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32_t reason)
pkt.ptype = DCERPC_PKT_BIND_NAK;
pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
pkt.u.bind_nak.reject_reason = reason;
- pkt.u.bind_nak.num_versions = 0;
+ if (pkt.u.bind_nak.reject_reason == DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED) {
+ pkt.u.bind_nak.versions.v.num_versions = 0;
+ }
rep = talloc(call, struct data_blob_list_item);
if (!rep) {
@@ -527,8 +529,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
/* handle any authentication that is being requested */
if (!dcesrv_auth_bind(call)) {
- /* TODO: work out the right reject code */
- return dcesrv_bind_nak(call, 0);
+ return dcesrv_bind_nak(call, DCERPC_BIND_REASON_INVALID_AUTH_TYPE);
}
/* setup a bind_ack */