Re: cvs commit: httpd-2.0/server util_script.c

2001-09-04 Thread Cliff Woolley

On Mon, 3 Sep 2001, Ryan Bloom wrote:

> >  ASSERT FAILED (see below)
>
> I would be willing to bet that this is a bug in mod_include, not the
> change that I made earlier today.

Oh, I'm right with you on that one... I seriously doubt the two are
related.  I should have changed the subject to a new thread... (these
tests were just to see what would happen, not to try to show that your
change broke something).

--Cliff

--
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA





Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread Ryan Bloom

On Monday 03 September 2001 20:47, Cliff Woolley wrote:
> On Mon, 3 Sep 2001, Cliff Woolley wrote:
> > > Actually, is anybody on the list (with 2.0 from cvs-HEAD) using
> > > cgi/cgid for subrequests, redirects, or error pages?  That would be
> > > the area of interest.
>
> Using prefork/mod_cgi/mod_include, the results are definitely interesting:
>
> --
> From a file in the docroot:
>   This works
>This works
>   This works
>   This works
>  ASSERT FAILED (see below)
>
> Accessing /cgi-bin/redir.cgi directlyThis works

I would be willing to bet that this is a bug in mod_include, not the change that I made
earlier today.

Ryan
__
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
--



Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread Ryan Bloom

On Monday 03 September 2001 18:51, William A. Rowe, Jr. wrote:
> This patch entirely blows up internal redirection and subrequests,
> I would expect.

Huh?  How?  All this does is change how we set an environment
variable when dealing with CGIs.  If this breaks anything in the server,
then the internal redirection and subrequests are horribly broken.

Ryan

> > rbb 01/09/03 18:38:01
> >
> >   Modified:.CHANGES
> >server   util_script.c
> >   Log:
> >   Back out the 1.45 change to util_script.c.  This change made
> >   us set the environment variable REQUEST_URI to the redirected
> >   URI, instead of the originally requested URI.
> >
> >   PR: 7580
> >   Submitted by: Taketo Kabe <[EMAIL PROTECTED]>
> >
> >   Revision  ChangesPath
> >   1.355 +5 -0  httpd-2.0/CHANGES
> >
> >   Index: CHANGES
> >   ===
> >   RCS file: /home/cvs/httpd-2.0/CHANGES,v
> >   retrieving revision 1.354
> >   retrieving revision 1.355
> >   diff -u -r1.354 -r1.355
> >   --- CHANGES 2001/09/02 08:43:23 1.354
> >   +++ CHANGES 2001/09/04 01:38:00 1.355
> >   @@ -1,5 +1,10 @@
> >Changes with Apache 2.0.26-dev
> >
> >   +  *) Back out the 1.45 change to util_script.c.  This change made
> >   + us set the environment variable REQUEST_URI to the redirected
> >   + URI, instead of the originally requested URI.
> >   + [Taketo Kabe <[EMAIL PROTECTED]>]
> >   +
> >  *) Make mod_include do lazy evaluation of potentially expensive to
> > compute variables.  [Brian Pane <[EMAIL PROTECTED]>]
> >
> >
> >
> >
> >   1.62  +29 -1 httpd-2.0/server/util_script.c
> >
> >   Index: util_script.c
> >   ===
> >   RCS file: /home/cvs/httpd-2.0/server/util_script.c,v
> >   retrieving revision 1.61
> >   retrieving revision 1.62
> >   diff -u -r1.61 -r1.62
> >   --- util_script.c 2001/08/23 21:16:05 1.61
> >   +++ util_script.c 2001/09/04 01:38:01 1.62
> >   @@ -313,6 +313,34 @@
> >return lu;
> >}
> >
> >   +/* Obtain the Request-URI from the original request-line, returning
> >   + * a new string from the request pool containing the URI or "".
> >   + */
> >   +static char *original_uri(request_rec *r)
> >   +{
> >   +char *first, *last;
> >   +
> >   +if (r->the_request == NULL) {
> >   + return (char *) apr_pcalloc(r->pool, 1);
> >   +}
> >   +
> >   +first = r->the_request; /* use the request-line */
> >   +
> >   +while (*first && !apr_isspace(*first)) {
> >   + ++first; /* skip over the method */
> >   +}
> >   +while (apr_isspace(*first)) {
> >   + ++first; /*   and the space(s)   */
> >   +}
> >   +
> >   +last = first;
> >   +while (*last && !apr_isspace(*last)) {
> >   + ++last; /* end at next whitespace */
> >   +}
> >   +
> >   +return apr_pstrndup(r->pool, first, last - first);
> >   +}
> >   +
> >AP_DECLARE(void) ap_add_cgi_vars(request_rec *r)
> >{
> >apr_table_t *e = r->subprocess_env;
> >   @@ -321,7 +349,7 @@
> >apr_table_setn(e, "SERVER_PROTOCOL", r->protocol);
> >apr_table_setn(e, "REQUEST_METHOD", r->method);
> >apr_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
> >   -apr_table_setn(e, "REQUEST_URI", r->unparsed_uri);
> >   +apr_table_setn(e, "REQUEST_URI", original_uri(r));
> >
> >/* Note that the code below special-cases scripts run from
> > includes, * because it "knows" that the sub_request has been hacked to
> > have the

-- 

__
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
--



Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread Cliff Woolley

On Mon, 3 Sep 2001, Cliff Woolley wrote:

> > Actually, is anybody on the list (with 2.0 from cvs-HEAD) using
> > cgi/cgid for subrequests, redirects, or error pages?  That would be
> > the area of interest.

Using prefork/mod_cgi/mod_include, the results are definitely interesting:

--
>From a file in the docroot:
  This works
   This works
  This works
  This works
 ASSERT FAILED (see below)

Accessing /cgi-bin/redir.cgi directlyThis works

>From a file in /modules/include:
SEGFAULT (see below)
 This works

Accessing /cgi-bin/error403.cgi directly This works

Trying to access forbidden.html, which is
 forbidden, directly (with a CGI ErrorDocument)  This works (correctly)

>From a file in docroot:
 This works (correctly)

Accessing index.html.en with redir.cgi   This works
Accessing printenv with redir.cgiThis works
--
In the above tests, redir.cgi is the following:

#!/usr/bin/perl
print("Location: /manual\n\n");

error403.cgi is this, with the appropriate errordocument directive:

#!/usr/bin/perl
print("Content-type: text/html\n\n");
print("Forbidden\n");
--

So two of my tests failed.  One is the one we know about, the  on a file in a different directory, which falls victim to the
INTERNALLY GENERATED thing.

The other is a new one... an assertion failed when I tried to do an
include virtual of redir.cgi:

[Mon Sep 03 22:46:31 2001] file http_protocol.c, line 1171, assertion
"!r->main" failed
[Mon Sep 03 22:46:32 2001] [notice] child pid 7922 exit signal Aborted (6)

All the rest worked!  I guess that's relatively good news.

Anything else you'd like me to test?

--Cliff

--
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA










Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread Cliff Woolley

On Mon, 3 Sep 2001, William A. Rowe, Jr. wrote:

> > I'm building HEAD now in order to test it with httpd-test.  Results to
> > follow shortly.

Not counting the mod_include test which has been segfaulting since last
week due to the INTERNALLY GENERATED thing, all tests passed.

> Actually, is anybody on the list (with 2.0 from cvs-HEAD) using
> cgi/cgid for subrequests, redirects, or error pages?  That would be
> the area of interest.

Not I.  Will do so now... should definitely be interesting.

> I'm mired in launching 16 bit cgi's from winnt/2k right now (for the
> first time in recent memory, win9x is doing something better than
> nt/2k :)

Will the wonders never cease!  :)

--
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA





Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread William A. Rowe, Jr.

From: "Cliff Woolley" <[EMAIL PROTECTED]>
Sent: Monday, September 03, 2001 9:06 PM


> On Mon, 3 Sep 2001, William A. Rowe, Jr. wrote:
> 
> > This patch entirely blows up internal redirection and subrequests,
> > I would expect.
> 
> I'm building HEAD now in order to test it with httpd-test.  Results to
> follow shortly.

Actually, is anybody on the list (with 2.0 from cvs-HEAD) using cgi/cgid for
subrequests, redirects, or error pages?  That would be the area of interest.

I'm mired in launching 16 bit cgi's from winnt/2k right now (for the first
time in recent memory, win9x is doing something better than nt/2k :)

Bill




Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread Cliff Woolley

On Mon, 3 Sep 2001, William A. Rowe, Jr. wrote:

> This patch entirely blows up internal redirection and subrequests,
> I would expect.

I'm building HEAD now in order to test it with httpd-test.  Results to
follow shortly.

--Cliff

--
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA





Re: cvs commit: httpd-2.0/server util_script.c

2001-09-03 Thread William A. Rowe, Jr.

This patch entirely blows up internal redirection and subrequests,
I would expect.

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 03, 2001 8:38 PM
Subject: cvs commit: httpd-2.0/server util_script.c


> rbb 01/09/03 18:38:01
> 
>   Modified:.CHANGES
>server   util_script.c
>   Log:
>   Back out the 1.45 change to util_script.c.  This change made
>   us set the environment variable REQUEST_URI to the redirected
>   URI, instead of the originally requested URI.
>   
>   PR: 7580
>   Submitted by: Taketo Kabe <[EMAIL PROTECTED]>
>   
>   Revision  ChangesPath
>   1.355 +5 -0  httpd-2.0/CHANGES
>   
>   Index: CHANGES
>   ===
>   RCS file: /home/cvs/httpd-2.0/CHANGES,v
>   retrieving revision 1.354
>   retrieving revision 1.355
>   diff -u -r1.354 -r1.355
>   --- CHANGES 2001/09/02 08:43:23 1.354
>   +++ CHANGES 2001/09/04 01:38:00 1.355
>   @@ -1,5 +1,10 @@
>Changes with Apache 2.0.26-dev
>
>   +  *) Back out the 1.45 change to util_script.c.  This change made
>   + us set the environment variable REQUEST_URI to the redirected
>   + URI, instead of the originally requested URI.
>   + [Taketo Kabe <[EMAIL PROTECTED]>]
>   +
>  *) Make mod_include do lazy evaluation of potentially expensive to
> compute variables.  [Brian Pane <[EMAIL PROTECTED]>]
>
>   
>   
>   
>   1.62  +29 -1 httpd-2.0/server/util_script.c
>   
>   Index: util_script.c
>   ===
>   RCS file: /home/cvs/httpd-2.0/server/util_script.c,v
>   retrieving revision 1.61
>   retrieving revision 1.62
>   diff -u -r1.61 -r1.62
>   --- util_script.c 2001/08/23 21:16:05 1.61
>   +++ util_script.c 2001/09/04 01:38:01 1.62
>   @@ -313,6 +313,34 @@
>return lu;
>}
>
>   +/* Obtain the Request-URI from the original request-line, returning
>   + * a new string from the request pool containing the URI or "".
>   + */
>   +static char *original_uri(request_rec *r)
>   +{
>   +char *first, *last;
>   +
>   +if (r->the_request == NULL) {
>   + return (char *) apr_pcalloc(r->pool, 1);
>   +}
>   +
>   +first = r->the_request; /* use the request-line */
>   +
>   +while (*first && !apr_isspace(*first)) {
>   + ++first; /* skip over the method */
>   +}
>   +while (apr_isspace(*first)) {
>   + ++first; /*   and the space(s)   */
>   +}
>   +
>   +last = first;
>   +while (*last && !apr_isspace(*last)) {
>   + ++last; /* end at next whitespace */
>   +}
>   +
>   +return apr_pstrndup(r->pool, first, last - first);
>   +}
>   +
>AP_DECLARE(void) ap_add_cgi_vars(request_rec *r)
>{
>apr_table_t *e = r->subprocess_env;
>   @@ -321,7 +349,7 @@
>apr_table_setn(e, "SERVER_PROTOCOL", r->protocol);
>apr_table_setn(e, "REQUEST_METHOD", r->method);
>apr_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
>   -apr_table_setn(e, "REQUEST_URI", r->unparsed_uri);
>   +apr_table_setn(e, "REQUEST_URI", original_uri(r)); 
>
>/* Note that the code below special-cases scripts run from includes,
> * because it "knows" that the sub_request has been hacked to have the
>   
>   
>   
>