oh !  thank you very much , this patch fix this bug , I run my test code , the 
second function does not list dir .


By the way, it fix the bug about execute command more than one time for 
example: rm   rename   mkdir   rmdir






------------------ Original ------------------
From:  "daniel";<[email protected]>;
Date:  Tue, Feb 18, 2014 06:20 PM
To:  "libcurl development"<[email protected]>; 

Subject:  Re: ?????? mkdir or rmdir operation with libcurl on sftp



On Tue, 18 Feb 2014, ?????? wrote:

> I use the libcurl command 'mkdir' or 'rmdir' , it will list the directory 
> before the operation .so I set the NOBODY 1L to prevent from listing . But 
> when I 'mkdir' or 'rmdir' twice,the second NOBODY seem to be not work , when 
> I execute the second operation, it always list the directory.

I looks like a bug. Can you confirm if this patch fixes it for you as it did 
for me?

diff --git a/lib/ssh.c b/lib/ssh.c
index f1e026e..00479c8 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1808,8 +1808,10 @@ static CURLcode ssh_statemach_act(struct connectdata 
*conn, bool *b

      case SSH_SFTP_READDIR_INIT:
        Curl_pgrsSetDownloadSize(data, -1);
-      if(data->set.opt_no_body)
+      if(data->set.opt_no_body) {
          state(conn, SSH_STOP);
+        break;
+      }

        /*
         * This is a directory that we are trying to get, so produce a directory


-- 

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

Reply via email to