[openssh-commits] [openssh] 01/02: upstream: don't let logging clobber errno before use

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 19 13:20:41 AEDT 2021


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 860b67604416640e8db14f365adc3f840aebcb1f
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Tue Mar 16 06:15:43 2021 +0000

    upstream: don't let logging clobber errno before use
    
    OpenBSD-Commit-ID: ce6cca370005c270c277c51c111bb6911e1680ec
---
 sftp-server.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sftp-server.c b/sftp-server.c
index 7300900a..752820f5 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);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list