summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-12-09 14:11:49 +1100
committerDamien Miller <djm@mindrot.org>2008-12-09 14:11:49 +1100
commit1be2cc44961177897c3380ed7a8ec3641d5fd8ad (patch)
treef84f0fd66651dc2433749313bb78dddb1d66ddcc
parent586b00532f89e6166e6a74bdf3e801cc59449b84 (diff)
- djm@cvs.openbsd.org 2008/12/09 02:39:59
[sftp.c] 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--ChangeLog7
-rw-r--r--sftp.c12
2 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 8626eee63..2ea6a05da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,11 @@
7 that requested it. Disable it on slave sessions until such time as it 7 that requested it. Disable it on slave sessions until such time as it
8 is fixed; bz#1543 report from Adrian Bridgett via Colin Watson 8 is fixed; bz#1543 report from Adrian Bridgett via Colin Watson
9 ok markus@ 9 ok markus@
10 - djm@cvs.openbsd.org 2008/12/09 02:39:59
11 [sftp.c]
12 Deal correctly with failures in remote stat() operation in sftp,
13 correcting fail-on-error behaviour in batchmode. bz#1541 report and
14 fix from anedvedicky AT gmail.com; ok markus@
10 15
1120081208 1620081208
12 - (djm) [configure.ac] bz#1538: better test for ProPolice/SSP: actually 17 - (djm) [configure.ac] bz#1538: better test for ProPolice/SSP: actually
@@ -4974,5 +4979,5 @@
4974 OpenServer 6 and add osr5bigcrypt support so when someone migrates 4979 OpenServer 6 and add osr5bigcrypt support so when someone migrates
4975 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 4980 passwords between UnixWare and OpenServer they will still work. OK dtucker@
4976 4981
4977$Id: ChangeLog,v 1.5152 2008/12/09 03:11:32 djm Exp $ 4982$Id: ChangeLog,v 1.5153 2008/12/09 03:11:49 djm Exp $
4978 4983
diff --git a/sftp.c b/sftp.c
index e1aa49d0f..4e3c833f7 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.103 2008/07/13 22:16:03 djm Exp $ */ 1/* $OpenBSD: sftp.c,v 1.104 2008/12/09 02:39:59 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -1386,17 +1386,19 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
1386 remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); 1386 remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
1387 for (i = 0; g.gl_pathv[i] && !interrupted; i++) { 1387 for (i = 0; g.gl_pathv[i] && !interrupted; i++) {
1388 if (!(aa = do_stat(conn, g.gl_pathv[i], 0))) { 1388 if (!(aa = do_stat(conn, g.gl_pathv[i], 0))) {
1389 if (err != 0 && err_abort) 1389 if (err_abort) {
1390 err = -1;
1390 break; 1391 break;
1391 else 1392 } else
1392 continue; 1393 continue;
1393 } 1394 }
1394 if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) { 1395 if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) {
1395 error("Can't get current ownership of " 1396 error("Can't get current ownership of "
1396 "remote file \"%s\"", g.gl_pathv[i]); 1397 "remote file \"%s\"", g.gl_pathv[i]);
1397 if (err != 0 && err_abort) 1398 if (err_abort) {
1399 err = -1;
1398 break; 1400 break;
1399 else 1401 } else
1400 continue; 1402 continue;
1401 } 1403 }
1402 aa->flags &= SSH2_FILEXFER_ATTR_UIDGID; 1404 aa->flags &= SSH2_FILEXFER_ATTR_UIDGID;