Bug 59962

Summary: Tux module does not work as documented for mass hosting
Product: [Retired] Red Hat Linux Reporter: whn
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: mingo, whn
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-18 11:28:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description whn 2002-02-16 01:17:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.9-21 i686; Nav)

Description of problem:
In kernel-2.4.9-21, the tux module behavior does not match what the
documentation in tux-2.2.0-1 says the behavior for mass_hosting_hash
is documented to do (or on 
http://www.redhat.com/docs/manuals/tux/TUX-2.1-Manual/virtual-hosting.html). 
The documentation says:

 If the value is set to 0, mass_hosting_hash is disabled. 

 If the value is set to 1: 
http://www.some.site.com/a.html => docroot/s/some.site.com/a.html

 If the value is set to 2: 
http://www.some.site.com/a.html => docroot/s/so/some.site.com/a.html

 If the value is set to 3: 
http://www.some.site.com/a.html => docroot/s/so/som/some.site.com/a.html

The reality (both according to the source code and experimentation is:
0 disable mass hosting
1 maps to docroot/s/so/some.site.com/a.html
2 maps to docroot/s/so/som/some.site.com/a.html
3 maps to docroot/some.site.com/a.html

Please fix the source code and keep the functionality described by the
documentation.  Please see patch included in this bug report.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Setup tux with:
   echo 1 > /proc/sys/net/tux/virtual_server
   echo 1 > /proc/sys/net/tux/mass_hosting_hash
   Create a directory tree with all the various designs and try it out.
2. Read /usr/src/linux-2.4.9-21/net/tux/proto_http.c lines 1429 - 1461
3.
	

Additional info:

Here is a fix:

--- net/tux/proto_http.c.orig   Fri Feb 15 20:01:54 2002
+++ net/tux/proto_http.c        Fri Feb 15 20:03:02 2002
@@ -1431,6 +1431,15 @@
                case 0:
                        return req->host;
                case 1:
+                       // www.ABCDEFG.com => A/ABCDEFG.com
+
+                       tmp[0] = req->host[0];
+                       tmp[1] = '/';
+                       memcpy(tmp + 2, req->host, req->host_len);
+                       tmp[req->host_len + 2] = 0;
+
+                       return tmp;
+               case 2:
                        // www.ABCDEFG.com => A/AB/ABCDEFG.com

                        tmp[0] = req->host[0];
@@ -1442,7 +1451,7 @@
                        tmp[req->host_len + 5] = 0;

                        return tmp;
-               case 2:
+               case 3:
                        // www.ABCDEFG.com => A/AB/ABC/ABCDEFG.com

                        tmp[0] = req->host[0];

Comment 1 Ingo Molnar 2003-02-18 11:28:08 UTC
oops - this patch fell through the cracks. Patch applied.