httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject [PATCH] PR#1543: suexec logging exec failures
Date Thu, 11 Dec 1997 03:29:01 GMT
This patch adds the errno to exec errors.

It also rearranges the includes to a (not the, but... I had to add one and
they were getting to be a mess) logical order.  Shouldn't break anything.

Produces a message like:

  [20:24:08 10-12-97]: (13)Permission denied: exec failed (xterm.cgi)

instead of:

  [20:20:30 10-12-97]: exec failed (xterm.cgi)


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);
 }


Mime
View raw message