]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Patch #2224623 applied.
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 26 Jun 2009 07:41:39 +0000 (07:41 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 26 Jun 2009 07:41:39 +0000 (07:41 +0000)
authfail.c
convlog.c
dansguardian_log.c
dansguardian_report.c
datafile.c
denied.c
download.c
html.c
log.c
splitlog.c

index 5a933c4edd3a26bc03f0e13c36e790fd9484d1ad..e28dc5276e77038a66436246caaa4ef42d88a79b 100644 (file)
@@ -74,12 +74,20 @@ void authfail_report()
    fgets(period,sizeof(period),fp_in);
    fclose(fp_in);
 
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(authfail_in,"r"))==NULL) {
+#else
    if((fp_in=fopen(authfail_in,"r"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (authfail) %s: %s\n",text[45],authfail_in);
      exit(1);
    }
 
+#if defined(HAVE_FOPEN64)
+   if((fp_ou=(long)fopen64(report,"w"))==NULL) {
+#else
    if((fp_ou=fopen(report,"w"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (authfail) %s: %s\n",text[45],report);
      exit(1);
    }
index 6fefe3844a92179ed6b75b93bb5fc371fdbf02c2..2c09b9e04e9150a38e49f6b7645d8f26797ad558 100644 (file)
--- a/convlog.c
+++ b/convlog.c
@@ -41,7 +41,11 @@ void convlog(char *arq, char *df, int dfrom, int duntil)
    if(arq[0] == '\0')
       strcpy(arq,"/usr/local/squid/logs/access.log");
 
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(arq,"r"))==NULL) {
+#else
    if((fp_in=fopen(arq,"r"))==NULL) {
+#endif
       fprintf(stderr, "SARG: (convlog) %s: %s\n",text[8],arq);
       exit(1);
    }
index ced1d5c1ce926e8995c15a5330866d29e7a77cb1..6b526d8efcaade48ba025e231ba46ff385697c0f 100644 (file)
@@ -86,7 +86,11 @@ int dansguardian_log()
       exit(1);
    }
 
+#if defined(HAVE_FOPEN64)
+   if((fp_ou=(long)fopen64(guard_in,"a"))==NULL) {
+#else
    if((fp_ou=fopen(guard_in,"a"))==NULL) {
+#endif
       fprintf(stderr, "SARG: (dansguardian) %s: %s\n",text[8],guard_in);
       exit(1);
    }
@@ -115,7 +119,11 @@ int dansguardian_log()
       debuga(msg);
    }
    
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(loglocation,"r"))==NULL) {
+#else
    if((fp_in=fopen(loglocation,"r"))==NULL) {
+#endif
       fprintf(stderr, "SARG: (dansguardian) %s: %s\n",text[8],loglocation);
       exit(1);
    }
index ed90cf17d54e500af1e0a4f39d83030ada4cbc41..3b80de4b2169db0b6ce1fd83620cdf7112279026 100644 (file)
@@ -70,12 +70,20 @@ void dansguardian_report()
    fgets(period,sizeof(period),fp_in);
    fclose(fp_in);
 
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(dansguardian_in,"r"))==NULL) {
+#else
    if((fp_in=fopen(dansguardian_in,"r"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (dansguardian_report) %s: %s\n",text[8],dansguardian_in);
      exit(1);
    }
 
+#if defined(HAVE_FOPEN64)
+   if((fp_ou=(long)fopen64(report,"w"))==NULL) {
+#else
    if((fp_ou=fopen(report,"w"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (dansguardian_report) %s: %s\n",text[8],report);
      exit(1);
    }
index c8be2cd81728f0da0767703291f981a91820e187..3df03fe2ac3de788c122caf5cd8acad2d149fbe2 100644 (file)
@@ -65,8 +65,12 @@ void data_file(char *tmp)
          continue;
       sprintf(tmp3,"%s/%s",tmp,direntp->d_name);
 
+#if defined(HAVE_FOPEN64)
+      if((fp_in=(long)fopen64(tmp3,"r"))==NULL){
+#else
       if((fp_in=fopen(tmp3,"r"))==NULL){
-         fprintf(stderr, "SARG: (datafile) %s: %s\n",text[45],tmp);
+#endif
+         fprintf(stderr, "SARG: (datafile) %s: %s\n",text[45],tmp);
          exit(1);
       }
       strcpy(wdname,direntp->d_name);
@@ -161,8 +165,12 @@ void saverecs(char *dirname, char *user, long long int nacc, char *url, long lon
    FILE *fp_ou;
    char reg[MAXLEN];
 
+#if defined(HAVE_FOPEN64)
+   if((fp_ou=(long)fopen64(DataFile,"a"))==NULL){
+#else
    if((fp_ou=fopen(DataFile,"a"))==NULL){
-      fprintf(stderr, "SARG: (datafile) %s: %s\n",text[45],DataFile);
+#endif
+       fprintf(stderr, "SARG: (datafile) %s: %s\n",text[45],DataFile);
       exit(1);
    }
 
index ecf276e3c4e5e228eda985f27aa01a337c5fb77b..e793146f968de44c1e23b3dbcecae20f54be9371 100644 (file)
--- a/denied.c
+++ b/denied.c
@@ -66,12 +66,20 @@ void gen_denied_report()
    fgets(period,sizeof(period),fp_in);
    fclose(fp_in);
 
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(denied_in,"r"))==NULL) {
+#else
    if((fp_in=fopen(denied_in,"r"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (denied) %s: %s\n",text[8],denied_in);
      exit(1);
    }
 
+#if defined(HAVE_FOPEN64)
+   if((fp_ou=(long)fopen64(report,"w"))==NULL) {
+#else
    if((fp_ou=fopen(report,"w"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (denied) %s: %s\n",text[8],report);
      exit(1);
    }
index cc1d6c13d86e6fc7674d469348917f142a75b356..a9a0df6492be300af54ed074b292bed71441fd7a 100644 (file)
@@ -67,12 +67,20 @@ void download_report()
    fgets(period,sizeof(period),fp_in);
    fclose(fp_in);
 
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(report_in,"r"))==NULL) {
+#else
    if((fp_in=fopen(report_in,"r"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (download) %s: %s\n",text[8],report_in);
      exit(1);
    }
 
+#if defined(HAVE_FOPEN64)
+   if((fp_ou=(long)fopen64(report,"w"))==NULL) {
+#else
    if((fp_ou=fopen(report,"w"))==NULL) {
+#endif
      fprintf(stderr, "SARG: (download) %s: %s\n",text[8],report);
      exit(1);
    }
diff --git a/html.c b/html.c
index dcc432ad2ab1ed757f417a2c2c5446d8f7afaf32..3b1fbe43806670e1def40e77d5e0032dc941301a 100644 (file)
--- a/html.c
+++ b/html.c
@@ -465,8 +465,12 @@ void htmlrel()
                fprintf(stderr, "SARG: (html6) %s: %s\n",text[45],arqip);
                exit(1);
             }
-   
+
+#if defined(HAVE_FOPEN64)
+            if ((fp_ip2 = (long)fopen64(tmp2, "a")) == 0){
+#else
             if ((fp_ip2 = fopen(tmp2, "a")) == 0){
+#endif
                fprintf(stderr, "SARG: (html7) %s: %s\n",text[45],tmp2);
                exit(1);
             }
@@ -482,7 +486,11 @@ void htmlrel()
             sprintf(csort,"sort -n -T %s -k 1,1 -k 5,5 -o '%s' '%s'",TempDir,tmp3,tmp2);
             system(csort);
    
+#if defined(HAVE_FOPEN64)
+            if ((fp_ip = (long)fopen64(tmp3, "r")) == 0) {
+#else
             if ((fp_ip = fopen(tmp3, "r")) == 0) {
+#endif
                fprintf(stderr, "SARG: (html8) %s: %s\n",text[45],tmp3);
                exit(1);
             }
diff --git a/log.c b/log.c
index f8edecd753411b7f272329b6f754fb73605ae7e8..84cbc74d5cca0f831e13ce23a0c59d5531b8329c 100644 (file)
--- a/log.c
+++ b/log.c
@@ -763,7 +763,11 @@ int main(argc,argv)
          my_mkdir(csort);
       }
       sprintf(arq_log,"%s/sarg_temp.log",ParsedOutputLog);
+#if defined(HAVE_FOPEN64)
+      if((fp_log=(long)fopen64(arq_log,"w"))==NULL) {
+#else
       if((fp_log=fopen(arq_log,"w"))==NULL) {
+#endif
         fprintf(stderr, "%s: (log) %s: %s - %s\n",argv[0],text[8],arq_log,strerror(errno));
         exit(1);
       }
@@ -771,7 +775,11 @@ int main(argc,argv)
    }
 
    if(strstr(ReportType,"denied") != 0) {
+#if defined(HAVE_FOPEN64)
+      if((fp_denied=(long)fopen64(tmp4,"w"))==NULL) {
+#else
       if((fp_denied=fopen(tmp4,"w"))==NULL) {
+#endif
          fprintf(stderr, "%s: (log) %s: %s - %s\n",argv[0],text[45],tmp4,strerror(errno));
          exit(1);
       }
@@ -779,7 +787,11 @@ int main(argc,argv)
 
    if(DataFile[0]=='\0') {
       if(strstr(ReportType,"denied") != 0 || strstr(ReportType,"auth_failures") != 0) {
+#if defined(HAVE_FOPEN64)
+         if((fp_authfail=(long)fopen64(tmp6,"w"))==NULL) {
+#else
          if((fp_authfail=fopen(tmp6,"w"))==NULL) {
+#endif
             fprintf(stderr, "%s: (log) %s: %s - %s\n",argv[0],text[45],tmp6,strerror(errno));
             exit(1);
          }
index 42a676fe553c4b180de232a97ff0b3eaba51798d..a8d0e74a4a512eaa601b00ef77b73146c5940e42 100644 (file)
@@ -41,7 +41,11 @@ void splitlog(char *arq, char *df, int dfrom, int duntil, char *convert)
    if(arq[0] == '\0')
       strcpy(arq,"/usr/local/squid/logs/access.log");
 
+#if defined(HAVE_FOPEN64)
+   if((fp_in=(long)fopen64(arq,"r"))==NULL) {
+#else
    if((fp_in=fopen(arq,"r"))==NULL) {
+#endif
       fprintf(stderr, "SARG: (splitlog) %s: %s\n",text[8],arq);
       exit(1);
    }