From 64082214337e2ab50f0a69ca7f9bcf56762129cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Aug 2004 05:56:12 +0000 Subject: 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) --- source4/libcli/raw/clisocket.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/libcli/raw') 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; -- cgit