[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.212 and 1.213

version 1.212, 2013/10/23 03:05:19 version 1.213, 2013/10/24 00:51:48
Line 453 
Line 453 
 {  {
         char *arg, *attrib, *cmd, *cp = *condition, *host;          char *arg, *attrib, *cmd, *cp = *condition, *host;
         const char *ruser;          const char *ruser;
         int r, port, result = 1;          int r, port, result = 1, attributes = 0;
         size_t len;          size_t len;
         char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];          char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];
   
Line 472 
Line 472 
   
         debug3("checking match for '%s' host %s", cp, host);          debug3("checking match for '%s' host %s", cp, host);
         while ((attrib = strdelim(&cp)) && *attrib != '\0') {          while ((attrib = strdelim(&cp)) && *attrib != '\0') {
                   attributes++;
                   if (strcasecmp(attrib, "all") == 0) {
                           if (attributes != 1 ||
                               ((arg = strdelim(&cp)) != NULL && *arg != '\0')) {
                                   error("'all' cannot be combined with other "
                                       "Match attributes");
                                   result = -1;
                                   goto out;
                           }
                           *condition = cp;
                           result = 1;
                           goto out;
                   }
                 if ((arg = strdelim(&cp)) == NULL || *arg == '\0') {                  if ((arg = strdelim(&cp)) == NULL || *arg == '\0') {
                         error("Missing Match criteria for %s", attrib);                          error("Missing Match criteria for %s", attrib);
                         result = -1;                          result = -1;
Line 537 
Line 550 
                         result = -1;                          result = -1;
                         goto out;                          goto out;
                 }                  }
           }
           if (attributes == 0) {
                   error("One or more attributes required for Match");
                   result = -1;
                   goto out;
         }          }
         debug3("match %sfound", result ? "" : "not ");          debug3("match %sfound", result ? "" : "not ");
         *condition = cp;          *condition = cp;

Legend:
Removed from v.1.212  
changed lines
  Added in v.1.213