|
|
Subject: Re: SmbSession.logon() trouble - msg#00081
List: network.samba.java
Sebastian Rehbach said:
>
> Hi,
>
> we are trying to use the JCIFS method SmbSession.logon() to do a user
> logon
> at a given domain controller. And that's the problem we have:
>
> When we try to logon to a domain with a given user and password everything
> is fine as long as the username is known by the domain controller. If
> username and password are correct, no exception is thrown and the user is
> logged on. If username is listed at the domain controller but the paasword
> is not correct, an exception is thrown. That's fine, too.
>
> But, if you enter a random username and a random password and pass it to
> the
> domain controller using SmbSession.logon(), no exception is thrown.
>
> What's going wrong?
Mmm, I don't know. Can you please send me a packet capture?
http://jcifs.samba.org/capture.html
What does getRemoteUser return?
>
> We are using jCIFS 0.90b (we have tested jCIFS 0.90 with the same
> results).
Can you try the 0.8 jar?
> As a domain controller we are using SuSE Linux Professional 9 with Samba
> 2.2.8a-SuSE (which is required, 'cause we don't have a Windows NT / 2000
> domain controller but there will be one in our productive environment)
Shouldn't matter.
Mike
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: jcifs-0.9.0 released / Documentation
eglass1@xxxxxxxxxxx said:
> Mike,
>
> Lines 147-148 in 0.9.0's NtlmHttpFilter should probably be removed:
>
> resp.sendRedirect( req.getRequestURL().toString() );
> return;
>
> Sending a redirect can have funky consequences for non-GET or HEAD
> requests
> (i.e. POST). Letting this just fall through to reinitiate the NTLM auth
> would save a roundtrip anyway (as when the client redirects, the filter
> will
> look for and not find the NPA in the session and demand authentication).
Mmm, I believe you might be right. I think the redirect came from working
out DFS referreral -> HTTP redirect and I just copied it over. In theory
it that condition shouldn't occur anyway because the presence of the NPA
in the HttpSession should bypass the logon so this isn't a show stopper.
I'll take a look...
Thanks,
Mike
Next Message by Date:
click to view message preview
Re: SmbSession.logon() trouble
Sebastian Rehbach said:
> As a domain controller we are using SuSE Linux Professional 9 with Samba
> 2.2.8a-SuSE (which is required, 'cause we don't have a Windows NT / 2000
> domain controller but there will be one in our productive environment)
>
> The java class we are using to test and to demonstrate the problem is
> attached ...
I just wrote something just like this and it worked fine against samba
2.2.7 on RH 7.3.
[miallen@quark jcifs]$ cat Logon.java
import jcifs.*;
import jcifs.smb.*;
public class Logon {
public static void main( String argv[] ) throws Exception {
NtlmPasswordAuthentication auth = new
NtlmPasswordAuthentication( argv[1], argv[2], argv[3] );
SmbSession.logon( UniAddress.getByName( argv[0] ), auth );
}
}
[miallen@quark jcifs]$ java Logon nano dom foo bar
Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure:
unknown user name or bad password.
at jcifs.smb.SmbTransport.send(SmbTransport.java:655)
at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:178)
at jcifs.smb.SmbSession.send(SmbSession.java:138)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:134)
at jcifs.smb.SmbSession.logon(SmbSession.java:75)
at Logon.main(Logon.java:9)
Does this program fail for you?
Is there some setting on samba that causes failed logons to default to
GUEST or some such? Try giving a regular Windows workstation for the dc
parmeter.
Mike
Previous Message by Thread:
click to view message preview
SmbSession.logon() trouble
Hi,
we are trying to use the JCIFS method SmbSession.logon() to do a user logon
at a given domain controller. And that's the problem we have:
When we try to logon to a domain with a given user and password everything
is fine as long as the username is known by the domain controller. If
username and password are correct, no exception is thrown and the user is
logged on. If username is listed at the domain controller but the paasword
is not correct, an exception is thrown. That's fine, too.
But, if you enter a random username and a random password and pass it to the
domain controller using SmbSession.logon(), no exception is thrown.
What's going wrong?
We are using jCIFS 0.90b (we have tested jCIFS 0.90 with the same results).
As a domain controller we are using SuSE Linux Professional 9 with Samba
2.2.8a-SuSE (which is required, 'cause we don't have a Windows NT / 2000
domain controller but there will be one in our productive environment)
The java class we are using to test and to demonstrate the problem is
attached ...
Thanks in advance ...
Sebastian
The class we are using:
import jcifs.*; // Import root folder utils
import jcifs.smb.*; // Import SMB API
import java.net.UnknownHostException;
public class smbLogonTest {
private static NtlmPasswordAuthentication user_id;
// User ID
private static SmbSession session;
// Server Session
/* MAIN method, for testing purposes only !!!! */
public static void main(String args[]) {
boolean result;
UniAddress domain_controller = new UniAddress("2.46.127.19");
System.out.println("Initializing ...");
try {
domain_controller = UniAddress.getByName("2.46.127.19");
} catch( UnknownHostException e) {
e.printStackTrace();
}
NtlmPasswordAuthentication user_id = new
NtlmPasswordAuthentication("RUMBA", "iamu", "trix");
// session = new SmbSession(domain_controller, 396, "2.46.127.19",
396, user_id);
try {
session.logon(domain_controller, user_id);
}
catch(Exception e) {
System.out.println("Failed ...");
e.printStackTrace();
}
System.out.println("Finished ...");
}
}
Next Message by Thread:
click to view message preview
Re: SmbSession.logon() trouble
Sebastian Rehbach said:
> As a domain controller we are using SuSE Linux Professional 9 with Samba
> 2.2.8a-SuSE (which is required, 'cause we don't have a Windows NT / 2000
> domain controller but there will be one in our productive environment)
>
> The java class we are using to test and to demonstrate the problem is
> attached ...
I just wrote something just like this and it worked fine against samba
2.2.7 on RH 7.3.
[miallen@quark jcifs]$ cat Logon.java
import jcifs.*;
import jcifs.smb.*;
public class Logon {
public static void main( String argv[] ) throws Exception {
NtlmPasswordAuthentication auth = new
NtlmPasswordAuthentication( argv[1], argv[2], argv[3] );
SmbSession.logon( UniAddress.getByName( argv[0] ), auth );
}
}
[miallen@quark jcifs]$ java Logon nano dom foo bar
Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure:
unknown user name or bad password.
at jcifs.smb.SmbTransport.send(SmbTransport.java:655)
at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:178)
at jcifs.smb.SmbSession.send(SmbSession.java:138)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:134)
at jcifs.smb.SmbSession.logon(SmbSession.java:75)
at Logon.main(Logon.java:9)
Does this program fail for you?
Is there some setting on samba that causes failed logons to default to
GUEST or some such? Try giving a regular Windows workstation for the dc
parmeter.
Mike
|
|