Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1. WINS 2. anonymous access #230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

1. WINS 2. anonymous access #230

wants to merge 2 commits into from

Conversation

zc2com
Copy link

@zc2com zc2com commented May 29, 2020

NameServiceClientImpl.java

While debugging I was quite frustrating that the master browser is constantly migrates between my network's nodes, so I decided to try to setup a WINS server. However, I noticed JCIFS-NG never tries to access it even though jcifs.resolveOrder is set to "WINS".
This apparently happens because the method NameServiceClientImpl.send() only calls getWINSAddress() after the first failed attempt, not before.

NtlmContext.java

Regarding the issue 186
NtlmPasswordAuthenticator.isAnonymous() returns true only if the credentials are empty strings. However, empty strings cannot be used for access a passwordless share. That prevents anonymous access.

zc2com added 2 commits May 29, 2020 16:01
WINS was not used even when explicitly specified in jcifs.netbios.wins
NtlmPasswordAuthenticator.isAnonymous() returns true only if the credentials are empty strings. However, empty strings cannot be used for access a passwordless share.
@zc2com zc2com changed the title NameServiceClientImpl.java - WINS was not used even when explicitly specified in "jcifs.netbios.wins" WINS and anonymous access Jun 2, 2020
@zc2com zc2com changed the title WINS and anonymous access 1. WINS 2. anonymous access Jun 2, 2020
@mbechler
Copy link
Contributor

mbechler commented Jun 6, 2020

In my tests and diagnostics request.address is always already set by the calling method. Can you share a reproducer?

@zc2com
Copy link
Author

zc2com commented Jun 7, 2020

I just set the WINS properties and then just request the content of the root ("smb://").

prop.put( "jcifs.resolveOrder", "WINS" );
prop.put( "jcifs.netbios.wins", "192.168.1.2" );
......
smbFile = new SmbFile( "smb://", ctx );

In NameServiceClientImpl.send() it asks the number of WINS servers, but then
it still tries to do a broadcast (request.addr == /255.255.255.255 ).
On the next calls of the method send() request.addr is already equal to my WINS server, as well as if I initially asked not the "smb://" but "smb://WORKGROUP/" or anything else. So, it is reproducible only for "smb://".

I am attaching some source code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants