The following reply was made to PR suexec/1543; it has been noted by GNATS.
From: Marc Slemko <[EMAIL PROTECTED]>
To: "M.D.Parker" <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: suexec/1543: suexec.c -- Does not report exec failure reasons
Date: Wed, 10 Dec 1997 20:29:44 -0700 (MST)
On 10 Dec 1997, M.D.Parker wrote:
> However, in suexec.c a problem in the executable bits setting can only be
> determined after an exec error. Also, I understand why this is. However,
> only
> the exec failure is reported without any reason. I suggest changing this so
> that
> the error code (errno) is at least output with the exec error message so that
> server administrator has some hope of attempting to correct the problem
> easily.
Like this?
Index: suexec.c
===================================================================
RCS file: /export/home/cvs/apachen/src/support/suexec.c,v
retrieving revision 1.29
diff -u -r1.29 suexec.c
--- suexec.c 1997/10/22 20:30:46 1.29
+++ suexec.c 1997/12/11 03:26:34
@@ -68,19 +68,21 @@
*/
-#include "suexec.h"
-
#include <sys/param.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <sys/stat.h>
#include <sys/types.h>
-#include <stdio.h>
+
+#include <errno.h>
+#include <grp.h>
+#include <pwd.h>
#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <pwd.h>
-#include <grp.h>
#include <time.h>
-#include <sys/stat.h>
+#include <unistd.h>
+
+#include "suexec.h"
/*
***********************************************************************
@@ -498,6 +500,6 @@
*
* Oh well, log the failure and error out.
*/
- log_err("exec failed (%s)\n", cmd);
+ log_err("(%d)%s: exec failed (%s)\n", errno, strerror(errno), cmd);
exit(255);
}