Author: rwinston Date: Wed Jun 6 16:41:10 2007 New Revision: 544992 URL: http://svn.apache.org/viewvc?view=rev&rev=544992 Log: NET-158: Try to handle intermediate return code during authentication
Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java?view=diff&rev=544992&r1=544991&r2=544992 ============================================================================== --- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java Wed Jun 6 16:41:10 2007 @@ -664,7 +664,16 @@ if (!FTPReply.isPositiveIntermediate(_replyCode)) return false; - return FTPReply.isPositiveCompletion(pass(password)); + int replyCode = pass(password); + boolean replyOk = FTPReply.isPositiveCompletion(replyCode); + + // Work around stupid servers that send a 451 here + if (!replyOk && (replyCode == FTPReply.ACTION_ABORTED)) { + replyCode = getReply(); + replyOk = FTPReply.isPositiveCompletion(replyCode); + } + + return replyOk; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]