diff options
author | Colin Watson <cjwatson@debian.org> | 2005-09-14 12:45:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-09-14 12:45:47 +0000 |
commit | 9b71add4cecf753c45f5fbd6ff0913bc95b3e95d (patch) | |
tree | d4ea8fdb30c7949c6433f5277c39548ea579d4dc /readconf.c | |
parent | ed07bcbea56007ab5b218ddf3aa6a7d4e21966e0 (diff) | |
parent | 16704d57999d987fb8d9ba53379841a79f016d67 (diff) |
Merge 4.2p1 to the trunk.
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 be14cd5b8..d2c5a77f7 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" |
@@ -698,7 +698,7 @@ parse_int: | |||
698 | fwd.listen_host = cleanhostname(fwd.listen_host); | 698 | fwd.listen_host = cleanhostname(fwd.listen_host); |
699 | } else { | 699 | } else { |
700 | fwd.listen_port = a2port(fwd.listen_host); | 700 | fwd.listen_port = a2port(fwd.listen_host); |
701 | fwd.listen_host = ""; | 701 | fwd.listen_host = NULL; |
702 | } | 702 | } |
703 | if (fwd.listen_port == 0) | 703 | if (fwd.listen_port == 0) |
704 | fatal("%.200s line %d: Badly formatted port number.", | 704 | fatal("%.200s line %d: Badly formatted port number.", |
@@ -746,6 +746,9 @@ parse_int: | |||
746 | 746 | ||
747 | case oAddressFamily: | 747 | case oAddressFamily: |
748 | arg = strdelim(&s); | 748 | arg = strdelim(&s); |
749 | if (!arg || *arg == '\0') | ||
750 | fatal("%s line %d: missing address family.", | ||
751 | filename, linenum); | ||
749 | intptr = &options->address_family; | 752 | intptr = &options->address_family; |
750 | if (strcasecmp(arg, "inet") == 0) | 753 | if (strcasecmp(arg, "inet") == 0) |
751 | value = AF_INET; | 754 | value = AF_INET; |
@@ -797,7 +800,27 @@ parse_int: | |||
797 | 800 | ||
798 | case oControlMaster: | 801 | case oControlMaster: |
799 | intptr = &options->control_master; | 802 | intptr = &options->control_master; |
800 | goto parse_yesnoask; | 803 | arg = strdelim(&s); |
804 | if (!arg || *arg == '\0') | ||
805 | fatal("%.200s line %d: Missing ControlMaster argument.", | ||
806 | filename, linenum); | ||
807 | value = 0; /* To avoid compiler warning... */ | ||
808 | if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0) | ||
809 | value = SSHCTL_MASTER_YES; | ||
810 | else if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0) | ||
811 | value = SSHCTL_MASTER_NO; | ||
812 | else if (strcmp(arg, "auto") == 0) | ||
813 | value = SSHCTL_MASTER_AUTO; | ||
814 | else if (strcmp(arg, "ask") == 0) | ||
815 | value = SSHCTL_MASTER_ASK; | ||
816 | else if (strcmp(arg, "autoask") == 0) | ||
817 | value = SSHCTL_MASTER_AUTO_ASK; | ||
818 | else | ||
819 | fatal("%.200s line %d: Bad ControlMaster argument.", | ||
820 | filename, linenum); | ||
821 | if (*activep && *intptr == -1) | ||
822 | *intptr = value; | ||
823 | break; | ||
801 | 824 | ||
802 | case oHashKnownHosts: | 825 | case oHashKnownHosts: |
803 | intptr = &options->hash_known_hosts; | 826 | intptr = &options->hash_known_hosts; |
@@ -824,7 +847,7 @@ parse_int: | |||
824 | /* Check that there is no garbage at end of line. */ | 847 | /* Check that there is no garbage at end of line. */ |
825 | if ((arg = strdelim(&s)) != NULL && *arg != '\0') { | 848 | if ((arg = strdelim(&s)) != NULL && *arg != '\0') { |
826 | fatal("%.200s line %d: garbage at end of line; \"%.200s\".", | 849 | fatal("%.200s line %d: garbage at end of line; \"%.200s\".", |
827 | filename, linenum, arg); | 850 | filename, linenum, arg); |
828 | } | 851 | } |
829 | return 0; | 852 | return 0; |
830 | } | 853 | } |