Difference for server/ban.c from version 1.6 to 1.7


version 1.6 version 1.7
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_ban_c =   * static char *rcsid_ban_c =
  *   "$Id: ban.c,v 1.6 2002/09/07 22:08:07 mwedel Exp $";   *   "$Id: ban.c,v 1.7 2003/07/26 02:10:40 temitchell Exp $";
  */   */
   
 /*  /*
Line 33
 
Line 33
   char  *indexpos;    char  *indexpos;
   int           num1;    int           num1;
   int   Hits=0;                 /* Hits==2 means we're banned */    int   Hits=0;                 /* Hits==2 means we're banned */
     int loop=0;
   
    while (loop < 2) { /* have to check both ban files now */
   
    /* First time through look for BANFILE */
   
    if (loop == 0){
   sprintf (buf, "%s/%s", settings.confdir, BANFILE);    sprintf (buf, "%s/%s", settings.confdir, BANFILE);
   if ((bannedfile = fopen(buf, "r")) == NULL) {    if ((bannedfile = fopen(buf, "r")) == NULL) {
     LOG (llevDebug, "Could not find file Banned file.\n");      LOG (llevDebug, "Could not find file Banned file\n");
       loop++;
     }
    }
   
    /* Second time through look for BANISHFILE */
   
     if (loop == 1){
     sprintf (buf, "%s/%s", settings.localdir, BANISHFILE);
    if ((bannedfile = fopen(buf, "r")) == NULL) {
       LOG (llevDebug, "Could not find file Banish file\n");
     return(0);      return(0);
   }    }
    }
   
    /* Do the actual work here checking for banned IPs */
    
   while(fgets(line_buf, 160, bannedfile) != NULL) {    while(fgets(line_buf, 160, bannedfile) != NULL) {
     /* Split line up */      /* Split line up */
     if((*line_buf=='#')||(*line_buf=='\n'))      if((*line_buf=='#')||(*line_buf=='\n'))
Line 88
 
Line 108
   fclose(bannedfile);    fclose(bannedfile);
   if(Hits>=2)    if(Hits>=2)
     return(1);      return(1);
   else    loop++; 
    }
     return(0);      return(0);
 }  }


Legend:
line(s) removed in v.1.6 
line(s) changed
 line(s) added in v.1.7

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:26