[PATCH] allow to set object uuid in epmmap rpcclient cmd
Günther Deschner
gd at samba.org
Fri Nov 11 18:40:53 UTC 2016
Hi,
please review and push.
Thanks,
Guenther
--
Günther Deschner GPG-ID: 8EE11688
Red Hat gdeschner at redhat.com
Samba Team gd at samba.org
-------------- next part --------------
From ad937632a2d639edbd1154f00cc78c1b8cff5a43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 11 Nov 2016 11:47:20 +0100
Subject: [PATCH] s3-rpcclient: add object_uuid argument to cmd_epmapper_map()
This allows to test how an epmap-server deals with object_uuid during the
epm_Map call. On windows the object_uuid is always ignored expect for the case
when the first abstract_syntax in the tower is the mgmt service. Even in that
case, the role of the object_uuid is still unclear.
Guenther
Pair-Programmed-With: Andreas Schneider <asn at samba.org>
Signed-off-by: Guenther Deschner <gd at samba.org>
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/rpcclient/cmd_epmapper.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/source3/rpcclient/cmd_epmapper.c b/source3/rpcclient/cmd_epmapper.c
index 7753df2..289b086 100644
--- a/source3/rpcclient/cmd_epmapper.c
+++ b/source3/rpcclient/cmd_epmapper.c
@@ -42,10 +42,13 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
const char *interface_name = "lsarpc";
enum dcerpc_transport_t transport = NCACN_NP;
bool ok = false;
+ struct GUID object_uuid = GUID_zero();
- if (argc > 3) {
- d_fprintf(stderr, "Usage: %s [interface_name] [transport]\n",
- argv[0]);
+ if (argc > 4) {
+ d_fprintf(stderr,
+ "Usage: %s [interface_name] [transport] "
+ "[object_uuid]\n",
+ argv[0]);
return NT_STATUS_OK;
}
@@ -79,6 +82,13 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
}
}
+ if (argc >= 4) {
+ status = GUID_from_string(argv[3], &object_uuid);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
+ }
+
/* 127.0.0.1[0] => correct? needed? */
status = dcerpc_parse_binding(tmp_ctx, "ncacn_np:127.0.0.1[0]",
&map_binding);
@@ -115,7 +125,7 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
ZERO_STRUCT(entry_handle);
status = dcerpc_epm_Map(
- b, tmp_ctx, &abstract_syntax.uuid,
+ b, tmp_ctx, &object_uuid,
&map_tower, &entry_handle, ARRAY_SIZE(towers),
&num_towers, towers, &result);
if (!NT_STATUS_IS_OK(status)) {
--
2.7.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 201 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161111/758e9cfc/signature.sig>
More information about the samba-technical
mailing list