summaryrefslogtreecommitdiffstats
path: root/sftp-server.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 07:43:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 07:43:01 +0000
commit726d6c984de7e297200843e99ab5e70c88a0cbf4 (patch)
tree48851420d8e29a6900c86af9dd178bd2e2aee72d /sftp-server.c
parentReleasing progress-linux version 1:9.7p1-7~progress7.99u1. (diff)
downloadopenssh-726d6c984de7e297200843e99ab5e70c88a0cbf4.tar.xz
openssh-726d6c984de7e297200843e99ab5e70c88a0cbf4.zip
Merging upstream version 1:9.8p1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--sftp-server.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sftp-server.c b/sftp-server.c
index 0466a0f..a4abb9f 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.147 2023/04/12 08:53:54 jsg Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.148 2024/04/30 06:23:51 djm Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
@@ -1706,14 +1706,16 @@ process_extended_home_directory(u_int32_t id)
fatal_fr(r, "parse");
debug3("request %u: home-directory \"%s\"", id, username);
- if ((user_pw = getpwnam(username)) == NULL) {
+ if (username[0] == '\0') {
+ user_pw = pw;
+ } else if ((user_pw = getpwnam(username)) == NULL) {
send_status(id, SSH2_FX_FAILURE);
goto out;
}
- verbose("home-directory \"%s\"", pw->pw_dir);
+ verbose("home-directory \"%s\"", user_pw->pw_dir);
attrib_clear(&s.attrib);
- s.name = s.long_name = pw->pw_dir;
+ s.name = s.long_name = user_pw->pw_dir;
send_names(id, 1, &s);
out:
free(username);