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 62417def7..d42dd527b 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 |
@@ -500,15 +500,14 @@ parse_token(const char *cp, const char *filename, | |||
500 | char * | 500 | char * |
501 | derelativise_path(const char *path) | 501 | derelativise_path(const char *path) |
502 | { | 502 | { |
503 | char *expanded, *ret, *cwd; | 503 | char *expanded, *ret, cwd[MAXPATHLEN]; |
504 | 504 | ||
505 | expanded = tilde_expand_filename(path, getuid()); | 505 | expanded = tilde_expand_filename(path, getuid()); |
506 | if (*expanded == '/') | 506 | if (*expanded == '/') |
507 | return expanded; | 507 | return expanded; |
508 | if ((cwd = getcwd(NULL, 0)) == NULL) | 508 | if (getcwd(cwd, sizeof(cwd)) == NULL) |
509 | fatal("%s: getcwd: %s", __func__, strerror(errno)); | 509 | fatal("%s: getcwd: %s", __func__, strerror(errno)); |
510 | xasprintf(&ret, "%s/%s", cwd, expanded); | 510 | xasprintf(&ret, "%s/%s", cwd, expanded); |
511 | xfree(cwd); | ||
512 | xfree(expanded); | 511 | xfree(expanded); |
513 | return ret; | 512 | return ret; |
514 | } | 513 | } |
@@ -1269,7 +1268,17 @@ process_server_config_line(ServerOptions *options, char *line, | |||
1269 | charptr = (opcode == sAuthorizedKeysFile) ? | 1268 | charptr = (opcode == sAuthorizedKeysFile) ? |
1270 | &options->authorized_keys_file : | 1269 | &options->authorized_keys_file : |
1271 | &options->authorized_keys_file2; | 1270 | &options->authorized_keys_file2; |
1272 | goto parse_filename; | 1271 | arg = strdelim(&cp); |
1272 | if (!arg || *arg == '\0') | ||
1273 | fatal("%s line %d: missing file name.", | ||
1274 | filename, linenum); | ||
1275 | if (*activep && *charptr == NULL) { | ||
1276 | *charptr = tilde_expand_filename(arg, getuid()); | ||
1277 | /* increase optional counter */ | ||
1278 | if (intptr != NULL) | ||
1279 | *intptr = *intptr + 1; | ||
1280 | } | ||
1281 | break; | ||
1273 | 1282 | ||
1274 | case sClientAliveInterval: | 1283 | case sClientAliveInterval: |
1275 | intptr = &options->client_alive_interval; | 1284 | intptr = &options->client_alive_interval; |