From: Frédéric Marchal Date: Fri, 26 Jun 2009 07:41:39 +0000 (+0000) Subject: Patch #2224623 applied. X-Git-Tag: v2_2_6~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0dda06bf49906357d74b7a4deb560e4497d3189c;p=thirdparty%2Fsarg.git Patch #2224623 applied. --- diff --git a/authfail.c b/authfail.c index 5a933c4..e28dc52 100644 --- a/authfail.c +++ b/authfail.c @@ -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); } diff --git a/convlog.c b/convlog.c index 6fefe38..2c09b9e 100644 --- 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); } diff --git a/dansguardian_log.c b/dansguardian_log.c index ced1d5c..6b526d8 100644 --- a/dansguardian_log.c +++ b/dansguardian_log.c @@ -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); } diff --git a/dansguardian_report.c b/dansguardian_report.c index ed90cf1..3b80de4 100644 --- a/dansguardian_report.c +++ b/dansguardian_report.c @@ -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); } diff --git a/datafile.c b/datafile.c index c8be2cd..3df03fe 100644 --- a/datafile.c +++ b/datafile.c @@ -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); } diff --git a/denied.c b/denied.c index ecf276e..e793146 100644 --- 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); } diff --git a/download.c b/download.c index cc1d6c1..a9a0df6 100644 --- a/download.c +++ b/download.c @@ -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 dcc432a..3b1fbe4 100644 --- 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 f8edecd..84cbc74 100644 --- 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); } diff --git a/splitlog.c b/splitlog.c index 42a676f..a8d0e74 100644 --- a/splitlog.c +++ b/splitlog.c @@ -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); }