cURL / Mailing Lists / curl-library / Single Mail

curl-library

Newbie question

From: Juan Carlos Franzoy <jfranzoy_at_gmail.com>
Date: Thu, 9 Dec 2010 17:25:54 -0300

Hello. Thanks for reading this message. I apologize if this is not the place
for this question.

We've been using libcurl for years in one of our libraries. It always worked
as expected. But now we are facing a problem. Pre-quote is not executed when
we download a file with SFTP. Any idea about what can be happening?

Thanks in advance.

DETAILS

We are using the easy interface. Se options we set, in order are:
- CURLOPT_VERBOSE = 1
- CURLOPT_NOSIGNAL = 1
- CURLOPT_USERPWD = user:password
- CURLOPT_TRANSFERTEXT = 1
- CURLOPT_CRLF = 1
- CURLOPT_DEBUGFUNCTION = &my_debug_function
- CURLOPT_DEBUGDATA = this
- CURLOPT_URL = sftp://myhost/my_home_dir/
- CURLOPT_DIRLISTONLY = 1
- CURLOPT_WRITEFUNCTION = &my_dir_list_parser_function
- in this point curl_easy_perform() is executed succesfully
- CURLOPT_WRITEFUNCTION = 0
- CURLOPT_DIRLISTONLY = 0
- CURLOPT_URL = sftp://myhost/my_home_dir/my_file_name
- CURLOPT_READDATA = FILE*
- CURLOPT_PREQUOTE = NULL
- CURLOPT_POSTQUOTE = NULL
- CURLOPT_PUT = 1
- in this point curl_easy_perform() is executed succesfully
- CURLOPT_PUT = 0
- CURLOPT_POSTQUOTE = NULL
- CURLOPT_PREQUOTE = NULL
- CURLOPT_READDATA = NULL
- CURLOPT_URL = sftp://myhost/my_home_dir/my_file_name
- CURLOPT_WRITEDATA = FILE*
- CURLOPT_PREQUOTE = chmod 777 /my_home_dir/my_file_name
- CURLOPT_POSTQUOTE = NULL
- in this point curl_easy_perform() is executed successfully but PREQUOTE is
NOT executed

This is what my_debug_function receives:
SFTP: * About to connect() to 127.0.0.1 port 22 (#0)
SFTP: * Trying 127.0.0.1...
SFTP: * connected
SFTP: * Connected to 127.0.0.1 (127.0.0.1) port 22 (#0)
SFTP: * SSH authentication methods available:
gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
SFTP: * Using ssh public key file
/export/home/ATS-AR/jfranzoy/.ssh/id_dsa.pub
SFTP: * Using ssh private key file /export/home/ATS-AR/jfranzoy/.ssh/id_dsa
SFTP: * SSH public key authentication failed: Unable to open public key
file
SFTP: * Initialized keyboard interactive authentication
SFTP: * Authentication complete
SFTP: DATA_OUT:2e
|. |
SFTP: DATA_OUT:2e 2e
|.. |
SFTP: * Connection #0 to host 127.0.0.1 left intact
SFTP: * Re-using existing connection! (#0) with host 127.0.0.1
SFTP: * Connected to 127.0.0.1 (127.0.0.1) port 22 (#0)
SFTP: DATA_OUT:53 61 6c 75 64 6f 73
|Saludos |
SFTP: * Connection #0 to host 127.0.0.1 left intact
SFTP: * Re-using existing connection! (#0) with host 127.0.0.1
SFTP: * Connected to 127.0.0.1 (127.0.0.1) port 22 (#0)
SFTP: DATA_IN:53 61 6c 75 64 6f 73
|Saludos |
SFTP: * Connection #0 to host 127.0.0.1 left intact
SFTP: * Closing connection #0

Notes:
   infotype == CURLINFO_TEXT prefixed with SFTP: *
   infotype == CURLINFO_DATA_IN prefixed with SFTP: DATA_IN:
   infotype == CURLINFO_DATA_OUT prefixed with SFTP: DATA_OUT:

-- 
  Juan Carlos Franzoy
Licenciado en Sistemas

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-09