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

Attachment: ssh-link-max-path.patch
Description: Binary data

Attachment: ssh-new-dir-perms.patch
Description: Binary data

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

Reply via email to