From 54e3773ccb55500087fc722c79869679700dc318 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 10 Feb 2008 22:48:55 +1100 Subject: - djm@cvs.openbsd.org 2008/02/10 10:54:29 [servconf.c session.c] delay ~ expansion for ChrootDirectory so it expands to the logged-in user's home, rather than the user who starts sshd (probably root) --- servconf.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'servconf.c') diff --git a/servconf.c b/servconf.c index d38d0bfb1..9add96ca1 100644 --- a/servconf.c +++ b/servconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: servconf.c,v 1.176 2008/02/08 23:24:08 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.177 2008/02/10 10:54:28 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -1260,7 +1260,14 @@ parse_flag: case sChrootDirectory: charptr = &options->chroot_directory; - goto parse_filename; + + arg = strdelim(&cp); + if (!arg || *arg == '\0') + fatal("%s line %d: missing file name.", + filename, linenum); + if (*activep && *charptr == NULL) + *charptr = xstrdup(arg); + break; case sDeprecated: logit("%s line %d: Deprecated option %s", -- cgit v1.2.3