cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

small patches for ssh

From: Elliť Computing Open Source Program <opensource_at_elliecomputing.com>
Date: Thu, 22 Dec 2011 15:08:39 +0100

Hi,

here are two small fixes for SSH:

1. QUOTE mkdir should honor the option CURLOPT_NEW_DIRECTORY_PERMS

diff --git a/lib/ssh.c b/lib/ssh.c
index 329d6df..23ba5f4 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1400,7 +1400,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
     case SSH_SFTP_QUOTE_MKDIR:
       rc = libssh2_sftp_mkdir_ex(sshc->sftp_session, sshc->quote_path1,
                                  (unsigned int)strlen(sshc->quote_path1),
- 0755);
+ data->set.new_directory_perms);
       if(rc == LIBSSH2_ERROR_EAGAIN) {
         break;
       }

2. Links should have PATH_MAX room (not 80 chars)

diff --git a/lib/ssh.c b/lib/ssh.c
index 329d6df..9f3d388 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1810,7 +1810,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
         }
         else {
           sshc->readdir_currLen = (int)strlen(sshc->readdir_longentry);
- sshc->readdir_totalLen = 80 + sshc->readdir_currLen;
+ sshc->readdir_totalLen = PATH_MAX + sshc->readdir_currLen;
           sshc->readdir_line = calloc(sshc->readdir_totalLen, 1);
           if(!sshc->readdir_line) {
             Curl_safefree(sshc->readdir_filename);

I add them as attachment as well in case the mailer eats the patches.

Best regards
Armel

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2011-12-22

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET