diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/readconf.c b/readconf.c index 8ace1bbd4..cf27a9f41 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: readconf.c,v 1.139 2005/03/10 22:01:05 deraadt Exp $"); | 15 | RCSID("$OpenBSD: readconf.c,v 1.143 2005/07/30 02:03:47 djm Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
@@ -695,7 +695,7 @@ parse_int: | |||
695 | fwd.listen_host = cleanhostname(fwd.listen_host); | 695 | fwd.listen_host = cleanhostname(fwd.listen_host); |
696 | } else { | 696 | } else { |
697 | fwd.listen_port = a2port(fwd.listen_host); | 697 | fwd.listen_port = a2port(fwd.listen_host); |
698 | fwd.listen_host = ""; | 698 | fwd.listen_host = NULL; |
699 | } | 699 | } |
700 | if (fwd.listen_port == 0) | 700 | if (fwd.listen_port == 0) |
701 | fatal("%.200s line %d: Badly formatted port number.", | 701 | fatal("%.200s line %d: Badly formatted port number.", |
@@ -743,6 +743,9 @@ parse_int: | |||
743 | 743 | ||
744 | case oAddressFamily: | 744 | case oAddressFamily: |
745 | arg = strdelim(&s); | 745 | arg = strdelim(&s); |
746 | if (!arg || *arg == '\0') | ||
747 | fatal("%s line %d: missing address family.", | ||
748 | filename, linenum); | ||
746 | intptr = &options->address_family; | 749 | intptr = &options->address_family; |
747 | if (strcasecmp(arg, "inet") == 0) | 750 | if (strcasecmp(arg, "inet") == 0) |
748 | value = AF_INET; | 751 | value = AF_INET; |
@@ -793,7 +796,27 @@ parse_int: | |||
793 | 796 | ||
794 | case oControlMaster: | 797 | case oControlMaster: |
795 | intptr = &options->control_master; | 798 | intptr = &options->control_master; |
796 | goto parse_yesnoask; | 799 | arg = strdelim(&s); |
800 | if (!arg || *arg == '\0') | ||
801 | fatal("%.200s line %d: Missing ControlMaster argument.", | ||
802 | filename, linenum); | ||
803 | value = 0; /* To avoid compiler warning... */ | ||
804 | if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0) | ||
805 | value = SSHCTL_MASTER_YES; | ||
806 | else if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0) | ||
807 | value = SSHCTL_MASTER_NO; | ||
808 | else if (strcmp(arg, "auto") == 0) | ||
809 | value = SSHCTL_MASTER_AUTO; | ||
810 | else if (strcmp(arg, "ask") == 0) | ||
811 | value = SSHCTL_MASTER_ASK; | ||
812 | else if (strcmp(arg, "autoask") == 0) | ||
813 | value = SSHCTL_MASTER_AUTO_ASK; | ||
814 | else | ||
815 | fatal("%.200s line %d: Bad ControlMaster argument.", | ||
816 | filename, linenum); | ||
817 | if (*activep && *intptr == -1) | ||
818 | *intptr = value; | ||
819 | break; | ||
797 | 820 | ||
798 | case oHashKnownHosts: | 821 | case oHashKnownHosts: |
799 | intptr = &options->hash_known_hosts; | 822 | intptr = &options->hash_known_hosts; |
@@ -816,7 +839,7 @@ parse_int: | |||
816 | /* Check that there is no garbage at end of line. */ | 839 | /* Check that there is no garbage at end of line. */ |
817 | if ((arg = strdelim(&s)) != NULL && *arg != '\0') { | 840 | if ((arg = strdelim(&s)) != NULL && *arg != '\0') { |
818 | fatal("%.200s line %d: garbage at end of line; \"%.200s\".", | 841 | fatal("%.200s line %d: garbage at end of line; \"%.200s\".", |
819 | filename, linenum, arg); | 842 | filename, linenum, arg); |
820 | } | 843 | } |
821 | return 0; | 844 | return 0; |
822 | } | 845 | } |