]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: improve error message when trying to expand a ~user path
authordjm@openbsd.org <djm@openbsd.org>
Mon, 8 Nov 2021 21:32:49 +0000 (21:32 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 10 Nov 2021 06:32:18 +0000 (17:32 +1100)
for a user that doesn't exist; better matches what the shell does

ok deraadt@

OpenBSD-Commit-ID: 1ddefa3c3a78b69ce13d1b8f67bc9f2cefd23ad6

sftp-server.c

index 1b0c42d4cb467e0a8fdb1d4aff8596dd16f8a395..3f35c399af73625aa21a840b9e802fcc4ce8d9ac 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.130 2021/11/06 10:13:39 dtucker Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.131 2021/11/08 21:32:49 djm Exp $ */
 /*
  * Copyright (c) 2000-2004 Markus Friedl.  All rights reserved.
  *
@@ -1557,7 +1557,7 @@ 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(EINVAL));
+                               send_status(id, errno_to_portable(ENOENT));
                                goto out;
                        }
                        free(path);