Author Topic: Seeking advice on how to modify LIST command format  (Read 35 times)

Offline dadawan

  • New user
  • *
  • Posts: 2
    • View Profile
Seeking advice on how to modify LIST command format
« on: February 17, 2017, 03:24:04 pm »
Greetings to all.
I have been given the task of making Proftpd compatible with a special purpose client that I cannot modify. 

The client expects the response to the LIST command to have a very specific format which is very different from Proftpd's current response to the LIST command.   For example, the client expects the date to start at the 18th character on each line, and of course the date format itself is totally different.  :(

My question is,  what is the best way to approach this?  Is modifying the source code the only way?   Is it possible to use some sort of script to re-write the lines like mod_rewrite can modify the incoming commands from the client?


Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5221
    • View Profile
    • http://www.castaglia.org/
Re: Seeking advice on how to modify LIST command format
« Reply #1 on: February 17, 2017, 04:07:10 pm »
You will have to do some coding to make this happen; there are currently no configuration directives to make that sort of specialized change to the LIST response.  And using mod_rewrite to modify the commands from the client will not help, I think, because it is the response that you want to modify (and mod_rewrite does not work on responses).

Thus you can modify the modules/mod_ls.c source code, OR you can write your own module which handles the LIST command (before mod_ls can), and which returns the necessary format.

Offline dadawan

  • New user
  • *
  • Posts: 2
    • View Profile
Re: Seeking advice on how to modify LIST command format
« Reply #2 on: February 17, 2017, 04:45:02 pm »
Thanks very much for the advice!

 

sighted planning