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

Diff for /src/usr.bin/ssh/servconf.c between version 1.290 and 1.291

version 1.290, 2016/05/04 14:00:09 version 1.291, 2016/06/17 05:03:40
Line 363 
Line 363 
         for (i = 0; i < options->num_host_cert_files; i++)          for (i = 0; i < options->num_host_cert_files; i++)
                 CLEAR_ON_NONE(options->host_cert_files[i]);                  CLEAR_ON_NONE(options->host_cert_files[i]);
 #undef CLEAR_ON_NONE  #undef CLEAR_ON_NONE
   
           /* Similar handling for AuthenticationMethods=any */
           if (options->num_auth_methods == 1 &&
               strcmp(options->auth_methods[0], "any") == 0) {
                   free(options->auth_methods[0]);
                   options->auth_methods[0] = NULL;
                   options->num_auth_methods = 0;
           }
   
 }  }
   
 /* Keyword tokens. */  /* Keyword tokens. */
Line 1752 
Line 1761 
   
         case sAuthenticationMethods:          case sAuthenticationMethods:
                 if (options->num_auth_methods == 0) {                  if (options->num_auth_methods == 0) {
                           value = 0; /* seen "any" pseudo-method */
                         while ((arg = strdelim(&cp)) && *arg != '\0') {                          while ((arg = strdelim(&cp)) && *arg != '\0') {
                                 if (options->num_auth_methods >=                                  if (options->num_auth_methods >=
                                     MAX_AUTH_METHODS)                                      MAX_AUTH_METHODS)
                                         fatal("%s line %d: "                                          fatal("%s line %d: "
                                             "too many authentication methods.",                                              "too many authentication methods.",
                                             filename, linenum);                                              filename, linenum);
                                 if (auth2_methods_valid(arg, 0) != 0)                                  if (strcmp(arg, "any") == 0) {
                                           if (options->num_auth_methods > 0) {
                                                   fatal("%s line %d: \"any\" "
                                                       "must appear alone in "
                                                       "AuthenticationMethods",
                                                       filename, linenum);
                                           }
                                           value = 1;
                                   } else if (value) {
                                           fatal("%s line %d: \"any\" must appear "
                                               "alone in AuthenticationMethods",
                                               filename, linenum);
                                   } else if (auth2_methods_valid(arg, 0) != 0) {
                                         fatal("%s line %d: invalid "                                          fatal("%s line %d: invalid "
                                             "authentication method list.",                                              "authentication method list.",
                                             filename, linenum);                                              filename, linenum);
                                   }
                                 if (!*activep)                                  if (!*activep)
                                         continue;                                          continue;
                                 options->auth_methods[                                  options->auth_methods[
                                     options->num_auth_methods++] = xstrdup(arg);                                      options->num_auth_methods++] = xstrdup(arg);
                         }                          }
                           if (options->num_auth_methods == 0) {
                                   fatal("%s line %d: no AuthenticationMethods "
                                       "specified", filename, linenum);
                           }
                 }                  }
                 return 0;                  return 0;
   
Line 2143 
Line 2170 
 {  {
         u_int i;          u_int i;
   
         if (count <= 0)          if (count <= 0 && code != sAuthenticationMethods)
                 return;                  return;
         printf("%s", lookup_opcode_name(code));          printf("%s", lookup_opcode_name(code));
         for (i = 0; i < count; i++)          for (i = 0; i < count; i++)
                 printf(" %s",  vals[i]);                  printf(" %s",  vals[i]);
           if (code == sAuthenticationMethods && count == 0)
                   printf(" any");
         printf("\n");          printf("\n");
 }  }
   

Legend:
Removed from v.1.290  
changed lines
  Added in v.1.291