quarkslab / irma-brain

IRMA brain
21 stars 4 forks source link

NLST FTP command output format #17

Open fmonjalet opened 8 years ago

fmonjalet commented 8 years ago

Hi,

When using vsftpd rather than pureftpd in IRMA, there is an issue with the file deletion. For example, the brain tries to delete the file fontend/dir1/frontend/dir1/file1 instead of frontend/dir1/file1.

The root of the problem seems to be that the return format of NLST frontend for vsftpd is:

frontend/dir1
frontend/dir2
frontend/dir3

and not:

dir1
dir2
dir3

which seems to be the format returned by pureftpd (according to the irma code, could you confirm?). I would say that both implementations can be OK, since the FTP RFCs are pretty ambiguous.

This means that to be implementation independent, irma.ftp.handler.FtpTls.list should either cd to the path, list the cwd (NLST without any argument) and cd back to the old cwd, or only keep the basename of the paths retrieved from ftps.nlst(path).

I think that being able to use any FTP implementation is quite an interesting point in such a modular architecture, and vsftpd is known to be a really good one. What do you think?

Florent

ch0k0bn commented 8 years ago

I confirm that on pure-ftp NLST frontend output dir1 dir2 dir3 and not frontend/dir1 frontend/dir2 frontend/dir3

ch0k0bn commented 8 years ago

sftp will be default transport soon: f2298da267d25c164daea2a3d5f08d0a8030a77a