[scp.c]
     Prevent scp from skipping the file following a double-error.
     bz #863, ok markus@
This commit is contained in:
Darren Tucker 2004-07-08 23:11:44 +10:00
parent 042e2e8cbb
commit e1f17055ed
2 changed files with 14 additions and 6 deletions

View File

@ -7,6 +7,10 @@
[monitor_wrap.c] [monitor_wrap.c]
Put s/key functions inside #ifdef SKEY same as monitor.c, Put s/key functions inside #ifdef SKEY same as monitor.c,
from des@freebsd via bz #330, ok markus@ 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 20040702
- (dtucker) [mdoc2man.awk] Teach it to ignore .Bk -words, reported by - (dtucker) [mdoc2man.awk] Teach it to ignore .Bk -words, reported by
@ -1491,4 +1495,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu - (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 $

14
scp.c
View File

@ -71,7 +71,7 @@
*/ */
#include "includes.h" #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 "xmalloc.h"
#include "atomicio.h" #include "atomicio.h"
@ -946,21 +946,25 @@ bad: run_err("%s: %s", np, strerror(errno));
if (pflag) { if (pflag) {
if (exists || omode != mode) if (exists || omode != mode)
#ifdef HAVE_FCHMOD #ifdef HAVE_FCHMOD
if (fchmod(ofd, omode)) if (fchmod(ofd, omode)) {
#else /* HAVE_FCHMOD */ #else /* HAVE_FCHMOD */
if (chmod(np, omode)) if (chmod(np, omode)) {
#endif /* HAVE_FCHMOD */ #endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s", run_err("%s: set mode: %s",
np, strerror(errno)); np, strerror(errno));
wrerr = DISPLAYED;
}
} else { } else {
if (!exists && omode != mode) if (!exists && omode != mode)
#ifdef HAVE_FCHMOD #ifdef HAVE_FCHMOD
if (fchmod(ofd, omode & ~mask)) if (fchmod(ofd, omode & ~mask)) {
#else /* HAVE_FCHMOD */ #else /* HAVE_FCHMOD */
if (chmod(np, omode & ~mask)) if (chmod(np, omode & ~mask)) {
#endif /* HAVE_FCHMOD */ #endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s", run_err("%s: set mode: %s",
np, strerror(errno)); np, strerror(errno));
wrerr = DISPLAYED;
}
} }
if (close(ofd) == -1) { if (close(ofd) == -1) {
wrerr = YES; wrerr = YES;