cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 18 Feb 2014 11:20:34 +0100 (CET)

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
Received on 2014-02-18