diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-08-14 05:56:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:57:59 -0500 |
commit | 64082214337e2ab50f0a69ca7f9bcf56762129cc (patch) | |
tree | bf861a24299291ad3607df0b40b749ae67545960 /source4/libcli/raw | |
parent | 350673b2d0106191e6bdb65772f70cae5abafacb (diff) | |
download | samba-64082214337e2ab50f0a69ca7f9bcf56762129cc.tar.gz samba-64082214337e2ab50f0a69ca7f9bcf56762129cc.tar.bz2 samba-64082214337e2ab50f0a69ca7f9bcf56762129cc.zip |
r1819: changed "smb ports" to be a LIST parameter type in loadparm (its a classic case for a list)
(This used to be commit e53d32c65ab0751b3e01f4f699f5d0e1892369ae)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/clisocket.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index 78d37b9be1..b09bebf133 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -62,8 +62,15 @@ BOOL smbcli_sock_connect(struct smbcli_socket *sock, struct in_addr *ip, int por } if (port == 0) { - return smbcli_sock_connect(sock, ip, 445) || - smbcli_sock_connect(sock, ip, 139); + int i; + const char **ports = lp_smb_ports(); + for (i=0;ports[i];i++) { + int port = atoi(ports[i]); + if (port != 0 && smbcli_sock_connect(sock, ip, port)) { + return True; + } + } + return False; } sock->dest_ip = *ip; |