summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2008-12-09 02:39:59 +0000
committerdjm <djm@openbsd.org>2008-12-09 02:39:59 +0000
commit63b3e71edf797f341ed9d02bc88772348243bd31 (patch)
tree7b43696221543a6c43b96ec18e092943006ee46e
parentThe ~C escape handler does not work correctly for multiplexed sessions - (diff)
downloadwireguard-openbsd-63b3e71edf797f341ed9d02bc88772348243bd31.tar.xz
wireguard-openbsd-63b3e71edf797f341ed9d02bc88772348243bd31.zip
Deal correctly with failures in remote stat() operation in sftp,
correcting fail-on-error behaviour in batchmode. bz#1541 report and fix from anedvedicky AT gmail.com; ok markus@
-rw-r--r--usr.bin/ssh/sftp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index a0b9bc399f1..6c8e814f501 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.103 2008/07/13 22:16:03 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.104 2008/12/09 02:39:59 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1365,17 +1365,19 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
for (i = 0; g.gl_pathv[i] && !interrupted; i++) {
if (!(aa = do_stat(conn, g.gl_pathv[i], 0))) {
- if (err != 0 && err_abort)
+ if (err_abort) {
+ err = -1;
break;
- else
+ } else
continue;
}
if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) {
error("Can't get current ownership of "
"remote file \"%s\"", g.gl_pathv[i]);
- if (err != 0 && err_abort)
+ if (err_abort) {
+ err = -1;
break;
- else
+ } else
continue;
}
aa->flags &= SSH2_FILEXFER_ATTR_UIDGID;