You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/12/11 04:29:01 UTC

[PATCH] PR#1543: suexec logging exec failures

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


Re: [PATCH] PR#1543: suexec logging exec failures

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Wed, Dec 10, 1997 at 08:29:01PM -0700, Marc Slemko wrote:
> This patch adds the errno to exec errors.
+1
    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: [PATCH] PR#1543: suexec logging exec failures

Posted by Dean Gaudet <dg...@arctic.org>.
+1.

Dean

On Wed, 10 Dec 1997, Marc Slemko wrote:

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