[Pkg-samba-maint] Bug#614697: smbclient fails with NT_STATUS_BAD_NETWORK_NAME when using ip address

Sebastian Kricner sebastian.kricner at web.de
Wed Feb 23 14:57:57 UTC 2011


Hello,

it seems to be a logical mistake in smbclient, which is not made by
Debian but by the Samba devloper group.

popt first retrieves the arguments, setting in case of the "-L" option
the query_host variable. popt also retrieves in case of the "-I" option
the argument and sets a boolean variable have_ip.

In some operations of the smbclient there is the have_ip used like so:

                cli = cli_cm_open(talloc_tos(), NULL,
                                have_ip ? dest_ss_str : desthost,
                                service, auth_info,
                                true, smb_encrypt,
                                max_protocol, port, name_type);

But in do_host_query it is done in that way:

        cli = cli_cm_open(talloc_tos(), NULL,
                        query_host, "IPC$", auth_info, true,
        smb_encrypt, max_protocol, port, name_type);

In this case smbclient just takes the argument of the "-L" parameter
and tries to open that host, which also is successful, but failing
because the ressource name is wrong:

session request to *SMBSERVER failed (Called name not present)

This is because do_host_query uses the ip address to connect to and as
the netbios name of the remote server. The ip address does not match
with the netbios name.

Thus it is to confirm that smbclient ignores the -I option and suggest
to report it to the samba team.

cli_cm_open would need to have an extra parameter with the netbios
name, so that it is possible to connect to an ip address but have set
the correct ressource name.








More information about the Pkg-samba-maint mailing list