Skip to content

Commit

Permalink
upstream: avoid tilde_expand_filename() in expanding ~/.ssh/rc - if
Browse files Browse the repository at this point in the history
sshd is in chroot mode, the likely absence of a password database will cause
tilde_expand_filename() to fatal; ok dtucker@

OpenBSD-Commit-ID: e20aee6159e8b79190d18dba1513fc1b7c8b7ee1
  • Loading branch information
djmdjm committed Jul 3, 2020
1 parent c893508 commit 20b5fab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions session.c
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>, Espoo, Finland
* All rights reserved
Expand Down Expand Up @@ -1212,7 +1212,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 &&
Expand Down

0 comments on commit 20b5fab

Please sign in to comment.