[BACK]Return to readconf.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/readconf.c between version 1.39 and 1.40

version 1.39, 2000/07/09 01:27:33 version 1.40, 2000/07/10 16:27:05
Line 259 
Line 259 
                 intptr = &options->forward_agent;                  intptr = &options->forward_agent;
 parse_flag:  parse_flag:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing yes/no argument.", filename, linenum);                          fatal("%.200s line %d: Missing yes/no argument.", filename, linenum);
                 value = 0;      /* To avoid compiler warning... */                  value = 0;      /* To avoid compiler warning... */
                 if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)                  if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
Line 345 
Line 345 
         case oStrictHostKeyChecking:          case oStrictHostKeyChecking:
                 intptr = &options->strict_host_key_checking;                  intptr = &options->strict_host_key_checking;
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing yes/no argument.",                          fatal("%.200s line %d: Missing yes/no argument.",
                               filename, linenum);                                filename, linenum);
                 value = 0;      /* To avoid compiler warning... */                  value = 0;      /* To avoid compiler warning... */
Line 380 
Line 380 
         case oIdentityFile:          case oIdentityFile:
         case oIdentityFile2:          case oIdentityFile2:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (*activep) {                  if (*activep) {
                         intptr = (opcode == oIdentityFile) ?                          intptr = (opcode == oIdentityFile) ?
Line 405 
Line 405 
                 charptr = &options->user;                  charptr = &options->user;
 parse_string:  parse_string:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (*activep && *charptr == NULL)                  if (*activep && *charptr == NULL)
                         *charptr = xstrdup(arg);                          *charptr = xstrdup(arg);
Line 434 
Line 434 
         case oProxyCommand:          case oProxyCommand:
                 charptr = &options->proxy_command;                  charptr = &options->proxy_command;
                 string = xstrdup("");                  string = xstrdup("");
                 while ((arg = strsep(&s, WHITESPACE)) != NULL) {                  while ((arg = strsep(&s, WHITESPACE)) != NULL && *arg != '\0') {
                         string = xrealloc(string, strlen(string) + strlen(arg) + 2);                          string = xrealloc(string, strlen(string) + strlen(arg) + 2);
                         strcat(string, " ");                          strcat(string, " ");
                         strcat(string, arg);                          strcat(string, arg);
Line 449 
Line 449 
                 intptr = &options->port;                  intptr = &options->port;
 parse_int:  parse_int:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (arg[0] < '0' || arg[0] > '9')                  if (arg[0] < '0' || arg[0] > '9')
                         fatal("%.200s line %d: Bad number.", filename, linenum);                          fatal("%.200s line %d: Bad number.", filename, linenum);
Line 469 
Line 469 
         case oCipher:          case oCipher:
                 intptr = &options->cipher;                  intptr = &options->cipher;
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 value = cipher_number(arg);                  value = cipher_number(arg);
                 if (value == -1)                  if (value == -1)
Line 481 
Line 481 
   
         case oCiphers:          case oCiphers:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (!ciphers_valid(arg))                  if (!ciphers_valid(arg))
                         fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",                          fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
Line 493 
Line 493 
         case oProtocol:          case oProtocol:
                 intptr = &options->protocol;                  intptr = &options->protocol;
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 value = proto_spec(arg);                  value = proto_spec(arg);
                 if (value == SSH_PROTO_UNKNOWN)                  if (value == SSH_PROTO_UNKNOWN)
Line 516 
Line 516 
   
         case oRemoteForward:          case oRemoteForward:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (arg[0] < '0' || arg[0] > '9')                  if (arg[0] < '0' || arg[0] > '9')
                         fatal("%.200s line %d: Badly formatted port number.",                          fatal("%.200s line %d: Badly formatted port number.",
                               filename, linenum);                                filename, linenum);
                 fwd_port = atoi(arg);                  fwd_port = atoi(arg);
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing second argument.",                          fatal("%.200s line %d: Missing second argument.",
                               filename, linenum);                                filename, linenum);
                 if (sscanf(arg, "%255[^:]:%hu", buf, &fwd_host_port) != 2)                  if (sscanf(arg, "%255[^:]:%hu", buf, &fwd_host_port) != 2)
Line 535 
Line 535 
   
         case oLocalForward:          case oLocalForward:
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (arg[0] < '0' || arg[0] > '9')                  if (arg[0] < '0' || arg[0] > '9')
                         fatal("%.200s line %d: Badly formatted port number.",                          fatal("%.200s line %d: Badly formatted port number.",
                               filename, linenum);                                filename, linenum);
                 fwd_port = atoi(arg);                  fwd_port = atoi(arg);
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing second argument.",                          fatal("%.200s line %d: Missing second argument.",
                               filename, linenum);                                filename, linenum);
                 if (sscanf(arg, "%255[^:]:%hu", buf, &fwd_host_port) != 2)                  if (sscanf(arg, "%255[^:]:%hu", buf, &fwd_host_port) != 2)
Line 554 
Line 554 
   
         case oHost:          case oHost:
                 *activep = 0;                  *activep = 0;
                 while ((arg = strsep(&s, WHITESPACE)) != NULL)                  while ((arg = strsep(&s, WHITESPACE)) != NULL && *arg != '\0')
                         if (match_pattern(host, arg)) {                          if (match_pattern(host, arg)) {
                                 debug("Applying options for %.100s", arg);                                  debug("Applying options for %.100s", arg);
                                 *activep = 1;                                  *activep = 1;
                                 break;                                  break;
                         }                          }
                 /* Avoid garbage check below, as strsep already returned NULL. */                  /* Avoid garbage check below, as strsep is done. */
                 return 0;                  return 0;
   
         case oEscapeChar:          case oEscapeChar:
                 intptr = &options->escape_char;                  intptr = &options->escape_char;
                 arg = strsep(&s, WHITESPACE);                  arg = strsep(&s, WHITESPACE);
                 if (!arg)                  if (!arg || *arg == '\0')
                         fatal("%.200s line %d: Missing argument.", filename, linenum);                          fatal("%.200s line %d: Missing argument.", filename, linenum);
                 if (arg[0] == '^' && arg[2] == 0 &&                  if (arg[0] == '^' && arg[2] == 0 &&
                     (unsigned char) arg[1] >= 64 && (unsigned char) arg[1] < 128)                      (unsigned char) arg[1] >= 64 && (unsigned char) arg[1] < 128)

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40