[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.370 and 1.371

version 1.370, 2022/11/28 01:37:36 version 1.371, 2023/01/02 07:03:30
Line 1554 
Line 1554 
         case oPermitRemoteOpen:          case oPermitRemoteOpen:
                 uintptr = &options->num_permitted_remote_opens;                  uintptr = &options->num_permitted_remote_opens;
                 cppptr = &options->permitted_remote_opens;                  cppptr = &options->permitted_remote_opens;
                 arg = argv_next(&ac, &av);  
                 if (!arg || *arg == '\0')  
                         fatal("%s line %d: missing %s specification",  
                             filename, linenum, lookup_opcode_name(opcode));  
                 uvalue = *uintptr;      /* modified later */                  uvalue = *uintptr;      /* modified later */
                 if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) {                  i = 0;
                         if (*activep && uvalue == 0) {  
                                 *uintptr = 1;  
                                 *cppptr = xcalloc(1, sizeof(**cppptr));  
                                 (*cppptr)[0] = xstrdup(arg);  
                         }  
                         break;  
                 }  
                 while ((arg = argv_next(&ac, &av)) != NULL) {                  while ((arg = argv_next(&ac, &av)) != NULL) {
                         arg2 = xstrdup(arg);                          arg2 = xstrdup(arg);
                         p = hpdelim(&arg);                          /* Allow any/none only in first position */
                         if (p == NULL) {                          if (strcasecmp(arg, "none") == 0 ||
                                 fatal("%s line %d: missing host in %s",                              strcasecmp(arg, "any") == 0) {
                                     filename, linenum,                                  if (i > 0 || ac > 0) {
                                     lookup_opcode_name(opcode));                                          error("%s line %d: keyword %s \"%s\" "
                                               "argument must appear alone.",
                                               filename, linenum, keyword, arg);
                                           goto out;
                                   }
                           } else {
                                   p = hpdelim(&arg);
                                   if (p == NULL) {
                                           fatal("%s line %d: missing host in %s",
                                               filename, linenum,
                                               lookup_opcode_name(opcode));
                                   }
                                   p = cleanhostname(p);
                                   /*
                                    * don't want to use permitopen_port to avoid
                                    * dependency on channels.[ch] here.
                                    */
                                   if (arg == NULL || (strcmp(arg, "*") != 0 &&
                                       a2port(arg) <= 0)) {
                                           fatal("%s line %d: bad port number "
                                               "in %s", filename, linenum,
                                               lookup_opcode_name(opcode));
                                   }
                         }                          }
                         p = cleanhostname(p);  
                         /*  
                          * don't want to use permitopen_port to avoid  
                          * dependency on channels.[ch] here.  
                          */  
                         if (arg == NULL ||  
                             (strcmp(arg, "*") != 0 && a2port(arg) <= 0)) {  
                                 fatal("%s line %d: bad port number in %s",  
                                     filename, linenum,  
                                     lookup_opcode_name(opcode));  
                         }  
                         if (*activep && uvalue == 0) {                          if (*activep && uvalue == 0) {
                                 opt_array_append(filename, linenum,                                  opt_array_append(filename, linenum,
                                     lookup_opcode_name(opcode),                                      lookup_opcode_name(opcode),
                                     cppptr, uintptr, arg2);                                      cppptr, uintptr, arg2);
                         }                          }
                         free(arg2);                          free(arg2);
                           i++;
                 }                  }
                   if (i == 0)
                           fatal("%s line %d: missing %s specification",
                               filename, linenum, lookup_opcode_name(opcode));
                 break;                  break;
   
         case oClearAllForwardings:          case oClearAllForwardings:

Legend:
Removed from v.1.370  
changed lines
  Added in v.1.371