]> granicus.if.org Git - curl/commitdiff
SFTP: skip reading the dir when NOBODY=1
authorDaniel Stenberg <daniel@haxx.se>
Tue, 18 Feb 2014 10:21:13 +0000 (11:21 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Feb 2014 09:40:28 +0000 (10:40 +0100)
When asking for an SFTP directory with NOBODY set, no directory contents
should be retrieved.

Bug: http://curl.haxx.se/mail/lib-2014-02/0155.html

lib/ssh.c

index f1e026e9a9b75549ee22e628bdf5a275c0f8375f..00479c87d88451b7b0931d2b0969e8fa0a3f5cd0 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -1808,8 +1808,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
 
     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