diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-07-08 12:47:22 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-07-08 12:47:22 +0000 |
commit | 76d9df584fa31713f4ad951d401f6c9f16c16d33 (patch) | |
tree | df788af9735cffab1dc46312c77944e52ba4baa6 /usr.bin/ssh/scp.c | |
parent | c4f1ae2cdf90c12c259dccdfafef4b7d230a98d6 (diff) |
Prevent scp from skipping the file following a double-error.
bz #863, ok markus@
Diffstat (limited to 'usr.bin/ssh/scp.c')
-rw-r--r-- | usr.bin/ssh/scp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index c650b2741fe..c715eab3491 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -71,7 +71,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.115 2004/06/21 17:36:31 avsm Exp $"); +RCSID("$OpenBSD: scp.c,v 1.116 2004/07/08 12:47:21 dtucker Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -936,14 +936,18 @@ bad: run_err("%s: %s", np, strerror(errno)); } if (pflag) { if (exists || omode != mode) - if (fchmod(ofd, omode)) + if (fchmod(ofd, omode)) { run_err("%s: set mode: %s", np, strerror(errno)); + wrerr = DISPLAYED; + } } else { if (!exists && omode != mode) - if (fchmod(ofd, omode & ~mask)) + if (fchmod(ofd, omode & ~mask)) { run_err("%s: set mode: %s", np, strerror(errno)); + wrerr = DISPLAYED; + } } if (close(ofd) == -1) { wrerr = YES; |