cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl MLST

From: Алексей Тумакаев <alexeytk_at_bk.ru>
Date: Sun, 07 Feb 2016 13:15:54 +0300

 Hello, i'm trying to get filelists from 2 ftp servers using MLST request, but it doesn't work

Version:  libcurl/7.23.1 OpenSSL/0.9.8r zlib/1.2.5 libssh2/1.3.0
Protocols:  dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp

1)

 - FTP (MLST is commented)

curl_easy_setopt_function(curl, CURLOPT_WRITEFUNCTION, GetFileList);
curl_easy_setopt(curl, CURLOPT_URL, "ftp://xxxxx.myarena.ru/");
curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:xxx");
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
//curl_easy_setoptg(curl, CURLOPT_CUSTOMREQUEST , "MLST");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_perform_thread(curl, onCompleteFilelist, 1);
r esult:

* About to connect() to xxx.xxx.xxx.xxx port 21 (#0)
* Trying 46.174.49.3...
* connected
Executing dedicated server config file server.cfg
< 220 ProFTPD 1.3.3g Server (MyArena.ru) [::ffff:xxx.xxx.xxx.xxx]
> AUTH SSL
< 500 AUTH not understood
> AUTH TLS
< 500 AUTH not understood
> USER user
< 331 Password required for noob
> PASS password
< 230 User noob logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> EPSV
Connect data stream passively
< 229 Entering Extended Passive Mode (|||8137|)
* Trying xxx.xxx.xxx.xxx... * connected
* Connecting to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 8137
> TYPE A
< 200 Type set to A
> LIST
< 150 Opening ASCII mode data connection for file list
* Maxdownload = -1
DATA:
STR - drwxr-x--x 7 noob noob 4096 Jan 31 18:18 .
drwxr-x--x 7 noob noob 4096 Jan 31 18:18 ..
-rw-r--r-- 1 noob noob 11 Dec 2 18:33 .codepage
drwxr-x--x 2 noob noob 4096 Jul 9 2015 email
drwxr-xr-x 2 noob noob 4096 Jul 9 2015 etc
drwxr-x--x 2 noob noob 4096 Feb 6 21:04 logs
drwxrwxrwx 2 noob noob 40960 Feb 7 06:50 mod-tmp
lrwxrwxrwx 1 noob noob 7 Jul 9 2015 tmp -> mod-tmp
drwxr-x--x 3 noob noob 4096 Aug 23 16:31 www
* Failed writing body (0 != 561)
* Remembering we are in dir ""
< 226 Transfer complete
> QUIT
< 221 Goodbye.
* Closing connection #0

 - FTP (MLST is not commented)

r esult:
* About to connect() to xxx.xxx.xxx.xxx port 21 (#0)
* Trying xxx.xxx.xxx.xxx... * connected
< 220 ProFTPD 1.3.3g Server (MyArena.ru) [::ffff:xxx.xxx.xxx.xxx]
> AUTH SSL
< 500 AUTH not understood
> AUTH TLS
< 500 AUTH not understood
> USER user
< 331 Password required for noob
> PASS password
< 230 User noob logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> EPSV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||55794|)
* Trying xxx.xxx.xxx.xxx...
* connected
* Connecting to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 55794
> TYPE A
< 200 Type set to A
> MLST
< 250-Start of list for /
< /
< 250 End of list
* RETR response: 250
* Remembering we are in dir ""
* Connection #0 to host spr1an.myarena.ru left intact
> QUIT
< 221 Goodbye.
* Closing connection #0

Why MLST is empty?

1)  
- SFTP (MLST is not commented)

curl_easy_setopt(curl, CURLOPT_URL, "sftp://xxxxxxxx:5000/");
curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:xxx");
curl_easy_setopt_function(curl, CURLOPT_WRITEFUNCTION, GetFileList);
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST , "MLST");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_perform_thread(curl, onCompleteFilelist, 1); result:

* About to connect() to xxx.xxx.xxx.xxx port 5000 (#0)
* Trying xxx.xxx.xxx.xxx...
* connected
* SSH authentication methods available: publickey,gssapi-keyex,gssapi-with-mic,password
* Using ssh public key file id_dsa.pub
* Using ssh private key file id_dsa
* SSH public key authentication failed: Unable to open public key file
* Initialized password authentication
* Authentication complete
DATA:
drwxr-xr-x 11 root root 0 Mar 27 2014 sys
* Connection #0 to host xxx.xxx.xxx.xxx left intact
* Closing connection #0 In this case curl doesn't try to execute MLST command.

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-02-07