ftpserverlib icon indicating copy to clipboard operation
ftpserverlib copied to clipboard

Returning 502 on REIN

Open sudhirj opened this issue 1 year ago • 3 comments

Fixes https://github.com/fclairamb/ftpserverlib/issues/472

Adds the REIN command, and returns a 502 status when it is received. This behaviour matches VSFTPD, and clients seem to choke when getting a 500 on a technically valid command.

EDIT: Have also added the NotImplemented handler for other standard commands that have not been implemented. We'd want to send a 502 for any commands that are actually standardised but not implemented, none of these would be syntax errors (500) by default.

sudhirj avatar Jul 30 '24 17:07 sudhirj

Addressed the linter warning, have renamed the param to _.

sudhirj avatar Aug 06 '24 08:08 sudhirj

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.75%. Comparing base (d9f0ff1) to head (c5b33a6). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
+ Coverage   86.73%   86.75%   +0.02%     
==========================================
  Files          11       11              
  Lines        1726     1729       +3     
==========================================
+ Hits         1497     1500       +3     
  Misses        155      155              
  Partials       74       74              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 06 '24 08:08 codecov[bot]

Have a test for REIN, but I've added the other unimplemented commands in as well. Let me know if we want a test for each of them or a group test, or if just a listing is enough?

sudhirj avatar Aug 06 '24 18:08 sudhirj

Sure, why not. This gives some idea of future commands to support.

fclairamb avatar Sep 28 '24 21:09 fclairamb