summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/readconf.c b/readconf.c
index 7efaf85eb..a10aaff1c 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,13 +12,17 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.54 2001/01/18 16:20:22 markus Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.58 2001/01/21 19:05:53 markus Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "readconf.h"
19#include "match.h"
20#include "xmalloc.h" 18#include "xmalloc.h"
21#include "compat.h" 19#include "compat.h"
20#include "cipher.h"
21#include "pathnames.h"
22#include "log.h"
23#include "readconf.h"
24#include "match.h"
25#include "misc.h"
22 26
23/* Format of the configuration file: 27/* Format of the configuration file:
24 28
@@ -247,7 +251,7 @@ process_config_line(Options *options, const char *host,
247 /* Ignore leading whitespace. */ 251 /* Ignore leading whitespace. */
248 if (*keyword == '\0') 252 if (*keyword == '\0')
249 keyword = strdelim(&s); 253 keyword = strdelim(&s);
250 if (!*keyword || *keyword == '\n' || *keyword == '#') 254 if (keyword == NULL || !*keyword || *keyword == '\n' || *keyword == '#')
251 return 0; 255 return 0;
252 256
253 opcode = parse_token(keyword, filename, linenum); 257 opcode = parse_token(keyword, filename, linenum);
@@ -599,8 +603,7 @@ parse_int:
599 } 603 }
600 604
601 /* Check that there is no garbage at end of line. */ 605 /* Check that there is no garbage at end of line. */
602 if ((arg = strdelim(&s)) != NULL && *arg != '\0') 606 if ((arg = strdelim(&s)) != NULL && *arg != '\0') {
603 {
604 fatal("%.200s line %d: garbage at end of line; \"%.200s\".", 607 fatal("%.200s line %d: garbage at end of line; \"%.200s\".",
605 filename, linenum, arg); 608 filename, linenum, arg);
606 } 609 }
@@ -782,27 +785,27 @@ fill_default_options(Options * options)
782 if (options->num_identity_files == 0) { 785 if (options->num_identity_files == 0) {
783 if (options->protocol & SSH_PROTO_1) { 786 if (options->protocol & SSH_PROTO_1) {
784 options->identity_files[options->num_identity_files] = 787 options->identity_files[options->num_identity_files] =
785 xmalloc(2 + strlen(SSH_CLIENT_IDENTITY) + 1); 788 xmalloc(2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1);
786 sprintf(options->identity_files[options->num_identity_files++], 789 sprintf(options->identity_files[options->num_identity_files++],
787 "~/%.100s", SSH_CLIENT_IDENTITY); 790 "~/%.100s", _PATH_SSH_CLIENT_IDENTITY);
788 } 791 }
789 if (options->protocol & SSH_PROTO_2) { 792 if (options->protocol & SSH_PROTO_2) {
790 options->identity_files[options->num_identity_files] = 793 options->identity_files[options->num_identity_files] =
791 xmalloc(2 + strlen(SSH_CLIENT_ID_DSA) + 1); 794 xmalloc(2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1);
792 sprintf(options->identity_files[options->num_identity_files++], 795 sprintf(options->identity_files[options->num_identity_files++],
793 "~/%.100s", SSH_CLIENT_ID_DSA); 796 "~/%.100s", _PATH_SSH_CLIENT_ID_DSA);
794 } 797 }
795 } 798 }
796 if (options->escape_char == -1) 799 if (options->escape_char == -1)
797 options->escape_char = '~'; 800 options->escape_char = '~';
798 if (options->system_hostfile == NULL) 801 if (options->system_hostfile == NULL)
799 options->system_hostfile = SSH_SYSTEM_HOSTFILE; 802 options->system_hostfile = _PATH_SSH_SYSTEM_HOSTFILE;
800 if (options->user_hostfile == NULL) 803 if (options->user_hostfile == NULL)
801 options->user_hostfile = SSH_USER_HOSTFILE; 804 options->user_hostfile = _PATH_SSH_USER_HOSTFILE;
802 if (options->system_hostfile2 == NULL) 805 if (options->system_hostfile2 == NULL)
803 options->system_hostfile2 = SSH_SYSTEM_HOSTFILE2; 806 options->system_hostfile2 = _PATH_SSH_SYSTEM_HOSTFILE2;
804 if (options->user_hostfile2 == NULL) 807 if (options->user_hostfile2 == NULL)
805 options->user_hostfile2 = SSH_USER_HOSTFILE2; 808 options->user_hostfile2 = _PATH_SSH_USER_HOSTFILE2;
806 if (options->log_level == (LogLevel) - 1) 809 if (options->log_level == (LogLevel) - 1)
807 options->log_level = SYSLOG_LEVEL_INFO; 810 options->log_level = SYSLOG_LEVEL_INFO;
808 /* options->proxy_command should not be set by default */ 811 /* options->proxy_command should not be set by default */