diff options
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/servconf.c b/servconf.c index cbbb20052..73e47eacf 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: servconf.c,v 1.204 2010/03/04 10:36:03 djm Exp $ */ | 1 | /* $OpenBSD: servconf.c,v 1.207 2010/03/25 23:38:28 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
4 | * All rights reserved | 4 | * All rights reserved |
@@ -487,15 +487,14 @@ parse_token(const char *cp, const char *filename, | |||
487 | char * | 487 | char * |
488 | derelativise_path(const char *path) | 488 | derelativise_path(const char *path) |
489 | { | 489 | { |
490 | char *expanded, *ret, *cwd; | 490 | char *expanded, *ret, cwd[MAXPATHLEN]; |
491 | 491 | ||
492 | expanded = tilde_expand_filename(path, getuid()); | 492 | expanded = tilde_expand_filename(path, getuid()); |
493 | if (*expanded == '/') | 493 | if (*expanded == '/') |
494 | return expanded; | 494 | return expanded; |
495 | if ((cwd = getcwd(NULL, 0)) == NULL) | 495 | if (getcwd(cwd, sizeof(cwd)) == NULL) |
496 | fatal("%s: getcwd: %s", __func__, strerror(errno)); | 496 | fatal("%s: getcwd: %s", __func__, strerror(errno)); |
497 | xasprintf(&ret, "%s/%s", cwd, expanded); | 497 | xasprintf(&ret, "%s/%s", cwd, expanded); |
498 | xfree(cwd); | ||
499 | xfree(expanded); | 498 | xfree(expanded); |
500 | return ret; | 499 | return ret; |
501 | } | 500 | } |
@@ -1252,7 +1251,17 @@ process_server_config_line(ServerOptions *options, char *line, | |||
1252 | charptr = (opcode == sAuthorizedKeysFile) ? | 1251 | charptr = (opcode == sAuthorizedKeysFile) ? |
1253 | &options->authorized_keys_file : | 1252 | &options->authorized_keys_file : |
1254 | &options->authorized_keys_file2; | 1253 | &options->authorized_keys_file2; |
1255 | goto parse_filename; | 1254 | arg = strdelim(&cp); |
1255 | if (!arg || *arg == '\0') | ||
1256 | fatal("%s line %d: missing file name.", | ||
1257 | filename, linenum); | ||
1258 | if (*activep && *charptr == NULL) { | ||
1259 | *charptr = tilde_expand_filename(arg, getuid()); | ||
1260 | /* increase optional counter */ | ||
1261 | if (intptr != NULL) | ||
1262 | *intptr = *intptr + 1; | ||
1263 | } | ||
1264 | break; | ||
1256 | 1265 | ||
1257 | case sClientAliveInterval: | 1266 | case sClientAliveInterval: |
1258 | intptr = &options->client_alive_interval; | 1267 | intptr = &options->client_alive_interval; |