diff options
author | des <des@FreeBSD.org> | 2010-04-28 10:36:33 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2010-04-28 10:36:33 +0000 |
commit | fc607a2e80dfeb125ae2fe83191d934929997047 (patch) | |
tree | bd00e72572bcfba5ac7d243462c79d29a987c5a2 /crypto/openssh/servconf.c | |
parent | c86e821ecb2a324088edbbb87198b4d55833575a (diff) | |
download | FreeBSD-src-fc607a2e80dfeb125ae2fe83191d934929997047.zip FreeBSD-src-fc607a2e80dfeb125ae2fe83191d934929997047.tar.gz |
Upgrade to OpenSSH 5.5p1.
Diffstat (limited to 'crypto/openssh/servconf.c')
-rw-r--r-- | crypto/openssh/servconf.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/crypto/openssh/servconf.c b/crypto/openssh/servconf.c index 603c586..626f38c 100644 --- a/crypto/openssh/servconf.c +++ b/crypto/openssh/servconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: servconf.c,v 1.204 2010/03/04 10:36:03 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.207 2010/03/25 23:38:28 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -474,15 +474,14 @@ parse_token(const char *cp, const char *filename, char * derelativise_path(const char *path) { - char *expanded, *ret, *cwd; + char *expanded, *ret, cwd[MAXPATHLEN]; expanded = tilde_expand_filename(path, getuid()); if (*expanded == '/') return expanded; - if ((cwd = getcwd(NULL, 0)) == NULL) + if (getcwd(cwd, sizeof(cwd)) == NULL) fatal("%s: getcwd: %s", __func__, strerror(errno)); xasprintf(&ret, "%s/%s", cwd, expanded); - xfree(cwd); xfree(expanded); return ret; } @@ -1227,7 +1226,17 @@ process_server_config_line(ServerOptions *options, char *line, charptr = (opcode == sAuthorizedKeysFile) ? &options->authorized_keys_file : &options->authorized_keys_file2; - goto parse_filename; + arg = strdelim(&cp); + if (!arg || *arg == '\0') + fatal("%s line %d: missing file name.", + filename, linenum); + if (*activep && *charptr == NULL) { + *charptr = tilde_expand_filename(arg, getuid()); + /* increase optional counter */ + if (intptr != NULL) + *intptr = *intptr + 1; + } + break; case sClientAliveInterval: intptr = &options->client_alive_interval; |