summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
commit9f0f5c64bc4b6144e3fed6a7f538f7c21819a492 (patch)
treef79317ab211f59181a61b526f566e9c8cfe70c73 /readconf.c
parent89681214ca2f50a1b1ed6164c3afe1ce14995ffc (diff)
- deraadt@cvs.openbsd.org 2001/12/19 07:18:56
[auth1.c auth2.c auth2-chall.c auth-bsdauth.c auth.c authfile.c auth.h] [auth-krb4.c auth-rhosts.c auth-skey.c bufaux.c canohost.c channels.c] [cipher.c clientloop.c compat.c compress.c deattack.c key.c log.c mac.c] [match.c misc.c nchan.c packet.c readconf.c rijndael.c rijndael.h scard.c] [servconf.c servconf.h serverloop.c session.c sftp.c sftp-client.c] [sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c] [sshconnect1.c sshconnect2.c sshconnect.c sshd.8 sshd.c sshd_config] [ssh-keygen.c sshlogin.c sshpty.c sshtty.c ttymodes.c uidswap.c] basic KNF done while i was looking for something else
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/readconf.c b/readconf.c
index 19fcfdd3f..6db96b978 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.92 2001/11/17 19:14:34 stevesk Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.93 2001/12/19 07:18:56 deraadt Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -115,7 +115,7 @@ typedef enum {
115 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, 115 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
116 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, 116 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
117 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, 117 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
118 oClearAllForwardings, oNoHostAuthenticationForLocalhost 118 oClearAllForwardings, oNoHostAuthenticationForLocalhost
119} OpCodes; 119} OpCodes;
120 120
121/* Textual representations of the tokens. */ 121/* Textual representations of the tokens. */
@@ -185,8 +185,8 @@ static struct {
185 { "hostkeyalgorithms", oHostKeyAlgorithms }, 185 { "hostkeyalgorithms", oHostKeyAlgorithms },
186 { "bindaddress", oBindAddress }, 186 { "bindaddress", oBindAddress },
187 { "smartcarddevice", oSmartcardDevice }, 187 { "smartcarddevice", oSmartcardDevice },
188 { "clearallforwardings", oClearAllForwardings }, 188 { "clearallforwardings", oClearAllForwardings },
189 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 189 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
190 { NULL, oBadOption } 190 { NULL, oBadOption }
191}; 191};
192 192
@@ -225,7 +225,7 @@ add_remote_forward(Options *options, u_short port, const char *host,
225 Forward *fwd; 225 Forward *fwd;
226 if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) 226 if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)
227 fatal("Too many remote forwards (max %d).", 227 fatal("Too many remote forwards (max %d).",
228 SSH_MAX_FORWARDS_PER_DIRECTION); 228 SSH_MAX_FORWARDS_PER_DIRECTION);
229 fwd = &options->remote_forwards[options->num_remote_forwards++]; 229 fwd = &options->remote_forwards[options->num_remote_forwards++];
230 fwd->port = port; 230 fwd->port = port;
231 fwd->host = xstrdup(host); 231 fwd->host = xstrdup(host);
@@ -394,7 +394,7 @@ parse_flag:
394 arg = strdelim(&s); 394 arg = strdelim(&s);
395 if (!arg || *arg == '\0') 395 if (!arg || *arg == '\0')
396 fatal("%.200s line %d: Missing yes/no/ask argument.", 396 fatal("%.200s line %d: Missing yes/no/ask argument.",
397 filename, linenum); 397 filename, linenum);
398 value = 0; /* To avoid compiler warning... */ 398 value = 0; /* To avoid compiler warning... */
399 if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0) 399 if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
400 value = 1; 400 value = 1;
@@ -436,7 +436,7 @@ parse_flag:
436 intptr = &options->num_identity_files; 436 intptr = &options->num_identity_files;
437 if (*intptr >= SSH_MAX_IDENTITY_FILES) 437 if (*intptr >= SSH_MAX_IDENTITY_FILES)
438 fatal("%.200s line %d: Too many identity files specified (max %d).", 438 fatal("%.200s line %d: Too many identity files specified (max %d).",
439 filename, linenum, SSH_MAX_IDENTITY_FILES); 439 filename, linenum, SSH_MAX_IDENTITY_FILES);
440 charptr = &options->identity_files[*intptr]; 440 charptr = &options->identity_files[*intptr];
441 *charptr = xstrdup(arg); 441 *charptr = xstrdup(arg);
442 *intptr = *intptr + 1; 442 *intptr = *intptr + 1;
@@ -536,7 +536,7 @@ parse_int:
536 value = cipher_number(arg); 536 value = cipher_number(arg);
537 if (value == -1) 537 if (value == -1)
538 fatal("%.200s line %d: Bad cipher '%s'.", 538 fatal("%.200s line %d: Bad cipher '%s'.",
539 filename, linenum, arg ? arg : "<NONE>"); 539 filename, linenum, arg ? arg : "<NONE>");
540 if (*activep && *intptr == -1) 540 if (*activep && *intptr == -1)
541 *intptr = value; 541 *intptr = value;
542 break; 542 break;
@@ -547,7 +547,7 @@ parse_int:
547 fatal("%.200s line %d: Missing argument.", filename, linenum); 547 fatal("%.200s line %d: Missing argument.", filename, linenum);
548 if (!ciphers_valid(arg)) 548 if (!ciphers_valid(arg))
549 fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.", 549 fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
550 filename, linenum, arg ? arg : "<NONE>"); 550 filename, linenum, arg ? arg : "<NONE>");
551 if (*activep && options->ciphers == NULL) 551 if (*activep && options->ciphers == NULL)
552 options->ciphers = xstrdup(arg); 552 options->ciphers = xstrdup(arg);
553 break; 553 break;
@@ -558,7 +558,7 @@ parse_int:
558 fatal("%.200s line %d: Missing argument.", filename, linenum); 558 fatal("%.200s line %d: Missing argument.", filename, linenum);
559 if (!mac_valid(arg)) 559 if (!mac_valid(arg))
560 fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.", 560 fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.",
561 filename, linenum, arg ? arg : "<NONE>"); 561 filename, linenum, arg ? arg : "<NONE>");
562 if (*activep && options->macs == NULL) 562 if (*activep && options->macs == NULL)
563 options->macs = xstrdup(arg); 563 options->macs = xstrdup(arg);
564 break; 564 break;
@@ -569,7 +569,7 @@ parse_int:
569 fatal("%.200s line %d: Missing argument.", filename, linenum); 569 fatal("%.200s line %d: Missing argument.", filename, linenum);
570 if (!key_names_valid2(arg)) 570 if (!key_names_valid2(arg))
571 fatal("%.200s line %d: Bad protocol 2 host key algorithms '%s'.", 571 fatal("%.200s line %d: Bad protocol 2 host key algorithms '%s'.",
572 filename, linenum, arg ? arg : "<NONE>"); 572 filename, linenum, arg ? arg : "<NONE>");
573 if (*activep && options->hostkeyalgorithms == NULL) 573 if (*activep && options->hostkeyalgorithms == NULL)
574 options->hostkeyalgorithms = xstrdup(arg); 574 options->hostkeyalgorithms = xstrdup(arg);
575 break; 575 break;
@@ -582,7 +582,7 @@ parse_int:
582 value = proto_spec(arg); 582 value = proto_spec(arg);
583 if (value == SSH_PROTO_UNKNOWN) 583 if (value == SSH_PROTO_UNKNOWN)
584 fatal("%.200s line %d: Bad protocol spec '%s'.", 584 fatal("%.200s line %d: Bad protocol spec '%s'.",
585 filename, linenum, arg ? arg : "<NONE>"); 585 filename, linenum, arg ? arg : "<NONE>");
586 if (*activep && *intptr == SSH_PROTO_UNKNOWN) 586 if (*activep && *intptr == SSH_PROTO_UNKNOWN)
587 *intptr = value; 587 *intptr = value;
588 break; 588 break;
@@ -593,7 +593,7 @@ parse_int:
593 value = log_level_number(arg); 593 value = log_level_number(arg);
594 if (value == (LogLevel) - 1) 594 if (value == (LogLevel) - 1)
595 fatal("%.200s line %d: unsupported log level '%s'", 595 fatal("%.200s line %d: unsupported log level '%s'",
596 filename, linenum, arg ? arg : "<NONE>"); 596 filename, linenum, arg ? arg : "<NONE>");
597 if (*activep && (LogLevel) * intptr == -1) 597 if (*activep && (LogLevel) * intptr == -1)
598 *intptr = (LogLevel) value; 598 *intptr = (LogLevel) value;
599 break; 599 break;
@@ -670,7 +670,7 @@ parse_int:
670 value = SSH_ESCAPECHAR_NONE; 670 value = SSH_ESCAPECHAR_NONE;
671 else { 671 else {
672 fatal("%.200s line %d: Bad escape character.", 672 fatal("%.200s line %d: Bad escape character.",
673 filename, linenum); 673 filename, linenum);
674 /* NOTREACHED */ 674 /* NOTREACHED */
675 value = 0; /* Avoid compiler warning. */ 675 value = 0; /* Avoid compiler warning. */
676 } 676 }
@@ -685,7 +685,7 @@ parse_int:
685 /* Check that there is no garbage at end of line. */ 685 /* Check that there is no garbage at end of line. */
686 if ((arg = strdelim(&s)) != NULL && *arg != '\0') { 686 if ((arg = strdelim(&s)) != NULL && *arg != '\0') {
687 fatal("%.200s line %d: garbage at end of line; \"%.200s\".", 687 fatal("%.200s line %d: garbage at end of line; \"%.200s\".",
688 filename, linenum, arg); 688 filename, linenum, arg);
689 } 689 }
690 return 0; 690 return 0;
691} 691}
@@ -727,7 +727,7 @@ read_config_file(const char *filename, const char *host, Options *options)
727 fclose(f); 727 fclose(f);
728 if (bad_options > 0) 728 if (bad_options > 0)
729 fatal("%s: terminating, %d bad configuration options", 729 fatal("%s: terminating, %d bad configuration options",
730 filename, bad_options); 730 filename, bad_options);
731 return 1; 731 return 1;
732} 732}
733 733