summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-06-25 18:32:33 +1000
committerDarren Tucker <dtucker@zip.com.au>2007-06-25 18:32:33 +1000
commit067263e84800c4b35f9bbbfafdd92aea493b6e0b (patch)
tree29b4b16a2c1fb123f5521d6c0f4e49a7d66b7289
parent7dae3d296e685843f003038a7f1a9f8ef7f614bd (diff)
- djm@cvs.openbsd.org 2007/06/13 00:21:27
[scp.c] don't ftruncate() non-regular files; bz#1236 reported by wood AT xmission.com; ok dtucker@
-rw-r--r--ChangeLog9
-rw-r--r--scp.c5
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 08d55cc54..d1a244abf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
120070625
2 - (dtucker) OpenBSD CVS Sync
3 - djm@cvs.openbsd.org 2007/06/13 00:21:27
4 [scp.c]
5 don't ftruncate() non-regular files; bz#1236 reported by wood AT
6 xmission.com; ok dtucker@
7
120070614 820070614
2 - (dtucker) [cipher-ctr.c umac.c openbsd-compat/openssl-compat.h] Move the 9 - (dtucker) [cipher-ctr.c umac.c openbsd-compat/openssl-compat.h] Move the
3 USE_BUILTIN_RIJNDAEL compat goop to openssl-compat.h so it can be 10 USE_BUILTIN_RIJNDAEL compat goop to openssl-compat.h so it can be
@@ -3072,4 +3079,4 @@
3072 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3079 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3073 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3080 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3074 3081
3075$Id: ChangeLog,v 1.4702 2007/06/14 13:47:31 dtucker Exp $ 3082$Id: ChangeLog,v 1.4703 2007/06/25 08:32:33 dtucker Exp $
diff --git a/scp.c b/scp.c
index 92a67b733..0206e6f4e 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.158 2007/06/12 13:54:28 dtucker Exp $ */ 1/* $OpenBSD: scp.c,v 1.159 2007/06/13 00:21:27 djm Exp $ */
2/* 2/*
3 * scp - secure remote copy. This is basically patched BSD rcp which 3 * scp - secure remote copy. This is basically patched BSD rcp which
4 * uses ssh to do the data transfer (instead of using rcmd). 4 * uses ssh to do the data transfer (instead of using rcmd).
@@ -1024,7 +1024,8 @@ bad: run_err("%s: %s", np, strerror(errno));
1024 wrerr = YES; 1024 wrerr = YES;
1025 wrerrno = errno; 1025 wrerrno = errno;
1026 } 1026 }
1027 if (wrerr == NO && ftruncate(ofd, size) != 0) { 1027 if (wrerr == NO && (!exists || S_ISREG(stb.st_mode)) &&
1028 ftruncate(ofd, size) != 0) {
1028 run_err("%s: truncate: %s", np, strerror(errno)); 1029 run_err("%s: truncate: %s", np, strerror(errno));
1029 wrerr = DISPLAYED; 1030 wrerr = DISPLAYED;
1030 } 1031 }