Permalink
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@2959 5dc97367-9…

…7f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent bb29719 commit 6b3a53016fe375c6ae5d2aa8d9812b8814634606 @alobbs alobbs committed Mar 10, 2009
Showing with 19 additions and 3 deletions.
  1. +3 −0 ChangeLog
  2. +11 −1 cherokee/handler_cgi_base.c
  3. +4 −1 cherokee/handler_fcgi.c
  4. +1 −1 qa/210-Userdir_ScriptName.py
View
3 ChangeLog
@@ -1,5 +1,8 @@
2009-03-10 Alvaro Lopez Ortega <alvaro@octality.com>
+ * cherokee/handler_cgi_base.c, qa/210-Userdir_ScriptName.py: Tries
+ to address: http://code.google.com/p/cherokee/issues/detail?id=377
+
* qa/210-Userdir_ScriptName.py, qa/Makefile.am: Adds a new QA test
in order to reproduce the bug report #377:
http://code.google.com/p/cherokee/issues/detail?id=377
View
12 cherokee/handler_cgi_base.c
@@ -626,6 +626,11 @@ cherokee_handler_cgi_base_build_envp (cherokee_handler_cgi_base_t *cgi, cherokee
* - If the SCGI is handling / it is ''
* - Otherwise, it is the web_directory.
*/
+ if (! cherokee_buffer_is_empty (&conn->userdir)) {
+ cherokee_buffer_add_str (&tmp, "/~");
+ cherokee_buffer_add_buffer (&tmp, &conn->userdir);
+ }
+
if (conn->web_directory.len > 1) {
cgi->add_env_pair (cgi, "SCRIPT_NAME", 11,
conn->web_directory.buf, conn->web_directory.len);
@@ -653,7 +658,12 @@ cherokee_handler_cgi_base_build_envp (cherokee_handler_cgi_base_t *cgi, cherokee
len = name->len;
}
}
-
+
+ if (! cherokee_buffer_is_empty (&conn->userdir)) {
+ cherokee_buffer_add_str (&tmp, "/~");
+ cherokee_buffer_add_buffer (&tmp, &conn->userdir);
+ }
+
if (conn->web_directory.len > 1) {
cherokee_buffer_add_buffer (&tmp, &conn->web_directory);
}
View
5 cherokee/handler_fcgi.c
@@ -418,7 +418,10 @@ add_extra_fcgi_env (cherokee_handler_fcgi_t *hdl, cuint_t *last_header_offset)
*/
*last_header_offset = hdl->write_buffer.len;
- set_env (cgi_base, "SCRIPT_FILENAME", cgi_base->executable.buf, cgi_base->executable.len);
+ set_env (cgi_base, "SCRIPT_FILENAME",
+ cgi_base->executable.buf,
+ cgi_base->executable.len);
+
TRACE (ENTRIES, "SCRIPT_FILENAME '%s'\n", cgi_base->executable.buf);
cherokee_buffer_mrproper (&buffer);
View
2 qa/210-Userdir_ScriptName.py
@@ -23,7 +23,7 @@
CGI_BASE = """#!/bin/sh
echo "Content-type: text/html"
echo ""
-echo "SCRIPT_NAME: -$SCRIPT_NAME-"
+echo "SCRIPT_NAME: -${SCRIPT_NAME}-"
"""
class Test (TestBase):

0 comments on commit 6b3a530

Please sign in to comment.