Package jcifs

Examples of jcifs.UniAddress$QueryThread


                    NtlmPasswordAuthentication auth) throws SmbAuthException {
        if (DISABLED)
            return null;

        try {
            UniAddress addr = UniAddress.getByName(domain, true);
            SmbTransport trans = SmbTransport.getSmbTransport(addr, 0);
            DfsReferral dr = trans.getDfsReferrals(auth, "\\" + domain, 1);
            if (dr != null) {
                DfsReferral start = dr;
                IOException e = null;
View Full Code Here


    static NbtAddress[] dc_list = null;
    static long dc_list_expiration;
    static int dc_list_counter;

    private static NtlmChallenge interrogate( NbtAddress addr ) throws SmbException {
        UniAddress dc = new UniAddress( addr );
        SmbTransport trans = SmbTransport.getSmbTransport( dc, 0 );
        if (USERNAME == null) {
            trans.connect();
            if (SmbTransport.log.level >= 3)
                SmbTransport.log.println(
View Full Code Here

import java.net.InetAddress;

public class Query {

    public static void main( String argv[] ) throws Exception {
        UniAddress ua;
        String cn;

        ua = UniAddress.getByName( argv[0] );

        cn = ua.firstCalledName();
        do {
            System.out.println( "calledName=" + cn );
        } while(( cn = ua.nextCalledName() ) != null );
    }
View Full Code Here

    protected final boolean doAuthentication(final Credentials credentials)
        throws AuthenticationException {
        final SpnegoCredentials ntlmCredentials = (SpnegoCredentials) credentials;
        final byte[] src = ntlmCredentials.getInitToken();

        UniAddress dc = null;

        try {

            if (this.loadBalance) {
              // find the first dc that matches the includepattern
              if(this.includePattern != null){
                NbtAddress [] dcs  = NbtAddress.getAllByName(this.domainController,0x1C, null,null);
                for(int i=0;i<dcs.length;i++){
                  if(dcs[i].getHostAddress().matches(this.includePattern)){
                    dc = new UniAddress(dcs[i]);
                    break;
                  }
                }
              }
              else
                dc = new UniAddress(NbtAddress.getByName(this.domainController,
                    0x1C, null));
            } else {
                dc = UniAddress.getByName(this.domainController, true);
            }
            final byte[] challenge = SmbSession.getChallenge(dc);
View Full Code Here

    public boolean authenticate(String password) {

        System.setProperty("jcifs.smb.client.disablePlainTextPasswords",
                            "false" );
        try {
            UniAddress mydomaincontroller = UniAddress.getByName(
                                                getDomainController());
            NtlmPasswordAuthentication mycreds = new
                                NtlmPasswordAuthentication(
                                        getDomainName(),
                                        super.getId(),
View Full Code Here

     */
    public boolean authenticate(String password) {

        System.setProperty("jcifs.smb.client.disablePlainTextPasswords", "true");
        try {
            UniAddress mydomaincontroller = UniAddress.getByName(getDomainController());
            NtlmPasswordAuthentication mycreds = new NtlmPasswordAuthentication(getDomainName(),
                    super.getId(), password);
            SmbSession.logon(mydomaincontroller, mycreds);
            // SUCCESS
            return true;
View Full Code Here

        log.log(loggingPriority, "initialized");
    }

    public Subject authenticate(String userId, String password) throws AuthenticationException {
        try{
            UniAddress dc = UniAddress.getByName( domainController, true );

            NtlmPasswordAuthentication ntlm =
                new NtlmPasswordAuthentication(domain, userId, password);

            SmbSession.logon( dc, ntlm );
View Full Code Here

            do {
                try {
                    if (log.level >= 2)
                        log.println("DFS redirect: " + dr);

                    UniAddress addr = UniAddress.getByName(dr.server);
                    SmbTransport trans = SmbTransport.getSmbTransport(addr, url.getPort());
                    /* This is a key point. This is where we set the "tree" of this file which
                     * is like changing the rug out from underneath our feet.
                     */
/* Technically we should also try to authenticate here but that means doing the session setup and tree connect separately. For now a simple connect will at least tell us if the host is alive. That should be sufficient for 99% of the cases. We can revisit this again for 2.0.
View Full Code Here

            }
            String address = queryLookup(query, "address");
            if (address != null && address.length() > 0) {
                byte[] ip = java.net.InetAddress.getByName(address).getAddress();
                addresses = new UniAddress[1];
                addresses[0] = new UniAddress(java.net.InetAddress.getByAddress(host, ip));
                return getNextAddress();
            }
        }

        if (host.length() == 0) {
View Full Code Here

        }

        return getNextAddress();
    }
    UniAddress getNextAddress() {
        UniAddress addr = null;
        if (addressIndex < addresses.length)
            addr = addresses[addressIndex++];
        return addr;
    }
View Full Code Here

TOP

Related Classes of jcifs.UniAddress$QueryThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.