summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2020-07-03 07:02:38 +0000
committerDamien Miller <djm@cvs.openbsd.org>2020-07-03 07:02:38 +0000
commit6a849376e1d0c36303b1d22f75310eabffde7a36 (patch)
tree9ef2f4f08929f526bcd404b9538c07d0409f3cbb /usr.bin/ssh
parent02501b6c06e8c2761d393ad2e2132e0a2f2a49f1 (diff)
avoid tilde_expand_filename() in expanding ~/.ssh/rc - if sshd is
in chroot mode, the likely absence of a password database will cause tilde_expand_filename() to fatal; ok dtucker@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index a29333e0935..823622473ea 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.321 2020/07/03 06:46:41 djm Exp $ */
+/* $OpenBSD: session.c,v 1.322 2020/07/03 07:02:37 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -972,7 +972,7 @@ do_rc_files(struct ssh *ssh, Session *s, const char *shell)
do_xauth =
s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL;
- user_rc = tilde_expand_filename("~/" _PATH_SSH_USER_RC, getuid());
+ xasprintf(&user_rc, "%s/%s", s->pw->pw_dir, _PATH_SSH_USER_RC);
/* ignore _PATH_SSH_USER_RC for subsystems and admin forced commands */
if (!s->is_subsystem && options.adm_forced_command == NULL &&