[openssh-commits] [openssh] 05/05: upstream: use status error message to communicate ~user expansion

git+noreply at mindrot.org git+noreply at mindrot.org
Sat Jan 8 18:39:02 AEDT 2022


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

djm pushed a commit to branch master
in repository openssh.

commit 12b457c2a42ff271e7967d9bedd068cebb048db9
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Sat Jan 8 07:37:32 2022 +0000

    upstream: use status error message to communicate ~user expansion
    
    failures; provides better experience for scp in sftp mode, where ~user paths
    are more likely to be used; spotted jsg, feedback jsg & deraadt ok jsg &
    markus
    
    OpenBSD-Commit-ID: fc610ce00ca0cdc2ecdabbd49ce7cb82033f905f
---
 sftp-client.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sftp-client.c b/sftp-client.c
index fa4a47cc..6ac293c2 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.159 2022/01/08 07:34:57 djm Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.160 2022/01/08 07:37:32 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm at openbsd.org>
  *
@@ -1009,10 +1009,14 @@ do_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
 
 	if (type == SSH2_FXP_STATUS) {
 		u_int status;
+		char *errmsg;
 
-		if ((r = sshbuf_get_u32(msg, &status)) != 0)
+		if ((r = sshbuf_get_u32(msg, &status)) != 0 ||
+		    (r = sshbuf_get_cstring(msg, &errmsg, NULL)) != 0)
 			fatal_fr(r, "parse status");
-		error("canonicalize %s: %s", path, fx2txt(status));
+		error("%s %s: %s", expand ? "expand" : "realpath",
+		    path, *errmsg == '\0' ? fx2txt(status) : errmsg);
+		free(errmsg);
 		sshbuf_free(msg);
 		return NULL;
 	} else if (type != SSH2_FXP_NAME)

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


More information about the openssh-commits mailing list