[jcifs] Account Locking

Rick Poleshuck RickPoleshuck at gmail.com
Fri Apr 9 08:08:33 MDT 2010


There is a problem with SmbFile.connect() when the target has more than one IP
address and the target implements account locking on repetitive Auth Exceptions.
I have fixed the problem in my copy of the source. 

 public void connect() throws IOException {
        SmbTransport trans;
        SmbSession ssn;
        UniAddress addr;

        if( isConnected() ) {
            return;
        }

        getUncPath0();
        getFirstAddress();
        for ( ;; ) {
            try {
                doConnect();
                return;
	    } catch(SmbAuthException sae) {
		throw sae; // Fail on first Auth exception, otherwise account could get locked
            } catch(SmbException se) {
                if (getNextAddress() == null) 
                    throw se;
                if (log.level >= 3)
                    se.printStackTrace(log);
            }
        }
    }



More information about the jCIFS mailing list