Hi

A CGI bugfix for unconfigured vhosts.

- Lauri
>From 6722daf404f2dc87e92901c7c60b345fd7c81c3a Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <[email protected]>
Date: Fri, 24 Aug 2012 13:34:15 +0300
Subject: [PATCH] cgi: Don't check for vhosts if none are configured


Signed-off-by: Lauri Kasanen <[email protected]>
---
 plugins/cgi/cgi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/cgi/cgi.c b/plugins/cgi/cgi.c
index 2502489..4f082a3 100644
--- a/plugins/cgi/cgi.c
+++ b/plugins/cgi/cgi.c
@@ -42,7 +42,7 @@ struct cgi_vhost_t {
     regex_t match;
 };
 
-static struct cgi_vhost_t *cgi_vhosts;
+static struct cgi_vhost_t *cgi_vhosts = NULL;
 
 int swrite(const int fd, const void *buf, const size_t count)
 {
@@ -383,7 +383,7 @@ int _mkp_stage_30(struct plugin *plugin, struct 
client_session *cs,
     if (!sr->file_info.is_file || !sr->file_info.exec_access)
         return MK_PLUGIN_RET_NOT_ME;
 
-    if (regexec(&match_regex, url, 0, NULL, 0)) {
+    if (regexec(&match_regex, url, 0, NULL, 0) && cgi_vhosts) {
         // No global match; check for per-vhost
 
         unsigned int i;
-- 
1.7.2.1

_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to