diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/readconf.c b/readconf.c index 6f978f828..36265e431 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.195 2013/02/17 23:16:57 dtucker Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.196 2013/02/22 04:45:08 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -373,7 +373,7 @@ parse_token(const char *cp, const char *filename, int linenum) | |||
373 | int | 373 | int |
374 | process_config_line(Options *options, const char *host, | 374 | process_config_line(Options *options, const char *host, |
375 | char *line, const char *filename, int linenum, | 375 | char *line, const char *filename, int linenum, |
376 | int *activep) | 376 | int *activep, int userconfig) |
377 | { | 377 | { |
378 | char *s, **charptr, *endofnumber, *keyword, *arg, *arg2; | 378 | char *s, **charptr, *endofnumber, *keyword, *arg, *arg2; |
379 | char **cpptr, fwdarg[256]; | 379 | char **cpptr, fwdarg[256]; |
@@ -606,7 +606,7 @@ parse_yesnoask: | |||
606 | if (*intptr >= SSH_MAX_IDENTITY_FILES) | 606 | if (*intptr >= SSH_MAX_IDENTITY_FILES) |
607 | fatal("%.200s line %d: Too many identity files specified (max %d).", | 607 | fatal("%.200s line %d: Too many identity files specified (max %d).", |
608 | filename, linenum, SSH_MAX_IDENTITY_FILES); | 608 | filename, linenum, SSH_MAX_IDENTITY_FILES); |
609 | add_identity_file(options, NULL, arg, 1); | 609 | add_identity_file(options, NULL, arg, userconfig); |
610 | } | 610 | } |
611 | break; | 611 | break; |
612 | 612 | ||
@@ -1093,7 +1093,7 @@ parse_int: | |||
1093 | 1093 | ||
1094 | int | 1094 | int |
1095 | read_config_file(const char *filename, const char *host, Options *options, | 1095 | read_config_file(const char *filename, const char *host, Options *options, |
1096 | int checkperm) | 1096 | int flags) |
1097 | { | 1097 | { |
1098 | FILE *f; | 1098 | FILE *f; |
1099 | char line[1024]; | 1099 | char line[1024]; |
@@ -1103,7 +1103,7 @@ read_config_file(const char *filename, const char *host, Options *options, | |||
1103 | if ((f = fopen(filename, "r")) == NULL) | 1103 | if ((f = fopen(filename, "r")) == NULL) |
1104 | return 0; | 1104 | return 0; |
1105 | 1105 | ||
1106 | if (checkperm) { | 1106 | if (flags & SSHCONF_CHECKPERM) { |
1107 | struct stat sb; | 1107 | struct stat sb; |
1108 | 1108 | ||
1109 | if (fstat(fileno(f), &sb) == -1) | 1109 | if (fstat(fileno(f), &sb) == -1) |
@@ -1124,7 +1124,8 @@ read_config_file(const char *filename, const char *host, Options *options, | |||
1124 | while (fgets(line, sizeof(line), f)) { | 1124 | while (fgets(line, sizeof(line), f)) { |
1125 | /* Update line number counter. */ | 1125 | /* Update line number counter. */ |
1126 | linenum++; | 1126 | linenum++; |
1127 | if (process_config_line(options, host, line, filename, linenum, &active) != 0) | 1127 | if (process_config_line(options, host, line, filename, linenum, |
1128 | &active, flags & SSHCONF_USERCONF) != 0) | ||
1128 | bad_options++; | 1129 | bad_options++; |
1129 | } | 1130 | } |
1130 | fclose(f); | 1131 | fclose(f); |