From 4939a24cbc751719b008bdd474181fffabd33934 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Apr 2008 09:24:54 -0700 Subject: Fix the problem when -L is used with IPv6 addresses. Don't try to connect on port 139 with IPv6. Found by David Holder @ Erion. Karolin please merge to 3.2-stable. Jeremy. (This used to be commit c003e66ff10b23bb30aef0071ba7a3ae9579174e) --- source3/client/client.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index 882ed4dbdd..276ffb93d8 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4514,6 +4514,8 @@ static int process(const char *base_directory) static int do_host_query(const char *query_host) { + struct sockaddr_storage ss; + cli = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", true, smb_encrypt); if (!cli) @@ -4521,6 +4523,12 @@ static int do_host_query(const char *query_host) browse_host(true); + if (interpret_string_addr(&ss, query_host, 0) && (ss.ss_family != AF_INET)) { + d_printf("%s is an IPv6 address -- no workgroup available\n", + query_host); + return 1; + } + if (port != 139) { /* Workgroups simply don't make sense over anything -- cgit From 2a2188591b5ed922d09dc723adcf10f8b8f5e5a0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 19 Apr 2008 21:56:43 +0200 Subject: Add "desthost" to rpc_pipe_client This reduces the dependency on cli_state (This used to be commit 783afab9c891dd7bcb78895b2a639b6f3a0edf5b) --- source3/client/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index 276ffb93d8..1c9c21e979 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -3650,7 +3650,7 @@ static bool browse_host_rpc(bool sort) info_ctr.ctr.ctr1 = &ctr1; status = rpccli_srvsvc_NetShareEnumAll(pipe_hnd, frame, - pipe_hnd->cli->desthost, + pipe_hnd->desthost, &info_ctr, 0xffffffff, &total_entries, -- cgit From e73e8297f5484b6c7f525917679414c09a145cf0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 13:51:46 +0200 Subject: Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct (This used to be commit 99fc3283c4ecc791f5a242bd1983b4352ce3e6cf) --- source3/client/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index 1c9c21e979..b4e1985a83 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -3658,7 +3658,7 @@ static bool browse_host_rpc(bool sort) &werr); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(werr)) { - cli_rpc_pipe_close(pipe_hnd); + TALLOC_FREE(pipe_hnd); TALLOC_FREE(frame); return false; } @@ -3668,7 +3668,7 @@ static bool browse_host_rpc(bool sort) browse_fn(info.name, info.type, info.comment, NULL); } - cli_rpc_pipe_close(pipe_hnd); + TALLOC_FREE(pipe_hnd); TALLOC_FREE(frame); return true; } -- cgit