From 939f6731ef3878dd818e810ef4eda1e9d867fc4e Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Sat, 14 Nov 2009 18:11:59 -0300 Subject: [PATCH] Fix directory validation after handler --- src/http.c | 8 ++++++-- src/plugin.c | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/http.c b/src/http.c index d01328d..7279623 100644 --- a/src/http.c +++ b/src/http.c @@ -218,8 +218,7 @@ int mk_http_init(struct client_request *cr, struct request *sr) } /* read permissions and check file */ - if(sr->file_info->read_access == MK_FILE_FALSE || - sr->file_info->is_directory == MK_FILE_TRUE){ + if(sr->file_info->read_access == MK_FILE_FALSE){ mk_request_error(M_CLIENT_FORBIDDEN, cr, sr, 1, sr->log); return -1; } @@ -236,6 +235,11 @@ int mk_http_init(struct client_request *cr, struct request *sr) return -1; } + if(sr->file_info->is_directory == MK_FILE_TRUE){ + mk_request_error(M_CLIENT_FORBIDDEN, cr, sr, 1, sr->log); + return -1; + } + /* FIXME: Move palm code to a plugin */ palm = mk_palm_check_request(cr, sr); if(palm) diff --git a/src/plugin.c b/src/plugin.c index 220f746..17bf7a1 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -233,8 +233,13 @@ int mk_plugin_stage_run(mk_plugin_stage_t stage, } else if(stage & MK_PLUGIN_STAGE_40){ p = config->plugins->stage_40; + printf("\np: %p", p); + fflush(stdout); + while(p){ ret = p->call_stage_40(cr, sr); + printf("\nrun!"); + fflush(stdout); if(ret == 0){ return 0; } -- 2.11.4.GIT