}
if(debug)
- debuga(_("Reading DansGuardian log file: %s\n"),loglocation);
+ debuga(_("Reading DansGuardian log file \"%s\"\n"),loglocation);
if((fp_in=MY_FOPEN(loglocation,"r"))==NULL) {
debuga(_("Cannot open file \"%s\": %s\n"),loglocation,strerror(errno));
}
if(debug)
- debuga(_("Sorting file: %s\n"),guard_ou);
+ debuga(_("Sorting file \"%s\"\n"),guard_ou);
snprintf(tmp6,sizeof(tmp6),"sort -t \"\t\" -k 1,1 -k 2,2 -k 4,4 \"%s\" -o \"%s\"",guard_in, guard_ou);
cstatus=system(tmp6);
}
user_find(userlabel,MAX_USER_LEN, u2);
userinfo_label(uinfo,userlabel);
- if(debug) debuga(_("Reading user file: %s/%s\n"),tmp,uinfo->filename);
+ if(debug) debuga(_("Reading user file \"%s/%s\"\n"),tmp,uinfo->filename);
sort_users_log(tmp,debug,uinfo);
if (snprintf(tmp3,sizeof(tmp3),"%s/%s.user_log",tmp,uinfo->filename)>=sizeof(tmp3)) {
clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -t \"\t\" -k 3,3 -k 1,1 -k 2,2 -k 5,5 -o \"%s\" \"%s\"",
tmp, report_in, download_unsort);
if (clen>=sizeof(csort)) {
- debuga(_("Path too long to sort the file: %s\n"),download_unsort);
+ debuga(_("Path too long to sort file \"%s\"\n"),download_unsort);
exit(EXIT_FAILURE);
}
cstatus=system(csort);
#ifdef ENABLE_DOUBLE_CHECK_DATA
if (ttnacc!=globstat.nacc || ttnbytes!=globstat.nbytes || ttnelap!=globstat.elap) {
- debuga(_("Total statistics mismatch when reading %s to produce the email report\n"),wger);
+ debuga(_("Total statistics mismatch when reading \"%s\" to produce the email report\n"),wger);
exit(EXIT_FAILURE);
}
#endif
exit(EXIT_FAILURE);
}
if(debug)
- debuga(_("Loading exclude host file from: %s\n"),hexfile);
+ debuga(_("Loading exclude host file from \"%s\"\n"),hexfile);
if ((fp_ex = fopen(hexfile, "r")) == NULL) {
debuga(_("Cannot open file \"%s\": %s\n"),hexfile,strerror(errno));
long int nreg=0;
if(debug)
- debuga(_("Loading exclude file from: %s\n"),uexfile);
+ debuga(_("Loading exclude file from \"%s\"\n"),uexfile);
if ((fp_ex = fopen(uexfile, "r")) == NULL) {
debuga(_("Cannot open file \"%s\": %s\n"),uexfile,strerror(errno));
}
nreg = ftell(fp_ex);
if (nreg<0) {
- debuga(_("Cannot get the size of file %s\n"),uexfile);
+ debuga(_("Cannot get the size of file \"%s\"\n"),uexfile);
exit(EXIT_FAILURE);
}
nreg += 11;
char buf[MAXLEN];
if(debug)
- debuga(_("Loading configuration from %s\n"),ConfigFile);
+ debuga(_("Loading configuration from \"%s\"\n"),ConfigFile);
if ((fp_in = fopen(ConfigFile, "r")) == NULL) {
debuga(_("Cannot open file \"%s\": %s\n"),ConfigFile,strerror(errno));
user_limit[maskid]|=mask;
if(debug)
- debuga(_("User %s limit exceeded (%d MB). Added to file %s\n"),uinfo->label,
+ debuga(_("Limit exceeded for user %s (%d MB). Added to file \"%s\"\n"),uinfo->label,
PerUserLimits[i].Limit,PerUserLimits[i].File);
}
}
order=(strcmp(IndexSortOrder,"A") == 0) ? 1 : -1;
if (snprintf(yearindex,sizeof(yearindex),"%s"INDEX_HTML_FILE,outdir)>=sizeof(yearindex)) {
- debuga(_("Resulting index file name too long: %s/%s"),outdir,INDEX_HTML_FILE);
+ debuga(_("Resulting index file name too long. File name is \"%s/%s\""),outdir,INDEX_HTML_FILE);
exit(EXIT_FAILURE);
}
if((fp_ou=fopen(yearindex,"w"))==NULL) {
fputs("</table></div>\n",fp_ou);
write_html_trailer(fp_ou);
if (fclose(fp_ou)==EOF)
- debuga(_("Write error in file \"%s\": %s\n"),wdir,strerror(errno));
+ debuga(_("Write error in \"%s\": %s\n"),wdir,strerror(errno));
if (sortlist) {
for (i=0 ; i<nsort ; i++) {
continue;
if (snprintf(remove,sizeof(remove),"%s/%s",dirname,direntp->d_name)>=sizeof(remove)) {
- debuga(_("Name of the file to remove is too long: %s/%s\n"),dirname,direntp->d_name);
+ debuga(_("Name of the file to remove is too long. File name is \"%s/%s\"\n"),dirname,direntp->d_name);
continue;
}
if (unlink(remove) == -1) {
{
name_len=strlen(direntp->d_name);
if (RootPos+name_len+1>=PathSize) {
- debuga(_("Directory entry too long to purge the old reports: %s%s\n"),Path,direntp->d_name);
+ debuga(_("Directory entry \"%s%s\" too long to purge the old reports\n"),Path,direntp->d_name);
exit(EXIT_FAILURE);
}
strcpy(Path+Length,direntp->d_name);
name_pos=strlen(Path);
if (name_pos>=sizeof(warea)) {
- debuga(_("The directory containing the old reports to purge is too long: %s\n"),Path);
+ debuga(_("The directory name \"%s\" containing the old reports to purge is too long\n"),Path);
exit(EXIT_FAILURE);
}
strcpy(warea,Path);
{
name_len=strlen(direntp->d_name);
if (name_pos+name_len+1>=sizeof(warea)) {
- debuga(_("Directory entry too long to purge the old reports: %s%s\n"),Path,direntp->d_name);
+ debuga(_("Directory entry \"%s%s\" too long to purge the old reports\n"),Path,direntp->d_name);
exit(EXIT_FAILURE);
}
strcpy(warea+name_pos,direntp->d_name);
break;
}
if (debug)
- debuga(_("Deleting empty directory %s\n"),Path);
+ debuga(_("Deleting empty directory \"%s\"\n"),Path);
if (index) {
if (strlen(Path)+strlen(INDEX_HTML_FILE)+2>=PathSize) {
- debuga(_("Buffer too small to delete index file %s/%s"),Path,INDEX_HTML_FILE);
+ debuga(_("Buffer too small to delete index file \"%s/%s\""),Path,INDEX_HTML_FILE);
exit(EXIT_FAILURE);
}
strcat(Path,"/"INDEX_HTML_FILE);
name_pos=strlen(outdir);
if (name_pos>=sizeof(warea)) {
DeleteDirList(List);
- debuga(_("The directory containing the old reports to purge is too long: %s\n"),outdir);
+ debuga(_("The directory name \"%s\" containing the old reports to purge is too long\n"),outdir);
exit(EXIT_FAILURE);
}
strcpy(warea,outdir);
long int nreg=0;
if(debug)
- debuga(_("Loading password file from %s\n"),pwdfile);
+ debuga(_("Loading password file \"%s\"\n"),pwdfile);
if ((fp_usr = fopen(pwdfile, "r")) == NULL) {
debuga(_("Cannot open file \"%s\": %s\n"),pwdfile,strerror(errno));
}
nreg = ftell(fp_usr);
if (nreg<0) {
- debuga(_("Cannot get the size of file %s\n"),pwdfile);
+ debuga(_("Cannot get the size of file \"%s\"\n"),pwdfile);
exit(EXIT_FAILURE);
}
nreg = nreg+5000;
while(fgets(buf,sizeof(buf),fp_usr)!=NULL) {
str=strchr(buf,':');
if (!str) {
- debuga(_("You have an invalid user in your %s file\n"),pwdfile);
+ debuga(_("Invalid user in file \"%s\"\n"),pwdfile);
exit(EXIT_FAILURE);
}
str[1]='\0';
}
if(strcmp(leks,"end") != 0) {
if (getword_limit(res,sizeof(res),&gwarea,sep[0])<0) {
- debuga(_("Parsing of tag \"%s\" in redirector log %s returned no result\n"),leks,wentp);
+ debuga(_("Parsing of tag \"%s\" in redirector log \"%s\" returned no result\n"),leks,wentp);
RedirectorErrors++;
return;
}
day=atoi(res);
} else if(strcmp(leks,"hour") == 0) {
if (strlen(res)>=sizeof(hour)) {
- debuga(_("Hour string too long in redirector log file %s\n"),wentp);
+ debuga(_("Hour string too long in redirector log file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
strcpy(hour,res);
} else if(strcmp(leks,"source") == 0) {
if (strlen(res)>=sizeof(source)) {
- debuga(_("Banning source name too long in redirector log file %s\n"),wentp);
+ debuga(_("Banning source name too long in redirector log file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
strcpy(source,res);
} else if(strcmp(leks,"list") == 0) {
if (strlen(res)>=sizeof(list)) {
- debuga(_("Banning list name too long in redirector log file %s\n"),wentp);
+ debuga(_("Banning list name too long in redirector log file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
strcpy(list,res);
} else if(strcmp(leks,"ip") == 0) {
if (strlen(res)>=sizeof(ip)) {
- debuga(_("IP address too long in redirector log file %s\n"),wentp);
+ debuga(_("IP address too long in redirector log file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
strcpy(ip,res);
} else if(strcmp(leks,"user") == 0) {
if (strlen(res)>=sizeof(user)) {
- debuga(_("User ID too long in redirector log file %s\n"),wentp);
+ debuga(_("User ID too long in redirector log file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
longline line;
if(debug) {
- debuga(_("Reading redirector log file %s\n"),wentp);
+ debuga(_("Reading redirector log file \"%s\"\n"),wentp);
}
/* With squidGuard, you can log groups in only one log file.
if (redirector_count) {
snprintf(redirector_sorted,sizeof(redirector_sorted),"%s/redirector.int_log",tmp);
if(debug) {
- debuga(_("Sorting file: %s\n"),redirector_sorted);
+ debuga(_("Sorting file \"%s\"\n"),redirector_sorted);
}
if (snprintf(tmp6,sizeof(tmp6),"sort -t \"\t\" -k 1,1 -k 2,2 -k 4,4 \"%s\" -o \"%s\"",guard_in, redirector_sorted)>=sizeof(tmp6)) {
}
if (snprintf(csort,sizeof(csort),"sort -n -t \"\t\" -k 1,1 -k 2,2 -k 3,3 -o \"%s\" \"%s\"",smart_ou,smart_in)>=sizeof(csort)) {
- debuga(_("cannot build the sort command to sort file %s\n"),smart_in);
+ debuga(_("Cannot build the sort command to sort file \"%s\"\n"),smart_in);
exit(EXIT_FAILURE);
}
cstatus=system(csort);
}
if(debug) {
- debuga(_("Sorting file: %s\n"),arqin);
+ debuga(_("Sorting file \"%s\"\n"),arqin);
}
if (snprintf(csort,sizeof(csort),"sort -n -T \"%s\" -t \"\t\" %s -k %s -k %s -k %s -o \"%s\" \"%s\"",tmp,order,field1,field2,field3,arqou,arqin)>=sizeof(csort)) {
int clen;
if(debug) {
- debuga(_("Sorting log %s/%s.user_unsort\n"),tmp,uinfo->filename);
+ snprintf(csort,sizeof(csort),"%s/%s.user_unsort",tmp,uinfo->filename);
+ debuga(_("Sorting file \"%s\"\n"),csort);
}
user=uinfo->filename;
#ifdef ENABLE_DOUBLE_CHECK_DATA
if (ttnacc!=globstat.nacc || ttnbytes!=globstat.nbytes || ttntime!=globstat.elap) {
- debuga(_("Total statistics mismatch when reading %s to produce the top sites\n"),general2);
+ debuga(_("Total statistics mismatch when reading \"%s\" to produce the top sites\n"),general2);
exit(EXIT_FAILURE);
}
#endif
#ifdef ENABLE_DOUBLE_CHECK_DATA
if (ttnacc!=globstat.nacc || ttnbytes!=globstat.nbytes || ttnelap!=globstat.elap ||
ttnincache!=globstat.incache || ttnoucache!=globstat.oucache) {
- debuga(_("Total statistics mismatch when reading %s to produce the top users\n"),wger);
+ debuga(_("Total statistics mismatch when reading \"%s\" to produce the top users\n"),wger);
exit(EXIT_FAILURE);
}
#endif
}
if(debug) {
- debuga(_("Reading useragent log: %s\n"),UserAgentLog);
+ debuga(_("Reading useragent log \"%s\"\n"),UserAgentLog);
}
while(fgets(buf,sizeof(buf),fp_in)!=NULL) {
}
if(debug) {
- debuga(_("Sorting file: %s\n"),tmp2);
+ debuga(_("Sorting file \"%s\"\n"),tmp2);
}
if (snprintf(csort,sizeof(csort),"sort -n -t \"\t\" -k 3,3 -k 2,2 -k 1,1 -o \"%s\" \"%s\"",tmp2,tmp3)>=sizeof(csort)) {
}
nreg = ftell(fp_usr);
if (nreg<0) {
- debuga(_("Cannot get the size of file %s\n"),UserTabFile);
+ debuga(_("Cannot get the size of file \"%s\"\n"),UserTabFile);
exit(EXIT_FAILURE);
}
nreg += 100;
z1=0;
while(buf[z1] && (unsigned char)buf[z1]>' ') {
if (z2+3>=nreg) { //need at least 3 additional bytes for the minimum string "\n\t\0"
- debuga(_("The list of the users is too long in your %s file.\n"),UserTabFile);
+ debuga(_("The list of users is too long in file \"%s\"\n"),UserTabFile);
exit(EXIT_FAILURE);
}
userfile[z2++]=buf[z1++];
userfile[z2++]='\n';
while(buf[z1] && (unsigned char)buf[z1]>=' ') {
if (z2+2>=nreg) { //need at least 2 additional bytes for "\t\0"
- debuga(_("The list of the users is too long in your %s file.\n"),UserTabFile);
+ debuga(_("The list of users is too long in file \"%s\"\n"),UserTabFile);
exit(EXIT_FAILURE);
}
userfile[z2++]=buf[z1++];
str_in_orig = str_in;
return_value = iconv(ldapiconv, (ICONV_CONST char **)&str_in, &str_in_len, &str_out, &str_out_len );
if ( return_value == ( size_t ) -1 ) {
- debuga(_("iconv failed in string \"%s\":\n"),str_in_orig);
+ /* TRANSLATORS: The message is followed by the reason for the failure. */
+ debuga(_("iconv failed on string \"%s\":\n"),str_in_orig);
switch ( errno ) {
/* See "man 3 iconv" for an explanation. */
case EILSEQ:
void init_usertab(const char *UserTabFile)
{
if (strcmp(UserTabFile, "ldap") == 0) {
- if(debug)
- debuga(_("Loading User table: %s\n"),UserTabFile);
+ if(debug) {
+ /* TRANSLATORS: The %s may be the string "ldap" or a file name.*/
+ debuga(_("Loading User table from \"%s\"\n"),UserTabFile);
+ }
#ifdef HAVE_LDAP_H
which_usertab=UTT_Ldap;
init_ldap_usertab();
#endif //HAVE_LDAP_H
} else if (UserTabFile[0] != '\0') {
if(debug)
- debuga(_("Loading User table: %s\n"),UserTabFile);
+ debuga(_("Loading User table from \"%s\"\n"),UserTabFile);
which_usertab=UTT_File;
init_file_usertab(UserTabFile);
} else {
}
if (!fgets(data,80,fp_in)) {
- debuga(_("Failed to read the date in %s\n"),wdir);
+ debuga(_("Failed to read the date in file \"%s\"\n"),wdir);
exit(EXIT_FAILURE);
}
if (fclose(fp_in)==EOF) {
}
if (!fgets(tuser,sizeof(tuser),fp_in)) {
- debuga(_("Failed to read the number of users in %s\n"),wdir);
+ debuga(_("Failed to read the number of users in file \"%s\"\n"),wdir);
exit(EXIT_FAILURE);
}
if (fclose(fp_in)==EOF) {
exit(EXIT_FAILURE);
}
if ((fp_ou = fopen(wdir, "wt")) == 0) {
- debuga(_("cannot open %s for writing: %s\n"),wdir,strerror(errno));
+ debuga(_("Cannot open file \"%s\": %s\n"),wdir,strerror(errno));
perror("SARG:");
exit(EXIT_FAILURE);
}
}
MemSize = ftell(fp_in);
if (MemSize<0) {
- debuga(_("Cannot get the size of file %s\n"),ExcludeCodes);
+ debuga(_("Cannot get the size of file \"%s\"\n"),ExcludeCodes);
exit(EXIT_FAILURE);
}
if (fseek(fp_in, 0, SEEK_SET)==-1) {
} else if (S_ISDIR(st.st_mode)) {
unlinkdir(dname,0);
} else {
- debuga(_("Unknown path type %s\n"),dname);
+ debuga(_("Don't know how to delete \"%s\" (not a regular file nor a directory)\n"),dname);
}
}
closedir(dirp);
exit(EXIT_FAILURE);
}
} else {
- debuga(_("Unknown path type %s\n"),dname);
+ debuga(_("Don't know how to delete \"%s\" (not a regular file)\n"),dname);
}
}
closedir(dirp);