does vsftpd support mlsd command if it supports how can i enable it? or is there any other way to get list of file names and timestamp from a directory using python ftplib? tried nlst it only gives files names and for each file i have to sent MDTM is there any way to avoid it?
Asked
Active
Viewed 2,620 times
1 Answers
4
No. It does not.
Source code lists the following features (in file features.c
):
void
handle_feat(struct vsf_session* p_sess)
{
vsf_cmdio_write_hyphen(p_sess, FTP_FEAT, "Features:");
if (tunable_ssl_enable)
{
if (tunable_sslv2 || tunable_sslv3)
{
vsf_cmdio_write_raw(p_sess, " AUTH SSL\r\n");
}
if (tunable_tlsv1)
{
vsf_cmdio_write_raw(p_sess, " AUTH TLS\r\n");
}
}
if (tunable_port_enable)
{
vsf_cmdio_write_raw(p_sess, " EPRT\r\n");
}
if (tunable_pasv_enable)
{
vsf_cmdio_write_raw(p_sess, " EPSV\r\n");
}
vsf_cmdio_write_raw(p_sess, " MDTM\r\n");
if (tunable_pasv_enable)
{
vsf_cmdio_write_raw(p_sess, " PASV\r\n");
}
if (tunable_ssl_enable)
{
vsf_cmdio_write_raw(p_sess, " PBSZ\r\n");
vsf_cmdio_write_raw(p_sess, " PROT\r\n");
}
vsf_cmdio_write_raw(p_sess, " REST STREAM\r\n");
vsf_cmdio_write_raw(p_sess, " SIZE\r\n");
vsf_cmdio_write_raw(p_sess, " TVFS\r\n");
vsf_cmdio_write_raw(p_sess, " UTF8\r\n");
vsf_cmdio_write(p_sess, FTP_FEAT, "End");
}
There's no MLSD
listed.
Also, here's a log of a session connecting with Python's ftplib to a vsftpd server:
*cmd* 'USER ftp'
*put* 'USER ftp\r\n'
*get* '230 Login successful.\n'
*resp* '230 Login successful.'
*cmd* 'TYPE A'
*put* 'TYPE A\r\n'
*get* '200 Switching to ASCII mode.\n'
*resp* '200 Switching to ASCII mode.'
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (127,0,0,1,159,93).\n'
*resp* '227 Entering Passive Mode (127,0,0,1,159,93).'
*cmd* 'MLSD'
*put* 'MLSD\r\n'
*get* '500 Unknown command.\n'
*resp* '500 Unknown command.'

cfi
- 10,915
- 8
- 57
- 103