Subject: parsetime bug in Beta 13

From: Ian Willis <[email-masked]>
Date: Tue, 4 Mar 97 15:06:18 GMT

There is a bug in the modifications made to parsetime() in access.c
in Beta 13, a bracket is in the wrong place causing access limits
involving days other than Any not to be enforced.

The same function is present in ftpcount.c so the original change
plus fix is also appropriate there.

The patch included below fixes the problem (and corrects the formatting).

Ian Willis
SCO Internet Engineering Group, Watford, UK

*** access.c.00	Mon Mar  3 09:39:51 1997
--- access.c	Tue Mar  4 13:38:35 1997
***************
*** 119,131 ****
          }
      }
  
!     if (!validday){
!       if (strncmp(whattime, "Any", 3) == 0) {
              validday = 1;
              whattime += 3;
!       }
!     }else
!         return (0);
  
      if (sscanf(whattime, "%d-%d", &start, &stop) == 2) {
          ltime = curtime->tm_min + 100 * curtime->tm_hour;
--- 119,132 ----
          }
      }
  
!     if (!validday) {
!         if (strncmp(whattime, "Any", 3) == 0) {
              validday = 1;
              whattime += 3;
!         }
!         else
!             return (0);
!     }
  
      if (sscanf(whattime, "%d-%d", &start, &stop) == 2) {
          ltime = curtime->tm_min + 100 * curtime->tm_hour;
*** ftpcount.c.00	Mon Mar  3 13:25:14 1997
--- ftpcount.c	Tue Mar  4 14:57:58 1997
***************
*** 104,121 ****
              if (strncmp(days[loop], whattime, 2) == 0) {
                  whattime += 2;
                  match = 1;
!                 if ((wday == loop) | ((loop == 7) && wday && (wday < 6)))
                      validday = 1;
              }
          }
      }
  
!     if (strncmp(whattime, "Any", 3) == 0) {
!         validday = 1;
!         whattime += 3;
      }
-     if (!validday)
-         return (0);
  
      if (sscanf(whattime, "%d-%d", &start, &stop) == 2) {
          ltime = curtime->tm_min + 100 * curtime->tm_hour;
--- 104,123 ----
              if (strncmp(days[loop], whattime, 2) == 0) {
                  whattime += 2;
                  match = 1;
!                 if ((wday == loop) || ((loop == 7) && wday && (wday < 6)))
                      validday = 1;
              }
          }
      }
  
!     if (!validday) {
!         if (strncmp(whattime, "Any", 3) == 0) {
!             validday = 1;
!             whattime += 3;
!         }
!         else
!             return (0);
      }
  
      if (sscanf(whattime, "%d-%d", &start, &stop) == 2) {
          ltime = curtime->tm_min + 100 * curtime->tm_hour;