/* report an error if we couldn't run the command */
if(fp==NULL){
- strncpy(buffer,"(Error: Could not execute command)\n",sizeof(buffer)-1);
+ snprintf(buffer,sizeof(buffer)-1,"(Error: Could not execute command \"%s\"", cmd);
+ snprintf(buffer,sizeof(buffer)-1,"(Error: Could not execute command \"%s\")", cmd);
buffer[sizeof(buffer)-1]='\x0';
/* write the error back to the parent process */
@ -71,7 +61,7 @@ Index: base/utils.c
/* default return string in case nothing was returned */
- strcpy(buffer,"(No output!)");
+ snprintf(buffer,sizeof(buffer)-1,"(No output from command \"%s\"", cmd);
+ snprintf(buffer,sizeof(buffer)-1,"(No output from command \"%s\")", cmd);
+ buffer[sizeof(buffer)-1]='\x0';
/* read in the first line of output from the command */
@ -85,7 +75,7 @@ Index: base/utils.c
/* write the output back to the parent process */
write(fd[1],buffer,strlen(buffer)+1);
@@ -2870,7 +2871,7 @@
@@ -2870,11 +2871,11 @@
#endif
/* get the exit code returned from the program */
@ -94,25 +84,40 @@ Index: base/utils.c
/* check for possibly missing scripts/binaries/etc */
if(result==126 || result==127){
Index: base/checks.c
--- base/checks.c.orig 2006-02-16 05:47:55 +0100
+++ base/checks.c 2006-04-20 22:52:42 +0200
@@ -483,7 +483,8 @@
_exit(STATE_UNKNOWN);
- snprintf(buffer,sizeof(buffer)-1,"Warning: Attempting to execute the command \"%s\" resulted in a return code of %d. Make sure the script or binary you are trying to execute actually exists...\n",cmd,result);
+ snprintf(buffer,sizeof(buffer)-1,"Warning: Attempting to execute the command \"%s\" (timeout %ds) resulted in a return code of %d. Make sure the script or binary you are trying to execute actually exists...\n",cmd,timeout,result);