len=strlen(param);
if (len>=sizeof(ExecCmd)) {
- debuga(_("Command to execute to resolve the IP addresses is too long (maximum is %d bytes)\n"),(int)sizeof(ExecCmd));
+ debuga(__FILE__,__LINE__,_("Command to execute to resolve the IP addresses is too long (maximum is %d bytes)\n"),(int)sizeof(ExecCmd));
exit(EXIT_FAILURE);
}
strcpy(ExecCmd,param);
size_t nread;
if (ExecCmd[0]=='\0') {
- debuga(_("No command to run to resolve an IP address. Please configure it in sarg.conf\n"));
+ debuga(__FILE__,__LINE__,_("No command to run to resolve an IP address. Please configure it in sarg.conf\n"));
exit(EXIT_FAILURE);
}
for (i=0 ; i<sizeof(ExecCmd) && ExecCmd[i] ; i++) {
if (ExecCmd[i]=='%' && strncmp(ExecCmd+i+1,"IP",2)==0) {
if (j+len>=sizeof(cmd)) {
- debuga(_("IP address \"%s\" too long for the command to run\n"),ip);
+ debuga(__FILE__,__LINE__,_("IP address \"%s\" too long for the command to run\n"),ip);
return(INRC_Error);
}
strcpy(cmd+j,ip);
i+=2;
} else {
if (j>=sizeof(cmd)) {
- debuga(_("IP address \"%.*s\" too long for the command to run\n"),ip_len,ip);
+ debuga(__FILE__,__LINE__,_("IP address \"%s\" too long for the command to run\n"),ip);
return(INRC_Error);
}
cmd[j++]=ExecCmd[i];
cmd_in=popen(cmd,"r");
if (!cmd_in) {
- debuga(_("Cannot run command %s\n"),cmd);
+ debuga(__FILE__,__LINE__,_("Cannot run command %s\n"),cmd);
exit(EXIT_FAILURE);
}
nread=fread(buffer,1,sizeof(buffer),cmd_in);
if (pclose(cmd_in)==-1) {
- debuga(_("Command failed: %s\n"),cmd);
+ debuga(__FILE__,__LINE__,_("Command failed: %s\n"),cmd);
exit(EXIT_FAILURE);
}