From 1cd1b2eac39661b849d5a4b4b56363e22bb5f61e Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Fri, 14 Jan 2022 03:31:52 +0000 Subject: [PATCH] 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 (forgot to include this file in previous commit) OpenBSD-Commit-ID: d37cc4c8c861ce48cd6ea9899e96aaac3476847b --- sftp-server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sftp-server.c b/sftp-server.c index 436d98f33..528cef682 100644 --- a/sftp-server.c +++ b/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. * @@ -1567,7 +1567,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);