summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-30 22:05:51 +0100
committerGünther Deschner <gd@samba.org>2014-02-13 11:54:14 +0100
commit5e3d72e738cacfbe1d641d7aa0ff7cc67979adf0 (patch)
treee89e3b4fa5247462de50678ac874cd24eccb7427 /source3/rpcclient
parent7fd9ee632e53e6c901aa8e38d11aeda09c2075c8 (diff)
downloadsamba-5e3d72e738cacfbe1d641d7aa0ff7cc67979adf0.tar.gz
s3:rpcclient: make use of dcerpc_parse_binding() to create the binding
This makes sure the binding is talloc'ed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_epmapper.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/rpcclient/cmd_epmapper.c b/source3/rpcclient/cmd_epmapper.c
index 9c6d7474db4..ff9e874527b 100644
--- a/source3/rpcclient/cmd_epmapper.c
+++ b/source3/rpcclient/cmd_epmapper.c
@@ -28,7 +28,7 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
int argc, const char **argv)
{
struct dcerpc_binding_handle *b = p->binding_handle;
- struct dcerpc_binding map_binding;
+ struct dcerpc_binding *map_binding;
struct epm_twr_t map_tower;
struct epm_twr_p_t towers[500];
struct policy_handle entry_handle;
@@ -41,13 +41,18 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
abstract_syntax = ndr_table_lsarpc.syntax_id;
- ZERO_STRUCT(map_binding);
- map_binding.transport = NCACN_NP;
- map_binding.object = abstract_syntax;
- map_binding.host = "127.0.0.1"; /* needed? */
- map_binding.endpoint = "0"; /* correct? needed? */
+ /* 127.0.0.1[0] => correct? needed? */
+ status = dcerpc_parse_binding(tmp_ctx, "ncacn_np:127.0.0.1[0]",
+ &map_binding);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "dcerpc_parse_binding returned %s\n",
+ nt_errstr(status));
+ goto done;
+ }
+
+ map_binding->object = abstract_syntax;
- status = dcerpc_binding_build_tower(tmp_ctx, &map_binding,
+ status = dcerpc_binding_build_tower(tmp_ctx, map_binding,
&map_tower.tower);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "dcerpc_binding_build_tower returned %s\n",