summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/dcerpc.idl13
-rw-r--r--source4/librpc/rpc/dcerpc.c7
2 files changed, 19 insertions, 1 deletions
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index e0366adf07..5a91f66987 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -59,6 +59,8 @@ interface dcerpc
const int DCERPC_BIND_PROVIDER_REJECT = 2;
const int DCERPC_BIND_REASON_ASYNTAX = 1;
+ const int DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED = 4;
+ const int DCERPC_BIND_REASON_INVALID_AUTH_TYPE = 8;
typedef struct {
uint16 result;
@@ -78,9 +80,18 @@ interface dcerpc
} dcerpc_bind_ack;
typedef struct {
- uint16 reject_reason;
uint32 num_versions;
uint32 versions[num_versions];
+ } dcerpc_bind_nak_versions;
+
+ typedef [nodiscriminant] union {
+ [case(DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED)] dcerpc_bind_nak_versions v;
+ [default] ;
+ } dcerpc_bind_nak_versions_ctr;
+
+ typedef struct {
+ uint16 reject_reason;
+ [switch_is(reject_reason)] dcerpc_bind_nak_versions_ctr versions;
} dcerpc_bind_nak;
const uint8 DCERPC_RESPONSE_LENGTH = 24;
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 16721b4b03..a2cd62d399 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -72,6 +72,11 @@ struct dcerpc_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx,
}
c->event_ctx = ev;
+
+ if (!talloc_reference(c, ev)) {
+ talloc_free(c);
+ return NULL;
+ }
c->call_id = 1;
c->security_state.auth_info = NULL;
c->security_state.session_key = dcerpc_generic_session_key;
@@ -478,6 +483,8 @@ static NTSTATUS dcerpc_map_reason(uint16_t reason)
switch (reason) {
case DCERPC_BIND_REASON_ASYNTAX:
return NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX;
+ case DCERPC_BIND_REASON_INVALID_AUTH_TYPE:
+ return NT_STATUS_INVALID_PARAMETER;
}
return NT_STATUS_UNSUCCESSFUL;
}