You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Alexei Kosut <ak...@nueva.pvt.k12.ca.us> on 1995/12/20 03:42:58 UTC

mod_actions.c

Hi.

I've uploaded a new version of mod_actions into 
httpd/incoming/mod_actions.v2.c. This incorporates the changes people 
have sent me (many times over, some of them), namely:

* It doesn't strcmp to NULL. Don't know why I did that in the first place,
  but as has been pointed out, it's a Bad Idea.
* Retains the query string in QUERY_STRING
* Re-escapes the filename before internally redirecting it.

I'd appreciate it if folks could go over this one with a somewhat
fine-toothed comb, in case I missed anything. If it works, I'd like to see
it considered for inclusion in Apache 1.1b1 or whichever. I think it's
useful enough. (and it lets us have a feature that WebSTAR's had since its
introduction).

Thanks

--/ Alexei Kosut <ak...@nueva.pvt.k12.ca.us> /--------/ Lefler on IRC
----------------------------/ <http://www.nueva.pvt.k12.ca.us/~akosut/>
The viewpoints expressed above are entirely false, and in no way
represent Alexei Kosut nor any other person or entity. /--------------



Re: mod_actions.c

Posted by Matthew Gray <mk...@netgen.com>.
> > However, it does a table_get on the content type.  If the content-type 
> > is nothing (ie, the default_type), it's null until you get to 
> > send_http_header.  This means the server SEGV's trying to serve up any 
> > document which doesn't have an explicitly configured content-type.
> 
> Ack. Another one of the strcmp(NULL) problems. Actually, I believe the 
> cause is in table_get, not send_http_header, but yes, *sigh*.

Yes, the SEGV is in table_get.  I was meaning to say that content-type is 
null and isn't checked until send_http_header.... you know what I mean.

					...Mk

Re: mod_actions.c

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Fri, 5 Jan 1996, Matthew Gray wrote:

> However, it does a table_get on the content type.  If the content-type 
> is nothing (ie, the default_type), it's null until you get to 
> send_http_header.  This means the server SEGV's trying to serve up any 
> document which doesn't have an explicitly configured content-type.

Ack. Another one of the strcmp(NULL) problems. Actually, I believe the 
cause is in table_get, not send_http_header, but yes, *sigh*.

I've uploaded a fixed version as 73a.mod_actions.patch into
httpd/incoming. if someone could move it into patches/for_Apache_1.1b0,
and remove 73, that'd be great. 

--/ Alexei Kosut <ak...@nueva.pvt.k12.ca.us> /--------/ Lefler on IRC
----------------------------/ <http://www.nueva.pvt.k12.ca.us/~akosut/>
The viewpoints expressed above are entirely false, and in no way
represent Alexei Kosut nor any other person or entity. /--------------



Re: mod_actions.c

Posted by Matthew Gray <mk...@netgen.com>.
> I'd appreciate it if folks could go over this one with a somewhat
> fine-toothed comb, in case I missed anything. If it works, I'd like to see
> it considered for inclusion in Apache 1.1b1 or whichever. I think it's
> useful enough. (and it lets us have a feature that WebSTAR's had since its
> introduction).

Wonderful feature!  I was going to do this myself and was happy that I 
didn't have to!

However, it does a table_get on the content type.  If the content-type 
is nothing (ie, the default_type), it's null until you get to 
send_http_header.  This means the server SEGV's trying to serve up any 
document which doesn't have an explicitly configured content-type.

A patch follows.

						...Mk

*** mod_actions.c.old   Fri Jan  5 14:27:45 1996
--- mod_actions.c       Fri Jan  5 14:28:45 1996
***************
*** 119,127 ****
  
  int action_handler (request_rec *r)
  {
!     action_dir_config *conf =
!       (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
!     char *t = table_get(conf->action_types,  r->content_type);
  
      if (!t)
        return DECLINED;
--- 119,132 ----
  
  int action_handler (request_rec *r)
  {
!   action_dir_config *conf;
!   chat *t;
! 
!   conf =
!     (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
!   if(r->content_type == NULL)
!     return DECLINED;
!   t = table_get(conf->action_types,  r->content_type);
  
      if (!t)
        return DECLINED;