From e1f17055ed51dcf53f385f4db334c9a7471659ab Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 8 Jul 2004 23:11:44 +1000 Subject: [PATCH] - dtucker@cvs.openbsd.org 2004/07/08 12:47:21 [scp.c] Prevent scp from skipping the file following a double-error. bz #863, ok markus@ --- ChangeLog | 6 +++++- scp.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa8acb155..4d90d8e2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ [monitor_wrap.c] Put s/key functions inside #ifdef SKEY same as monitor.c, from des@freebsd via bz #330, ok markus@ + - dtucker@cvs.openbsd.org 2004/07/08 12:47:21 + [scp.c] + Prevent scp from skipping the file following a double-error. + bz #863, ok markus@ 20040702 - (dtucker) [mdoc2man.awk] Teach it to ignore .Bk -words, reported by @@ -1491,4 +1495,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3470 2004/07/08 13:09:42 dtucker Exp $ +$Id: ChangeLog,v 1.3471 2004/07/08 13:11:44 dtucker Exp $ diff --git a/scp.c b/scp.c index 3ae17c9ac..e559122a1 100644 --- a/scp.c +++ b/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" @@ -946,21 +946,25 @@ bad: run_err("%s: %s", np, strerror(errno)); if (pflag) { if (exists || omode != mode) #ifdef HAVE_FCHMOD - if (fchmod(ofd, omode)) + if (fchmod(ofd, omode)) { #else /* HAVE_FCHMOD */ - if (chmod(np, omode)) + if (chmod(np, omode)) { #endif /* HAVE_FCHMOD */ run_err("%s: set mode: %s", np, strerror(errno)); + wrerr = DISPLAYED; + } } else { if (!exists && omode != mode) #ifdef HAVE_FCHMOD - if (fchmod(ofd, omode & ~mask)) + if (fchmod(ofd, omode & ~mask)) { #else /* HAVE_FCHMOD */ - if (chmod(np, omode & ~mask)) + if (chmod(np, omode & ~mask)) { #endif /* HAVE_FCHMOD */ run_err("%s: set mode: %s", np, strerror(errno)); + wrerr = DISPLAYED; + } } if (close(ofd) == -1) { wrerr = YES;