~ubuntu-branches/ubuntu/precise/sarg/precise

« back to all changes in this revision

Viewing changes to exclude.c

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-06-09 17:10:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060609171026-vprx1f7juivk1qzz
Tags: 2.2.1-1
* New upstream release
  - Fixes various segfaults (Closes: #362310)

* debian/sarg-reports.cron.{weekly,monthly}
  - Fixed typo (Closes: #365336)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * AUTHOR: Pedro Lineu Orso                      orso@penguintech.com.br
3
 
 *                                                            1998, 2005
 
2
 * AUTHOR: Pedro Lineu Orso                         pedro.orso@gmail.com
 
3
 *                                                            1998, 2006
4
4
 * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
5
5
 *
6
6
 * SARG donations:
25
25
 
26
26
#include "include/conf.h"
27
27
 
28
 
int vhexclude(char *excludefile, char *ip)
 
28
int vhexclude(char *excludefile, char *url)
29
29
{
30
30
 
31
31
   char whost[1024];
32
 
   char wip1[1024], wip2[1024];
33
 
   char sn1[4], sn2[4], sn3[4];
34
32
   char str[strlen(excludefile)];
 
33
   char wurl[strlen(url)];
 
34
   char wurl2[strlen(url)];
35
35
 
36
36
   whost[0]='\0';
37
37
   strcpy(str,excludefile);
 
38
   strcpy(wurl,url);
 
39
 
38
40
   getword(whost,str,' ');
39
41
   
40
 
   while(strcmp(whost,"*FIM*") != 0) {
41
 
      if(strcmp(ip,whost) ==0)
42
 
         return(0);
43
 
 
44
 
      strcpy(wip1,ip);
45
 
      getword(sn1,wip1,'.');
46
 
      getword(sn2,wip1,'.');
47
 
      getword(sn3,wip1,'.');
48
 
 
49
 
      sprintf(wip1,"%s.%s.%s.0",sn1,sn2,sn3);
50
 
      sprintf(wip2,"%s.%s.0.0",sn1,sn2);
51
 
 
52
 
      if(strstr(whost,wip1) !=0)
53
 
         return(0);
54
 
 
55
 
      if(strstr(whost,wip2) !=0)
56
 
         return(0);
57
 
 
 
42
   if(strchr(wurl,':') != 0) {
 
43
      getword(warea,wurl,':');
 
44
      strcpy(wurl,warea);
 
45
   }
 
46
 
 
47
   while(strcmp(whost,"*END*") != 0) {
 
48
      if(strcmp(wurl,whost) == 0)
 
49
         return(0);
 
50
      if(strchr(whost,'*') != 0) {
 
51
         getword(warea,whost,'.');
 
52
         getword(warea,wurl,'.');
 
53
         if(strcmp(wurl,whost) == 0)
 
54
            return(0);
 
55
      }
58
56
      getword(whost,str,' ');
59
57
   }
60
58