[jcifs] SmbSession.logon() trouble

Sebastian Rehbach sebastian.rehbach at ixult.com
Fri May 28 13:33:00 GMT 2004


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 ...");


	}
}



More information about the jcifs mailing list