diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-11 05:16:48 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-11 05:16:48 +0000 |
commit | 5ffe722a5585314cb1ba4533c0867c777e6b369b (patch) | |
tree | 77b74aa9223004d42fefa4da6fcb9d44d9ccb3e3 /source3/libsmb | |
parent | 66d964c9fca128d2e77e0cb1b704b25ab55b45ce (diff) | |
download | samba-5ffe722a5585314cb1ba4533c0867c777e6b369b.tar.gz samba-5ffe722a5585314cb1ba4533c0867c777e6b369b.tar.bz2 samba-5ffe722a5585314cb1ba4533c0867c777e6b369b.zip |
detect attempts to connect to names of the type NAME#xx and do a
netbios lookup for name NAME with node type xx.
This affects all our client progs. Very useful :)
(This used to be commit b4304c5231159fc6295c445f2eb4470c179b8d5e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cliconnect.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 512607fc11..27034b012d 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -975,11 +975,19 @@ open the client sockets BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip) { extern pstring user_socket_options; + int name_type = 0x20; + char *p; fstrcpy(cli->desthost, host); + + /* allow hostnames of the form NAME#xx and do a netbios lookup */ + if ((p = strchr(cli->desthost, '#'))) { + name_type = strtol(p+1, NULL, 16); + *p = 0; + } if (!ip || is_zero_ip(*ip)) { - if (!resolve_name( cli->desthost, &cli->dest_ip, 0x20)) { + if (!resolve_name(cli->desthost, &cli->dest_ip, name_type)) { return False; } if (ip) *ip = cli->dest_ip; @@ -1328,3 +1336,5 @@ name *SMBSERVER with error %s\n", desthost, cli_errstr(cli) )); return True; } + + |