diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-06-25 18:32:33 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-06-25 18:32:33 +1000 |
commit | 067263e84800c4b35f9bbbfafdd92aea493b6e0b (patch) | |
tree | 29b4b16a2c1fb123f5521d6c0f4e49a7d66b7289 | |
parent | 7dae3d296e685843f003038a7f1a9f8ef7f614bd (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-- | ChangeLog | 9 | ||||
-rw-r--r-- | scp.c | 5 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,10 @@ | |||
1 | 20070625 | ||
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 | |||
1 | 20070614 | 8 | 20070614 |
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 $ |
@@ -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 | } |