diff options
Diffstat (limited to 'source4/librpc/rpc/dcerpc_auth.c')
-rw-r--r-- | source4/librpc/rpc/dcerpc_auth.c | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c index 8ad3be4ecd..4c22b61519 100644 --- a/source4/librpc/rpc/dcerpc_auth.c +++ b/source4/librpc/rpc/dcerpc_auth.c @@ -23,20 +23,54 @@ */ #include "includes.h" +#include "libcli/composite/composite.h" /* do a non-athenticated dcerpc bind */ -NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p, - const char *uuid, uint_t version) + +struct composite_context *dcerpc_bind_auth_none_send(TALLOC_CTX *mem_ctx, + struct dcerpc_pipe *p, + const char *uuid, + uint_t version) { - TALLOC_CTX *tmp_ctx = talloc_new(p); - NTSTATUS status; + struct dcerpc_syntax_id syntax; + struct dcerpc_syntax_id transfer_syntax; - status = dcerpc_bind_byuuid(p, tmp_ctx, uuid, version); - talloc_free(tmp_ctx); + struct composite_context *c; - return status; + c = talloc_zero(mem_ctx, struct composite_context); + if (c == NULL) return NULL; + + c->status = dcerpc_init_syntaxes(uuid, &syntax, &transfer_syntax, + version); + if (!NT_STATUS_IS_OK(c->status)) { + DEBUG(2,("Invalid uuid string in " + "dcerpc_bind_auth_none_send\n")); + goto failed; + } + + /* c was only allocated as a container for a possible error */ + talloc_free(c); + + return dcerpc_bind_send(p, mem_ctx, &syntax, &transfer_syntax); + + failed: + composite_trigger_error(c); + return c; +} + +NTSTATUS dcerpc_bind_auth_none_recv(struct composite_context *ctx) +{ + return dcerpc_bind_recv(ctx); +} + +NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p, + const char *uuid, uint_t version) +{ + struct composite_context *ctx; + ctx = dcerpc_bind_auth_none_send(p, p, uuid, version); + return dcerpc_bind_auth_none_recv(ctx); } /* |