diff options
author | Matt Johnston <matt@ucc.asn.au> | 2022-02-24 11:51:51 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2022-02-24 11:51:51 +0800 |
commit | 1097763cf3a71dde59c21a84286970b806bfc992 (patch) | |
tree | 1726986c93a15a80a1e1bdbd44682a9ffe7c7103 /svr-chansession.c | |
parent | e0464ab77a141e3b1cbe0ef38f72c11183a1be0a (diff) | |
download | dropbear-1097763cf3a71dde59c21a84286970b806bfc992.tar.gz |
Make missing homedir non-fatal, instead use /
Fixes github #146
Diffstat (limited to 'svr-chansession.c')
-rw-r--r-- | svr-chansession.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/svr-chansession.c b/svr-chansession.c index 9ecda79..02cb035 100644 --- a/svr-chansession.c +++ b/svr-chansession.c @@ -1033,9 +1033,14 @@ static void execchild(const void *user_data) { /* change directory */ if (chdir(ses.authstate.pw_dir) < 0) { - dropbear_exit("Error changing directory"); + int e = errno; + if (chdir("/") < 0) { + dropbear_exit("chdir(\"/\") failed"); + } + fprintf(stderr, "Failed chdir '%s': %s\n", ses.authstate.pw_dir, strerror(e)); } + #if DROPBEAR_X11FWD /* set up X11 forwarding if enabled */ x11setauth(chansess); |