s3-rpcclient: add object_uuid argument to cmd_epmapper_map()
authorGünther Deschner <gd@samba.org>
Fri, 11 Nov 2016 10:47:20 +0000 (11:47 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 11 Nov 2016 21:57:23 +0000 (22:57 +0100)
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@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpcclient/cmd_epmapper.c

index 7753df24709f564bdc4943358193b33d90fd6960..289b086718fa6366b75cfd4a87aa5a46be164dc5 100644 (file)
@@ -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;
        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;
        }
 
                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);
        /* 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(
        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)) {
                &map_tower, &entry_handle, ARRAY_SIZE(towers),
                &num_towers, towers, &result);
        if (!NT_STATUS_IS_OK(status)) {