aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-02-18 11:21:13 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-02-19 10:40:28 +0100
commit0d6225ad0d5d0d441d78604e0d95e89dfedb4062 (patch)
treebabc7a0df3911ed07519798da6b3ebea8d807089 /lib/ssh.c
parent8749bbe7fd32da298459b62a80d61fd715c75abf (diff)
SFTP: skip reading the dir when NOBODY=1
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
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index f1e026e9a..00479c87d 100644
--- 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