lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 159 forks source link

Problem sending ACCT command to server after logon #655

Open ariabamdad opened 2 years ago

ariabamdad commented 2 years ago

Hi,

When connecting to an FTP server on IBM z/VM operating system, if you CD to a resource disk that requires password authentication the server responds with a 332 message after the CD command and expects the client to send an ACCT command with the password. However, lftp appears to not react properly and closes the connection. I found no other way to supply an ACCT command along with the CD command as one action. Also, the available ftp:acct is not helpful because the ACCT command is expected to be sent after the 332 message is issued and not at login.

Additionally, as you can see from the debug log below, lftp appears to first concatenate the provided path for the CD command to the current active directory path before resorting to sending the path as provided. May be nice to provide a method of sending the CD command as-is.

<--- 220 Connection will close if idle for more than 5 minutes. ---> FEAT <--- 211-Extensions supported: <--- SIZE <--- AUTH TLS <--- PBSZ <--- PROT <--- 211 END ---> USER testuser <--- 331 Send password please. ---> PASS XXXX <--- 230 TESTUSER logged in; working directory = SFS:TESTUSER. ---> PWD <--- 257 "SFS:TESTUSER." is working directory ---- CWD path to be sent is `~/SFS:TESTUSER./otheruser.291' ---> CWD SFS:TESTUSER. <--- 250 SFS working directory is SFS:TESTUSER. ---> CWD otheruser.291 <--- 332 Supply minidisk password using the ACCT command ---> QUIT <--- 221 Quit command received. Goodbye. ---- Closing control socket cd: Fatal error: max-retries exceeded (332 Supply minidisk password using the ACCT command)

In the above, the client issued 'cd otheruser.291' but should have then been allowed to issue 'ACCT password' afterwards. A temporary workaround for this is to use quote command:

quote cd otheruser.291 quote acct password cache flush

Thank you.