Project

General

Profile

Actions

Bug #2216

closed

mod_userdir doesn't set environment variable DOCUMENT_ROOT

Added by DanielRichman almost 15 years ago. Updated about 11 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_userdir
Target version:
ASK QUESTIONS IN Forums:

Description

1) Fresh install of lighttpd + mod_userdir enabled (tested on Ubuntu 10.04)
2) in a test php file

sudo aptitude install lighttpd && sudo lighty-enable-mod userdir cgi &&
mkdir ~/public_html && echo '<?php phpinfo(); ?>' >> ~/public_html/index.php &&
x-www-browser http://localhost/~`id -un`

Look for the 'Environment section' - DOCUMENT_ROOT. Provided I haven't gone mad, you'll notice that it's /var/www/ rather than /home/username/public_html/ .

This seems to fix it, though I don't know enough about lighty's source to know if it is the correct fix:

--- lighttpd-1.4.26.orig/src/mod_userdir.c
+++ lighttpd-1.4.26/src/mod_userdir.c
@@ -302,6 +302,7 @@
         * TODO: what to do with trailing dots in usernames on windows? they may result in the same directory
         *       as a username without them.
         */
+       buffer_copy_string_buffer(con->physical.doc_root, p->temp_path);
        if (NULL != (rel_url = strchr(con->physical.rel_path->ptr + 2, '/'))) {
                buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
        }

Files

mod_userdir.c (8.47 KB) mod_userdir.c DanielRichman, 2010-05-31 20:56
#3

Updated by stbuehler over 14 years ago

  • Status changed from Patch Pending to Invalid
  • Target version deleted (1.4.x)
  • Missing in 1.5.x changed from Yes to No
#5

Updated by stbuehler over 14 years ago

  • Status changed from Invalid to Reopened
  • Target version set to 1.4.29
#6

Updated by stbuehler almost 14 years ago

  • Status changed from Reopened to Fixed
Actions

Also available in: Atom