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

Diff for /src/usr.bin/ssh/auth2.c between version 1.81 and 1.82

version 1.81, 2002/01/11 13:39:36 version 1.82, 2002/01/13 17:57:37
Line 533 
Line 533 
 authmethods_get(void)  authmethods_get(void)
 {  {
         Authmethod *method = NULL;          Authmethod *method = NULL;
         u_int size = 0;          Buffer b;
         char *list;          char *list;
   
           buffer_init(&b);
         for (method = authmethods; method->name != NULL; method++) {          for (method = authmethods; method->name != NULL; method++) {
                 if (strcmp(method->name, "none") == 0)                  if (strcmp(method->name, "none") == 0)
                         continue;                          continue;
                 if (method->enabled != NULL && *(method->enabled) != 0) {                  if (method->enabled != NULL && *(method->enabled) != 0) {
                         if (size != 0)                          if (buffer_len(&b) > 0)
                                 size += strlen(DELIM);                                  buffer_append(&b, ",", 1);
                         size += strlen(method->name);                          buffer_append(&b, method->name, strlen(method->name));
                 }                  }
         }          }
         size++;                 /* trailing '\0' */          buffer_append(&b, "\0", 1);
         list = xmalloc(size);          list = xstrdup(buffer_ptr(&b));
         list[0] = '\0';          buffer_free(&b);
   
         for (method = authmethods; method->name != NULL; method++) {  
                 if (strcmp(method->name, "none") == 0)  
                         continue;  
                 if (method->enabled != NULL && *(method->enabled) != 0) {  
                         if (list[0] != '\0')  
                                 strlcat(list, DELIM, size);  
                         strlcat(list, method->name, size);  
                 }  
         }  
         return list;          return list;
 }  }
   

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82