diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2000-10-16 23:21:59 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2000-10-16 23:21:59 +0000 |
commit | 1a2e8187b2eb660c984a2258104199be2beab5c1 (patch) | |
tree | 8e5697d9b71aa6aaed25968221dcf940875005af /usr.sbin | |
parent | 741c74fcfe3370f99090621e4fca0a4a87eb8feb (diff) |
fix from 1.3.14 for mod_vhost_alias to ensure cgi script contents are not sent
out by the server
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/httpd/src/modules/standard/mod_vhost_alias.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/usr.sbin/httpd/src/modules/standard/mod_vhost_alias.c b/usr.sbin/httpd/src/modules/standard/mod_vhost_alias.c index 65cc5a2ef41..4b5631e8930 100644 --- a/usr.sbin/httpd/src/modules/standard/mod_vhost_alias.c +++ b/usr.sbin/httpd/src/modules/standard/mod_vhost_alias.c @@ -412,25 +412,23 @@ static int mva_translate(request_rec *r) mva_sconf_t *conf; const char *name, *map, *uri; mva_mode_e mode; - int cgi; + const char *cgi; conf = (mva_sconf_t *) ap_get_module_config(r->server->module_config, &vhost_alias_module); - if (!strncmp(r->uri, "/cgi-bin/", 9)) { + cgi = strstr(r->uri, "cgi-bin/"); + if (cgi && cgi - r->uri != strspn(r->uri, "/")) { + cgi = NULL; + } + if (cgi) { mode = conf->cgi_root_mode; map = conf->cgi_root; - uri = r->uri + 8; - /* - * can't force cgi immediately because we might not handle this - * call if the mode is wrong - */ - cgi = 1; + uri = cgi + strlen("cgi-bin"); } else if (r->uri[0] == '/') { mode = conf->doc_root_mode; map = conf->doc_root; uri = r->uri; - cgi = 0; } else { return DECLINED; |