[jcifs] Re: [followup] Error connecting to server in SmbTransport
Michael B Allen
mba2000 at ioplex.com
Wed Sep 21 16:32:07 GMT 2005
On Wed, 21 Sep 2005 10:52:43 -0300
Luis Fernando Pollo <lpollo at tlantic.com.br> wrote:
> I also saw that the doConnect() method in SmbTransport.java has kind of a
> "fail-over" behavior when it tires to negotiate(), falling back to port 445
> or 139, depending on what was previously set (in my case, 445, since the
> original port was 0). Now, shouldn't it try to use the default port (that
> I'm assuming is 445) in the first place? That would make it fall back to 139
> if there was an error. Port 0 is reserved, anyway... I seemed weird to me
> that the overloaded logon() method in SmbSession is using 0 for the port
> number...
>
>
>
> Anyway, I changed the code in SmbSession.java to the following:
>
>
>
> public static void logon( UniAddress dc,
>
> NtlmPasswordAuthentication auth ) throws
> SmbException {
>
> logon(dc, SmbConstants.DEFAULT_PORT, auth);
>
> }
>
>
>
> Then, in my case, the first attempt at port 445 fails, which makes it fall
> back to port 139, and that works fine.
Thats the LOCAL port. A local port of 0 means "any". I think this is
definately a firewall issue. If your firewall is really this anal on
purpose then you can also set jcifs.smb.client.lport rather than hack
the code. But with a firewall like that I think this is going to be the
least of your problems.
Mike
More information about the jcifs
mailing list