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
This commit is contained in:
djm@openbsd.org 2022-01-14 03:31:52 +00:00 committed by Damien Miller
parent a1d42a6ce0
commit 1cd1b2eac3
1 changed files with 3 additions and 2 deletions

View File

@ -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);