Fix bug 7627 - smbclient ignores "-I" when used with "-L", fails name resolution.
authorJeremy Allison <jra@samba.org>
Fri, 20 Aug 2010 22:57:08 +0000 (15:57 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 20 Aug 2010 22:57:08 +0000 (15:57 -0700)
Still needs some more work to fix missing netbios name issues, but fixes
underlying issue of IP address being ignored.

Jeremy.

source3/client/client.c

index ce5b4e6323a5fa33d6a82a9f513bdc12f62d8560..0ce446115ffb076a8a31377a03d1de6c7d885a35 100644 (file)
@@ -4687,7 +4687,7 @@ static int process(const char *base_directory)
 static int do_host_query(const char *query_host)
 {
        cli = cli_cm_open(talloc_tos(), NULL,
-                       query_host, "IPC$", auth_info, true, smb_encrypt,
+                       have_ip ? dest_ss_str : query_host, "IPC$", auth_info, true, smb_encrypt,
                        max_protocol, port, name_type);
        if (!cli)
                return 1;
@@ -4713,7 +4713,8 @@ static int do_host_query(const char *query_host)
 
                cli_shutdown(cli);
                cli = cli_cm_open(talloc_tos(), NULL,
-                               query_host, "IPC$", auth_info, true, smb_encrypt,
+                               have_ip ? dest_ss_str : query_host, "IPC$",
+                               auth_info, true, smb_encrypt,
                                max_protocol, 139, name_type);
        }