diff options
author | djm@openbsd.org <djm@openbsd.org> | 2021-03-16 07:15:43 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-03-19 03:20:32 +0100 |
commit | 860b67604416640e8db14f365adc3f840aebcb1f (patch) | |
tree | b696aa3b70e73dd00aedd840fabbccd327156297 /sftp-server.c | |
parent | Only call dh_set_moduli_file if using OpenSSL. (diff) | |
download | openssh-860b67604416640e8db14f365adc3f840aebcb1f.tar.xz openssh-860b67604416640e8db14f365adc3f840aebcb1f.zip |
upstream: don't let logging clobber errno before use
OpenBSD-Commit-ID: ce6cca370005c270c277c51c111bb6911e1680ec
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sftp-server.c b/sftp-server.c index 7300900ac..752820f5c 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-server.c,v 1.122 2021/02/18 00:30:17 djm Exp $ */ +/* $OpenBSD: sftp-server.c,v 1.123 2021/03/16 06:15:43 djm Exp $ */ /* * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. * @@ -807,15 +807,17 @@ process_write(u_int32_t id) status = SSH2_FX_FAILURE; else { if (!(handle_to_flags(handle) & O_APPEND) && - lseek(fd, off, SEEK_SET) == -1) { + lseek(fd, off, SEEK_SET) == -1) { status = errno_to_portable(errno); - error_f("seek failed"); + error_f("seek \"%.100s\": %s", handle_to_name(handle), + strerror(errno)); } else { /* XXX ATOMICIO ? */ ret = write(fd, data, len); if (ret == -1) { - error_f("write: %s", strerror(errno)); status = errno_to_portable(errno); + error_f("write \"%.100s\": %s", + handle_to_name(handle), strerror(errno)); } else if ((size_t)ret == len) { status = SSH2_FX_OK; handle_update_write(handle, ret); |