i++;
} else {
fputc(line[i],fp_auth);
- }
+ }
}
fclose(fp_auth);
fclose(fp_in);
unlink(tmp4);
if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
- debuga(_("(authfail) Cannot open file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(authfail) Cannot open file %s\n"),report);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Authentication Failures"),HTML_JS_NONE);
}
}
- if(AuthfailReportLimit>0) {
- if(strcmp(ouser2,uinfo->label) == 0) {
+ if(AuthfailReportLimit>0) {
+ if(strcmp(ouser2,uinfo->label) == 0) {
count++;
} else {
count=1;
rotate_left(node);
break;
default:
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
break;
}
continue;
getword_start(&gwarea,buf);
if (getword(year,sizeof(year),&gwarea,'.')<0 || getword(mon,sizeof(mon),&gwarea,'.')<0 ||
- getword(day,sizeof(day),&gwarea,' ')<0 || getword(hour,sizeof(hour),&gwarea,' ')<0 ||
- getword(user,sizeof(user),&gwarea,' ')<0 || getword(ip,sizeof(ip),&gwarea,' ')<0 ||
- getword_skip(MAXLEN,&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,'/')<0) {
+ getword(day,sizeof(day),&gwarea,' ')<0 || getword(hour,sizeof(hour),&gwarea,' ')<0 ||
+ getword(user,sizeof(user),&gwarea,' ')<0 || getword(ip,sizeof(ip),&gwarea,' ')<0 ||
+ getword_skip(MAXLEN,&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,'/')<0) {
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),loglocation);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
if (getword_skip(255,&gwarea,' ')<0 ||
- getword(code1,sizeof(code1),&gwarea,' ')<0 || getword(code2,sizeof(code2),&gwarea,' ')<0) {
+ getword(code1,sizeof(code1),&gwarea,' ')<0 || getword(code2,sizeof(code2),&gwarea,' ')<0) {
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),loglocation);
exit(EXIT_FAILURE);
}
sprintf(report,"%s/dansguardian.html",outdirname);
if((fp_in=MY_FOPEN(dansguardian_in,"r"))==NULL) {
- debuga(_("(dansguardian_report) Cannot open log file %s\n"),dansguardian_in);
- exit(EXIT_FAILURE);
+ debuga(_("(dansguardian_report) Cannot open log file %s\n"),dansguardian_in);
+ exit(EXIT_FAILURE);
}
if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
- debuga(_("(dansguardian_report) Cannot open log file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(dansguardian_report) Cannot open log file %s\n"),report);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("DansGuardian"),HTML_JS_NONE);
while(fgets(buf,sizeof(buf),fp_in)!=NULL) {
getword_start(&gwarea,buf);
if (getword(user,sizeof(user),&gwarea,'\t')<0 || getword(date2,sizeof(date2),&gwarea,'\t')<0 ||
- getword(hour,sizeof(hour),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
+ getword(hour,sizeof(hour),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),dansguardian_in);
exit(EXIT_FAILURE);
}
user_find(name, sizeof(name), user);
- if(DansGuardianReportLimit) {
+ if(DansGuardianReportLimit) {
if(strcmp(ouser2,name) == 0) {
count++;
} else {
while((buf=longline_read(fp_in,line))!=NULL) {
getword_start(&gwarea,buf);
if (getword(accdia,sizeof(accdia),&gwarea,'\t')<0 || getword(acchora,sizeof(acchora),&gwarea,'\t')<0 ||
- getword(accip,sizeof(accip),&gwarea,'\t')<0 ||
- getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 ||
- getword(acccode,sizeof(acccode),&gwarea,'\t')<0 || getword_atoll(&accelap,&gwarea,'\t')<0) {
+ getword(accip,sizeof(accip),&gwarea,'\t')<0 ||
+ getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 ||
+ getword(acccode,sizeof(acccode),&gwarea,'\t')<0 || getword_atoll(&accelap,&gwarea,'\t')<0) {
debuga(_("There is a broken record or garbage in file %s\n"),tmp3);
exit(EXIT_FAILURE);
}
sprintf(report,"%s/denied.html",outdirname);
if((fp_in=MY_FOPEN(denied_in,"r"))==NULL) {
- debuga(_("(denied) Cannot open log file %s\n"),denied_in);
- exit(EXIT_FAILURE);
+ debuga(_("(denied) Cannot open log file %s\n"),denied_in);
+ exit(EXIT_FAILURE);
}
if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
- debuga(_("(denied) Cannot open log file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(denied) Cannot open log file %s\n"),report);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Denied"),HTML_JS_NONE);
while((buf=longline_read(fp_in,line))!=NULL) {
getword_start(&gwarea,buf);
if (getword(data,sizeof(data),&gwarea,'\t')<0 || getword(hora,sizeof(hora),&gwarea,'\t')<0 ||
- getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
+ getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
debuga(_("There is a broken record or garbage in file %s\n"),denied_in);
exit(EXIT_FAILURE);
}
while((buf=longline_read(fp_in,line))!=NULL) {
getword_start(&gwarea,buf);
if (getword(data,sizeof(data),&gwarea,'\t')<0 || getword(hora,sizeof(hora),&gwarea,'\t')<0 ||
- getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
+ getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
debuga(_("There is a broken record or garbage in file %s\n"),report_in);
exit(EXIT_FAILURE);
}
while((buf=longline_read(fp_in,line))!=NULL) {
ger_read(buf,&item,wger);
if(item.total) continue;
- if(strcmp(olduser,item.user) != 0)
- {
+ if(strcmp(olduser,item.user) != 0) {
totuser++;
if (olduser[0] != '\0') {
fprintf(fp_top3,"%-7s %-20s %-8s %-15s %%%-6s %-10s %-10s %%%-7s\n------- -------------------- -------- --------------- ------- ---------- ---------- -------\n",strip1,strip2,strip3,strip4,strip4,strip5,strip6,strip7);
- while(fgets(warea,sizeof(warea),fp_top1))
- {
+ while(fgets(warea,sizeof(warea),fp_top1)) {
fixendofline(warea);
getword_start(&gwarea,warea);
if (getword(user,sizeof(user),&gwarea,'\t')<0) {
bzero(excludeuser,nreg);
while(fgets(buf,sizeof(buf),fp_ex)!=NULL){
- if(strchr(buf,'#') != NULL)
- continue;
- fixendofline(buf);
- strcat(excludeuser,buf);
- strcat(excludeuser," ");
+ if(strchr(buf,'#') != NULL)
+ continue;
+ fixendofline(buf);
+ strcat(excludeuser,buf);
+ strcat(excludeuser," ");
}
strcat(excludeuser,"*END* ");
#endif
static void Sarg_gdImageStringFT (struct GraphDataStruct *gdata, int fg, char *fontlist,
- double ptsize, double angle, int x, int y, const char *string,enum TextRefPos RefPos)
+ double ptsize, double angle, int x, int y, const char *string,enum TextRefPos RefPos)
{
char *sstring;
char *retval;
exit(EXIT_FAILURE);
}
if ((fp_ou=fopen(wdirname,"wt"))==NULL) {
- debuga(_("(grepday) Cannot open output file %s\n"),wdirname);
- exit(EXIT_FAILURE);
+ debuga(_("(grepday) Cannot open output file %s\n"),wdirname);
+ exit(EXIT_FAILURE);
}
write_html_head(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 4 : 2,_("Graph report"),HTML_JS_NONE);
}
}
-// if(indexonly) {
-// unlink(arqou);
-// continue;
-// }
-
if ((ReportType & REPORT_TYPE_TOPUSERS) != 0 && (UserReportFields & USERREPORTFIELDS_AVERAGE) != 0) {
totbytes2=totbytes/ntotuser;
totelap2=totelap/ntotuser;
}
while ((direntp = readdir( dirp )) != NULL) {
if(strlen(direntp->d_name) > 4 || !isdigit(direntp->d_name[0]) || !isdigit(direntp->d_name[1]) ||
- !isdigit(direntp->d_name[2]) || !isdigit(direntp->d_name[3])) continue;
+ !isdigit(direntp->d_name[2]) || !isdigit(direntp->d_name[3])) continue;
year=atoi(direntp->d_name);
if (nyears>=sizeof(yearsort)/sizeof(yearsort[0])) {
/*
ia.s_addr=ntohl(ia.s_addr);
getword_start(&gwarea,inet_ntoa(ia));
if (getword(n4,sizeof(n4),&gwarea,'.')<0 || getword(n3,sizeof(n3),&gwarea,'.')<0 ||
- getword(n2,sizeof(n2),&gwarea,'.')<0 || getword(n1,sizeof(n1),&gwarea,0)<0) {
+ getword(n2,sizeof(n2),&gwarea,'.')<0 || getword(n1,sizeof(n1),&gwarea,0)<0) {
printf("SARG: Maybe you have a broken record or garbage in your %s ip address.\n",gwarea.beginning);
exit(EXIT_FAILURE);
}
snprintf(temp,sizeof(temp),"%slastlog1",outdir);
if((fp_ou=fopen(temp,"w"))==NULL) {
- debuga(_("(lastlog) Cannot open temporary file %s\n"),temp);
- exit(EXIT_FAILURE);
+ debuga(_("(lastlog) Cannot open temporary file %s\n"),temp);
+ exit(EXIT_FAILURE);
}
if ((dirp = opendir(outdir)) == NULL) {
snprintf(temp,sizeof(temp),"%slastlog",outdir);
if((fp_in=fopen(temp,"r"))==NULL) {
- debuga(_("(lastlog) Cannot open temporary file %s\n"),temp);
- exit(EXIT_FAILURE);
+ debuga(_("(lastlog) Cannot open temporary file %s\n"),temp);
+ exit(EXIT_FAILURE);
}
while(ftot>0 && fgets(buf,sizeof(buf),fp_in)!=NULL) {
/*@null@*/static char *userfile=NULL;
numlist weekdays = { { 0, 1, 2, 3, 4, 5, 6 }, 7 };
-numlist hours = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, 24 };
+numlist hours = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, 24 };
static void getusers(const char *pwdfile, int debug);
strcpy(PrivacyStringColor,"blue");
SuccessfulMsg=true;
TopUserFields=TOPUSERFIELDS_NUM | TOPUSERFIELDS_DATE_TIME | TOPUSERFIELDS_USERID | TOPUSERFIELDS_CONNECT |
- TOPUSERFIELDS_BYTES | TOPUSERFIELDS_SETYB | TOPUSERFIELDS_IN_CACHE_OUT |
- TOPUSERFIELDS_USED_TIME | TOPUSERFIELDS_MILISEC | TOPUSERFIELDS_PTIME |
- TOPUSERFIELDS_TOTAL | TOPUSERFIELDS_AVERAGE;
+ TOPUSERFIELDS_BYTES | TOPUSERFIELDS_SETYB | TOPUSERFIELDS_IN_CACHE_OUT |
+ TOPUSERFIELDS_USED_TIME | TOPUSERFIELDS_MILISEC | TOPUSERFIELDS_PTIME |
+ TOPUSERFIELDS_TOTAL | TOPUSERFIELDS_AVERAGE;
UserReportFields=USERREPORTFIELDS_CONNECT | USERREPORTFIELDS_BYTES | USERREPORTFIELDS_SETYB |
- USERREPORTFIELDS_IN_CACHE_OUT | USERREPORTFIELDS_USED_TIME | USERREPORTFIELDS_MILISEC |
- USERREPORTFIELDS_PTIME | USERREPORTFIELDS_TOTAL | USERREPORTFIELDS_AVERAGE;
+ USERREPORTFIELDS_IN_CACHE_OUT | USERREPORTFIELDS_USED_TIME | USERREPORTFIELDS_MILISEC |
+ USERREPORTFIELDS_PTIME | USERREPORTFIELDS_TOTAL | USERREPORTFIELDS_AVERAGE;
strcpy(DataFileDelimiter,";");
DataFileFields=DATA_FIELD_USER | DATA_FIELD_DATE | DATA_FIELD_TIME | DATA_FIELD_URL | DATA_FIELD_CONNECT |
- DATA_FIELD_BYTES | DATA_FIELD_IN_CACHE | DATA_FIELD_OUT_CACHE | DATA_FIELD_ELAPSED;
+ DATA_FIELD_BYTES | DATA_FIELD_IN_CACHE | DATA_FIELD_OUT_CACHE | DATA_FIELD_ELAPSED;
ShowReadStatistics=true;
strcpy(IndexSortOrder,"D");
ShowSargInfo=true;
case 'z':
debugz++;
break;
- /*case ':':
- debuga(_("Option -%c require an argument\n"),optopt);
- errflg++;
- break;*/
+ case ':':
+ debuga(_("Option -%c requires an argument\n"),optopt);
+ exit(EXIT_FAILURE);
case '?':
usage(argv[0]);
exit(EXIT_FAILURE);
if(ReportType == 0) {
ReportType=REPORT_TYPE_TOPUSERS | REPORT_TYPE_TOPSITES | REPORT_TYPE_USERS_SITES |
- REPORT_TYPE_SITES_USERS | REPORT_TYPE_DATE_TIME | REPORT_TYPE_DENIED |
- REPORT_TYPE_AUTH_FAILURES | REPORT_TYPE_SITE_USER_TIME_DATE | REPORT_TYPE_DOWNLOADS;
+ REPORT_TYPE_SITES_USERS | REPORT_TYPE_DATE_TIME | REPORT_TYPE_DENIED |
+ REPORT_TYPE_AUTH_FAILURES | REPORT_TYPE_SITE_USER_TIME_DATE | REPORT_TYPE_DOWNLOADS;
}
if(access(ExcludeUsers, R_OK) == 0) {
#warning "No rlimit resource for the number of open files"
#endif
if(rc == -1) {
- debuga(_("setrlimit error - %s\n"),strerror(errno));
+ debuga(_("setrlimit error - %s\n"),strerror(errno));
}
if(debug)
recs2++;
if( ShowReadStatistics && !from_stdin && !from_pipe && --OutputNonZero<=0) {
- double perc = recs2 * 100. / recs1 ;
- printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs2,perc);
- putchar('\r');
- fflush (stdout);
- OutputNonZero = REPORT_EVERY_X_LINES ;
+ double perc = recs2 * 100. / recs1 ;
+ printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs2,perc);
+ putchar('\r');
+ fflush (stdout);
+ OutputNonZero = REPORT_EVERY_X_LINES ;
}
if(blen < 58) continue;
if(strstr(linebuf,"HTTP/0.0") != 0) continue;
}
}
if(!exstring && (str=(char *) strstr(linebuf,gwarea.current)) != (char *) NULL )
- exstring=true;
+ exstring=true;
if(exstring) continue;
}
}
}
if (getword(data,sizeof(data),&gwarea,']')<0 || getword_skip(MAXLEN,&gwarea,'"')<0 ||
- getword(fun,sizeof(fun),&gwarea,' ')<0) {
+ getword(fun,sizeof(fun),&gwarea,' ')<0) {
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq);
exit(EXIT_FAILURE);
}
// Record only hours usage which is required
if (t) {
- if( bsearch( &( t -> tm_wday ), weekdays.list, weekdays.len,
- sizeof( int ), compar ) == NULL )
+ if( bsearch( &( t -> tm_wday ), weekdays.list, weekdays.len, sizeof( int ), compar ) == NULL )
continue;
- if( bsearch( &( t -> tm_hour ), hours.list, hours.len,
- sizeof( int ), compar ) == NULL )
+ if( bsearch( &( t -> tm_hour ), hours.list, hours.len, sizeof( int ), compar ) == NULL )
continue;
}
longline_destroy(&line);
if ( fp_Download_Unsort )
- fclose (fp_Download_Unsort);
+ fclose (fp_Download_Unsort);
for (ufile=first_user_file ; ufile ; ufile=ufile1) {
ufile1=ufile->next;
if(debug)
debuga(_("Period: %s\n"),period.text);
-// fclose(fp_ou);
if(fp_denied)
fclose(fp_denied);
if(fp_authfail)
}
if((fp_in=fopen(wdirname,"r"))==NULL) {
- debuga(_("(repday) Cannot open log file %s\n"),wdirname);
- exit(EXIT_FAILURE);
+ debuga(_("(repday) Cannot open log file %s\n"),wdirname);
+ exit(EXIT_FAILURE);
}
memset(tbytes,0,sizeof(tbytes));
fclose(fp_in);
if((fp_ou=fopen(arqout,"w"))==NULL) {
- debuga(_("(repday) Cannot open log file %s\n"),arqout);
- exit(EXIT_FAILURE);
+ debuga(_("(repday) Cannot open log file %s\n"),arqout);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 4 : 2,_("Day report"),HTML_JS_NONE);
dlen=strlen(direntp->d_name)-(sizeof(logext)-1);
if (dlen<0) continue;
if((strcmp(direntp->d_name+dlen,logext) != 0) ||
- (strncmp(direntp->d_name,"download.log",12) == 0) ||
- (strncmp(direntp->d_name,"denied.log",10) == 0) ||
- (strncmp(direntp->d_name,"authfail.log.unsort",19) == 0))
+ (strncmp(direntp->d_name,"download.log",12) == 0) ||
+ (strncmp(direntp->d_name,"denied.log",10) == 0) ||
+ (strncmp(direntp->d_name,"authfail.log.unsort",19) == 0))
continue;
if (snprintf(tmp3,sizeof(tmp3),"%s/%s",tmp,direntp->d_name)>=sizeof(tmp3)) {
debuga(_("(report) directory entry too long: %s/%s\n"),tmp,direntp->d_name);
while((buf=longline_read(fp_in,line))!=NULL) {
getword_start(&gwarea,buf);
if (getword(accdia,sizeof(accdia),&gwarea,'\t')<0 || getword(acchora,sizeof(acchora),&gwarea,'\t')<0 ||
- getword(accip,sizeof(accip),&gwarea,'\t')<0 ||
- getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 ||
- getword(acccode,sizeof(acccode),&gwarea,'\t')<0) {
+ getword(accip,sizeof(accip),&gwarea,'\t')<0 ||
+ getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 ||
+ getword(acccode,sizeof(acccode),&gwarea,'\t')<0) {
debuga(_("There is a broken record or garbage in file %s\n"),tmp3);
exit(EXIT_FAILURE);
}
nelap+=accelap;
if ((ReportType & REPORT_TYPE_SITE_USER_TIME_DATE) != 0 &&
- (!oldurltt || strcmp(oldurltt,accurl) || strcmp(oldaccdiatt,accdia) || strcmp(oldacchoratt,acchora))) {
+ (!oldurltt || strcmp(oldurltt,accurl) || strcmp(oldaccdiatt,accdia) || strcmp(oldacchoratt,acchora))) {
if(!ttopen) {
snprintf(arqtt,sizeof(arqtt),"%s/%s",outdirname,uinfo->filename);
/*
if(Privacy)
- sprintf(httplink,"<font size=%s color=%s><href=http://%s>%s", \
- FontSize,PrivacyStringColor,PrivacyString,PrivacyString);
+ sprintf(httplink,"<font size=%s color=%s><href=http://%s>%s",FontSize,PrivacyStringColor,PrivacyString,PrivacyString);
else
sprintf(httplink,"<font size=%s><a href=\"http://%s\">%s</a>",FontSize,accurl,accurl);
*/
}
if((fp_in=fopen(general2,"r"))==NULL) {
- debuga(_("(siteuser) Cannot open log file %s\n"),general2);
- debuga(_("sort command: %s\n"),csort);
- exit(EXIT_FAILURE);
+ debuga(_("(siteuser) Cannot open log file %s\n"),general2);
+ debuga(_("sort command: %s\n"),csort);
+ exit(EXIT_FAILURE);
}
if((fp_ou=fopen(report,"w"))==NULL) {
- debuga(_("(siteuser) Cannot open log file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(siteuser) Cannot open log file %s\n"),report);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Sites & Users"),HTML_JS_SORTTABLE);
unlink(smart_in);
if((fp_ou=fopen(report,"w"))==NULL) {
- debuga(_("(smartfilter) Cannot open log file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(smartfilter) Cannot open log file %s\n"),report);
+ exit(EXIT_FAILURE);
}
fprintf(fp_ou, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n",CharSet);
while(fgets(buf,sizeof(buf),fp_in)!=NULL) {
getword_start(&gwarea,buf);
if (getword(user,sizeof(user),&gwarea,'\t')<0 || getword(data,sizeof(data),&gwarea,'\t')<0 ||
- getword(hora,sizeof(hora),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0 ||
- getword(url,sizeof(url),&gwarea,'\t')<0 || getword(smartcat,sizeof(smartcat),&gwarea,'\n')<0) {
+ getword(hora,sizeof(hora),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0 ||
+ getword(url,sizeof(url),&gwarea,'\t')<0 || getword(smartcat,sizeof(smartcat),&gwarea,'\n')<0) {
debuga(_("There is a broken record or garbage in file %s\n"),smart_ou);
exit(EXIT_FAILURE);
}
if(strcmp(direntp->d_name,"download.unsort") == 0)
clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -k 3,3 -k 1,1 -k 2,2 -k 5,5 -o \"%s/%s.log\" \"%s/%s.unsort\"",
- tmp, tmp, user, tmp, user);
+ tmp, tmp, user, tmp, user);
else
clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -k 4,4 -k 1,1 -k 2,2 -o \"%s/%s.log\" \"%s/%s.unsort\"",
- tmp, tmp, user, tmp, user);
+ tmp, tmp, user, tmp, user);
if (clen>=sizeof(csort)) {
debuga(_("user name too long to sort %s\n"),csort);
exit(EXIT_FAILURE);
}
} else {
if (getword_atoll(&lyear,&gwarea,'-')<0 || getword_atoll(&lmon,&gwarea,'-')<0 ||
- getword_atoll(&lday,&gwarea,' ')<0) {
+ getword_atoll(&lday,&gwarea,' ')<0) {
debuga(_("Invalid date found in file %s\n"),wentp);
exit(EXIT_FAILURE);
}
str2 = user;
if(SquidGuardConf[0] == '\0' && NRedirectorLogs == 0)
- return;
+ return;
sprintf(guard_in,"%s/redirector.unsort",tmp);
sprintf(guard_ou,"%s/redirector.log",tmp);
snprintf(report,sizeof(report),"%s/redirector.html",outdirname);
if((fp_in=fopen(squidguard_in,"r"))==NULL) {
- debuga(_("(squidguard) Cannot open log file %s\n"),squidguard_in);
- exit(EXIT_FAILURE);
+ debuga(_("(squidguard) Cannot open log file %s\n"),squidguard_in);
+ exit(EXIT_FAILURE);
}
if((fp_ou=fopen(report,"w"))==NULL) {
- debuga(_("(squidguard) Cannot open log file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(squidguard) Cannot open log file %s\n"),report);
+ exit(EXIT_FAILURE);
}
if ((line=longline_create())==NULL) {
}
if((fp_in=fopen(general2,"r"))==NULL) {
- debuga(_("(topsites) Cannot open log file %s\n"),general2);
- debuga(_("sort command: %s\n"),csort);
- exit(EXIT_FAILURE);
+ debuga(_("(topsites) Cannot open log file %s\n"),general2);
+ debuga(_("sort command: %s\n"),csort);
+ exit(EXIT_FAILURE);
}
if((fp_ou=fopen(general3,"w"))==NULL) {
- debuga(_("(topsites) Cannot open log file %s\n"),general3);
- exit(EXIT_FAILURE);
+ debuga(_("(topsites) Cannot open log file %s\n"),general3);
+ exit(EXIT_FAILURE);
}
if ((line=longline_create())==NULL) {
unlink(general3);
if((fp_ou=fopen(report,"w"))==NULL) {
- debuga(_("(topsites) Cannot open log file %s\n"),report);
- exit(EXIT_FAILURE);
+ debuga(_("(topsites) Cannot open log file %s\n"),report);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Top sites"),HTML_JS_SORTTABLE);
fclose(fp_in);
if((fp_ou=fopen(arqout,"w"))==NULL) {
- debuga(_("(totday) Cannot open log file %s\n"),arqout);
- exit(EXIT_FAILURE);
+ debuga(_("(totday) Cannot open log file %s\n"),arqout);
+ exit(EXIT_FAILURE);
}
for (i=0 ; i<sizeof(tbytes)/sizeof(*tbytes) ; i++) {
totregsl++;
getword_start(&gwarea,buf);
if (getword(ip,sizeof(ip),&gwarea,' ')<0 || getword_skip(MAXLEN,&gwarea,'[')<0 ||
- getword(data,sizeof(data),&gwarea,' ')<0) {
+ getword(data,sizeof(data),&gwarea,' ')<0) {
debuga(_("Maybe you have a broken record or garbage in your %s file\n"),UserAgentLog);
exit(EXIT_FAILURE);
}
getword_start(&gwarea1,data);
if (getword(day,sizeof(day),&gwarea1,'/')<0 || getword(month,sizeof(month),&gwarea1,'/')<0 ||
- getword(year,sizeof(year),&gwarea1,':')<0) {
+ getword(year,sizeof(year),&gwarea1,':')<0) {
debuga(_("Maybe you have a broken date in your %s file\n"),UserAgentLog);
exit(EXIT_FAILURE);
}
}
ldap_memfree(attr);
}
- ldap_msgfree(result);
+ ldap_msgfree(result);
} else {
strncpy(mappedname, searched_in_cache,namelen-1);
mappedname[namelen-1]='\0';
//! The list of the HTTP codes to exclude from the report.
static char *excludecode=NULL;
-/*void fgetword(char *word, char *line, int stop)
-{
- //VARIANT N1
- int x;
-
- for (x=0; line[x] && (line[x] != stop); x++) word[x] = line[x];
- word[x] = '\0';
-
- //VARIANT N2
- char *tchar;
- int difflen;
-
- tchar = strchr(line, stop);
- if (tchar == NULL) strcpy(word, line);
- else
- {
- difflen = tchar - line;
- strncpy(word, line, difflen);
- word[difflen] = '\0';
- }
-}*/
-
#if USE_GETWORD_BACKTRACE
static void getword_backtrace(void)
{
//printf("SARG: Maybe you have a broken record or garbage in your access.log file.\n");
word[(limit>0) ? limit-1 : 0]='\0';
#if USE_GETWORD_BACKTRACE
- getword_backtrace();
+ getword_backtrace();
#endif
return(-1);
}
if (i == 0) return(-1);
range=(period->start.tm_year!=period->end.tm_year ||
- period->start.tm_mon!=period->end.tm_mon ||
- period->start.tm_mday!=period->end.tm_mday);
+ period->start.tm_mon!=period->end.tm_mon ||
+ period->start.tm_mday!=period->end.tm_mday);
if (range) {
if(df[0]=='u') {
i=strftime(text2, sizeof(text2)-i, "%Y %b %d", &period->end);
} else {
if(df[0] == 'u') {
wlen=snprintf(wdir+wlen,sizeof(wdir)-wlen,"%04d%s%02d-%04d%s%02d",y1,
- conv_month_name(m1),d1,y2,conv_month_name(m2),d2);
+ conv_month_name(m1),d1,y2,conv_month_name(m2),d2);
} else if(df[0] == 'e') {
wlen=snprintf(wdir+wlen,sizeof(wdir)-wlen,"%02d%s%04d-%02d%s%04d",d1,
- conv_month_name(m1),y1,d2,conv_month_name(m2),y2);
+ conv_month_name(m1),y1,d2,conv_month_name(m2),y2);
} else if(df[0] == 'w') {
wlen2=strftime(wdir+wlen, sizeof(wdir)-wlen, "%Y.%U", &per1->start);
if (wlen2==0) return(-1);
if (!dirp) return;
while ((direntp = readdir(dirp)) != NULL) {
if (direntp->d_name[0] == '.' && (direntp->d_name[1] == '\0' ||
- (direntp->d_name[1] == '.' && direntp->d_name[2] == '\0')))
+ (direntp->d_name[1] == '.' && direntp->d_name[2] == '\0')))
continue;
if (snprintf(dname,sizeof(dname),"%s/%s",dir,direntp->d_name)>=sizeof(dname)) {
debuga(_("directory name to delete too long: %s/%s\n"),dir,direntp->d_name);