The AS400FTP object does not always send '\r\n' when sending the USERID and PASSWORD. The code should be changed so that the '\r\n' is always sent.
Specifically. the following code needs to be changed.
in AS400ImplRemote.java -- the writer.println should be changed to writer.print and the "\r\n" should be added. I also suspect that a flush will also be needed after the writer.print
// Get connection for FTP.
synchronized Socket getConnection(int port) throws IOException {
Socket socket = new Socket((systemNameLocal_) ? "localhost" : systemName_,
port);
try {
PortMapper.setSocketProperties(socket, socketProperties_);
BufferedReader reader = new BufferedReader(new InputStreamReader(
socket.getInputStream(), "ISO8859_1"));
PrintWriter writer = new PrintWriter(new OutputStreamWriter(
socket.getOutputStream(), "ISO8859_1"), true);
readFTPLine(reader);
writer.println("USER " + userId_);
readFTPLine(reader);
writer.println("PASS "
+ new String(BinaryConverter.byteArrayToCharArray(credVault_
.getClearCredential())));
if (!readFTPLine(reader).startsWith("230"))
throw new IOException();
return socket;
} catch (IOException e) {
Trace.log(Trace.ERROR, "Establishing FTP connection failed:", e);
try {
socket.close();
} catch (IOException ee) {
Trace.log(Trace.ERROR, "Error closing socket:", ee);
}
throw e;
}
}
Diff:
Fixed in JTOpen 11.1