diff options
author | Volker Lendecke <vl@samba.org> | 2011-05-29 00:59:12 +0200 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-05-29 10:11:54 +0200 |
commit | edfa62f2a0f42440d7a17d519c281f28d623a602 (patch) | |
tree | a6e08f6114a518bad471a404afd59096d66ef6c9 /source3 | |
parent | 8a3199e00de3e138d36b99043703938482192ed7 (diff) | |
download | samba-edfa62f2a0f42440d7a17d519c281f28d623a602.tar.gz samba-edfa62f2a0f42440d7a17d519c281f28d623a602.tar.bz2 samba-edfa62f2a0f42440d7a17d519c281f28d623a602.zip |
s3: Use cli_connect_nb in do_message_op
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun May 29 10:11:54 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/client.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 45494efe62..7cffddb76c 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -5037,46 +5037,16 @@ static int do_tar_op(const char *base_directory) static int do_message_op(struct user_auth_info *a_info) { - struct sockaddr_storage ss; - struct nmb_name called, calling; - fstring server_name; - char name_type_hex[10]; - int msg_port; NTSTATUS status; - make_nmb_name(&calling, calling_name, 0x0); - make_nmb_name(&called , desthost, name_type); - - strlcpy(server_name, desthost,sizeof(server_name)); - snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type); - strlcat(server_name, name_type_hex,sizeof(server_name)); - - zero_sockaddr(&ss); - if (have_ip) - ss = dest_ss; - - /* we can only do messages over port 139 (to windows clients at least) */ - - msg_port = port ? port : 139; - - if (!(cli=cli_initialise())) { - d_printf("Connection to %s failed\n", desthost); - return 1; - } - cli_set_port(cli, msg_port); - - status = cli_connect(cli, server_name, &ss); + status = cli_connect_nb(desthost, have_ip ? &dest_ss : NULL, + port ? port : 139, name_type, + calling_name, Undefined, &cli); if (!NT_STATUS_IS_OK(status)) { d_printf("Connection to %s failed. Error %s\n", desthost, nt_errstr(status)); return 1; } - if (!cli_session_request(cli, &calling, &called)) { - d_printf("session request failed\n"); - cli_shutdown(cli); - return 1; - } - send_message(get_cmdline_auth_info_username(a_info)); cli_shutdown(cli); |