httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject Re: [Patch]: Make cgis work properly under unix.
Date Mon, 06 Dec 1999 17:58:40 GMT

I have had cgi's working properly under Linux for a while.  I will
investigate this patch in more detail soon, but I have reviewed it
partially and I have some real issues with it already.  When I have more
time to read through it (hopefully tomorrow morning) I will elaborate on
my problems with it.  But for now at least, I am most definately

-1

Ryan

On Mon, 6 Dec 1999, Paul J. Reder wrote:

> The following is a patch to make cgi scripts work correctly under
> unix. Unix proc was not passing the program as the first arg. I
> am confident in the APR_PROGRAM side of the code since I have 
> tested and verified that it now works, but the APR_SHELLCMD side
> seems to have an additional problem which I have not found yet. 
> The APR_SHELLCMD part of the patch is required in order to
> prevent an internal server error though.
> 
> -- 
> Paul J. Reder
> ------------------------------------------------------------
> "Remember, Information is not knowledge; Knowledge is not Wisdom;
> Wisdom is not truth; Truth is not beauty; Beauty is not love;
> Love is not music; Music is the best." -- Frank Zappa
> 
> 
> 
> 
> Index: proc.c
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/proc.c,v
> retrieving revision 1.13
> diff -u -r1.13 proc.c
> --- proc.c      1999/12/03 15:18:37     1.13
> +++ proc.c      1999/12/06 17:46:38
> @@ -337,7 +337,7 @@
>      if (((*new)->pid = fork()) < 0) {
>          return errno;
>      }
> -    else if ((*new)->pid == 0) {
> +    else if ((*new)->pid == 0) {
>          /* child process */
>          if (attr->child_in) {
>              ap_close(attr->parent_in);
> @@ -371,12 +371,13 @@
>                  i++;
>              }
>              newargs =
> -               (my_stupid_string *) ap_palloc(cont, sizeof (char *) * (i + 3));
> +               (my_stupid_string *) ap_palloc(cont, sizeof (char *) * (i + 4));
>              newargs[0] = SHELL_PATH;
>              newargs[1] = "-c";
> +            newargs[2] = progname;
>              i = 0;
>              while (args[i]) {
> -                newargs[i + 2] = args[i];
> +                newargs[i + 3] = args[i];
>                  i++;
>              }
>              newargs[i + 3] = NULL;
> @@ -389,7 +390,20 @@
>              if (attr->detached) {
>                  ap_detach(&pgrp, attr->cntxt);
>              }
> -            execve(progname, args, env);
> +            i = 0;
> +            while (args[i]) {
> +                i++;
> +            }
> +            newargs =
> +               (my_stupid_string *) ap_palloc(cont, sizeof (char *) * (i + 2));
> +            newargs[0] = progname;
> +            i = 0;
> +            while (args[i]) {
> +                newargs[i + 1] = args[i];
> +                i++;
> +            }
> +            newargs[i + 1] = NULL;
> +            execve(progname, (char **) newargs, env);
>          }
>          exit(-1);  /* if we get here, there is a problem, so exit with an */
>                     /* error code. */
> 

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	


Mime
View raw message