From dd6df15e4c25f09ed2b1eec1500cfff0cb7391b6 Mon Sep 17 00:00:00 2001 From: djm Date: Fri, 14 Jan 2022 03:31:52 +0000 Subject: [PATCH] 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 (forgot to include this file in previous commit) --- usr.bin/ssh/sftp-server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c index bfa7fc7f337..973ed542e9b 100644 --- a/usr.bin/ssh/sftp-server.c +++ b/usr.bin/ssh/sftp-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-server.c,v 1.137 2022/01/11 02:56:19 dtucker Exp $ */ +/* $OpenBSD: sftp-server.c,v 1.138 2022/01/14 03:31:52 djm Exp $ */ /* * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. * @@ -1534,7 +1534,8 @@ process_extended_expand(u_int32_t id) } else { /* ~user expansions */ if (tilde_expand(path, pw->pw_uid, &npath) != 0) { - send_status(id, errno_to_portable(ENOENT)); + send_status_errmsg(id, + errno_to_portable(ENOENT), "no such user"); goto out; } free(path); -- 2.20.1