features.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Part of Very Secure FTPd
  3. * Licence: GPL v2
  4. * Author: Chris Evans
  5. * features.c
  6. *
  7. * Routines to tell the client what features we support.
  8. */
  9. #include "features.h"
  10. #include "ftpcodes.h"
  11. #include "ftpcmdio.h"
  12. #include "tunables.h"
  13. void
  14. handle_feat(struct vsf_session* p_sess)
  15. {
  16. vsf_cmdio_write_hyphen(p_sess, FTP_FEAT, "Features:");
  17. if (tunable_ssl_enable)
  18. {
  19. if (tunable_sslv2 || tunable_sslv3)
  20. {
  21. vsf_cmdio_write_raw(p_sess, " AUTH SSL\r\n");
  22. }
  23. if (tunable_tlsv1)
  24. {
  25. vsf_cmdio_write_raw(p_sess, " AUTH TLS\r\n");
  26. }
  27. }
  28. if (tunable_port_enable)
  29. {
  30. vsf_cmdio_write_raw(p_sess, " EPRT\r\n");
  31. }
  32. if (tunable_pasv_enable)
  33. {
  34. vsf_cmdio_write_raw(p_sess, " EPSV\r\n");
  35. }
  36. vsf_cmdio_write_raw(p_sess, " MDTM\r\n");
  37. if (tunable_pasv_enable)
  38. {
  39. vsf_cmdio_write_raw(p_sess, " PASV\r\n");
  40. }
  41. if (tunable_ssl_enable)
  42. {
  43. vsf_cmdio_write_raw(p_sess, " PBSZ\r\n");
  44. vsf_cmdio_write_raw(p_sess, " PROT\r\n");
  45. }
  46. vsf_cmdio_write_raw(p_sess, " REST STREAM\r\n");
  47. vsf_cmdio_write_raw(p_sess, " SIZE\r\n");
  48. vsf_cmdio_write_raw(p_sess, " TVFS\r\n");
  49. vsf_cmdio_write_raw(p_sess, " UTF8\r\n");
  50. vsf_cmdio_write(p_sess, FTP_FEAT, "End");
  51. }