sprintf(guard_ou,"%s/dansguardian.log",tmp);
if(access(DansGuardianConf, R_OK) != 0) {
- debuga("Cannot open DansGuardian config file: %s",DansGuardianConf);
+ debuga(_("Cannot open DansGuardian config file: %s\n"),DansGuardianConf);
exit(1);
}
if((fp_guard=fopen(DansGuardianConf,"r"))==NULL) {
- fprintf(stderr, "SARG: (dansguardian) %s: %s\n",_("Cannot open log file"),DansGuardianConf);
+ debuga(_("(dansguardian) Cannot open log file: %s\n"),DansGuardianConf);
exit(1);
}
if((fp_ou=MY_FOPEN(guard_in,"a"))==NULL) {
- fprintf(stderr, "SARG: (dansguardian) %s: %s\n",_("Cannot open log file"),guard_in);
+ debuga(_("(dansguardian) Cannot open log file: %s\n"),guard_in);
exit(1);
}
if(strstr(buf,"loglocation ") != 0) {
getword_start(&gwarea,buf);
if (getword_skip(MAXLEN,&gwarea,'\'')<0 || getword(loglocation,sizeof(loglocation),&gwarea,'\'')<0) {
- printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",DansGuardianConf);
+ debuga(_("Maybe you have a broken record or garbage in your %s file.\n"),DansGuardianConf);
exit(1);
}
break;
}
}
- if(debug) {
- char short_url[1024];
- getword_start(&gwarea,_("Reading access log file"));
- if (getword_limit(short_url,sizeof(short_url),&gwarea,' ')<0 || getword_skip(MAXLEN,&gwarea,' ')<0) {
- printf("SARG: Maybe you have a broken record or garbage in your %s entry.\n",_("Reading access log file"));
- exit(1);
- }
- debuga("%s DansGuardian %s: %s",short_url,gwarea.current,loglocation);
- }
+ if(debug)
+ debuga(_("Reading DansGuardian log file: %s\n"),loglocation);
if((fp_in=MY_FOPEN(loglocation,"r"))==NULL) {
- fprintf(stderr, "SARG: (dansguardian) %s: %s\n",_("Cannot open log file"),loglocation);
+ debuga(_("(dansguardian) Cannot open log file: %s\n"),loglocation);
exit(1);
}
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"),loglocation);
+ debuga(_("Maybe you have a broken record or garbage in your %s file\n"),loglocation);
exit(1);
}
if (getword_ptr(buf,&url,&gwarea,' ')<0) {
- debuga(_("Maybe you have a broken url in your %s file"),loglocation);
+ debuga(_("Maybe you have a broken url in your %s file\n"),loglocation);
exit(1);
}
if (getword_skip(255,&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"),loglocation);
+ debuga(_("Maybe you have a broken record or garbage in your %s file\n"),loglocation);
exit(1);
}
sprintf(wdata,"%s%02d%s",year,atoi(mon),day);
if(fp_ou) fclose(fp_ou);
if(debug)
- debuga("%s: %s",_("Sorting file"),guard_ou);
+ debuga(_("Sorting file: %s\n"),guard_ou);
sprintf(tmp6,"sort -k 1,1 -k 2,2 -k 4,4 \"%s\" -o \"%s\"",guard_in, guard_ou);
cstatus=system(tmp6);
if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
- fprintf(stderr, "SARG: sort command return status %d\n",WEXITSTATUS(cstatus));
- fprintf(stderr, "SARG: sort command: %s\n",tmp6);
+ debuga(_("sort command return status %d\n"),WEXITSTATUS(cstatus));
+ debuga(_("sort command: %s\n"),tmp6);
exit(1);
}
unlink(guard_in);