s3:rpcclient: make use of dcerpc_binding_get_string_option("host")
authorStefan Metzmacher <metze@samba.org>
Tue, 4 Feb 2014 11:14:37 +0000 (12:14 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:16 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/rpcclient/rpcclient.c

index 0e6c6c3f4f60de98468d7f2495f666dbc0d6d133..ac7576fc01750696eef4e1d6c55ff04e51bcfa2c 100644 (file)
@@ -943,6 +943,7 @@ out_free:
        uint32_t bflags = 0;
        const char *binding_string = NULL;
        char *user, *domain, *q;
+       const char *host;
 
        /* make sure the vars that get altered (4th field) are in
           a fixed location or certain compilers complain */
@@ -1075,6 +1076,8 @@ out_free:
                }
        }
 
+       host = dcerpc_binding_get_string_option(binding, "host");
+
        bflags = dcerpc_binding_get_flags(binding);
        if (bflags & DCERPC_CONNECT) {
                pipe_default_auth_level = DCERPC_AUTH_LEVEL_CONNECT;
@@ -1134,8 +1137,7 @@ out_free:
                set_cmdline_auth_info_username(rpcclient_auth_info, q+1);
        }
 
-
-       nt_status = cli_full_connection(&cli, lp_netbios_name(), binding->host,
+       nt_status = cli_full_connection(&cli, lp_netbios_name(), host,
                                        opt_ipaddr ? &server_ss : NULL, opt_port,
                                        "IPC$", "IPC",
                                        get_cmdline_auth_info_username(rpcclient_auth_info),