Forum OpenACS Development: Major error in packages/acs-tcl/tcl/request-processor-procs.tcl:1507 (host-node maps)

The is a major error for host-node-mapped virtual-hosts in OpenACS 5.8.0. Because of a typo on line 1507 of packages/acs-tcl/tcl/request-processor-procs.tcl, the request processor's rp_filter proc is looking up names like ::acs::root_of_host(www.openacs.org)' in the host_node_map table instead of 'www.openacs.org'.

The line currently reads:

set $key [root_of_host1 $key]

… when it should read:

set $key [root_of_host1 $host]

Here is the whole proc for context:

ad_proc root_of_host {host} {
    Maps a hostname to the corresponding sub-directory.
} {
    set key ::acs::root_of_host($host)
    if {[info exists $key]} {return [set $key]}
    set $key [root_of_host1 $key]
}

You are right, this is (was) a bug showing up for sites for host-node maps, the broken implementation returns always an empty string.

So far, there are no tests in the regression tests suite that test configurations with host-node maps, so automated testing does not reveal this problem. Aside of the fact that there are some problems with the current design (see e.g. [1]), the situation gets more complicated, since NaviServer provides superior native support via multiple servers (one nsd process hosting different http servers) and virtual hosting (same server with different configurations (e.g. root directories) depending on the "host" request header field), while AOLserver does not support this (openacs.org uses this for hosting dotlrn.org). So, more work is required in this regard.

Anyhow, you showed a clear bug, this is fixed now in the oacs-5-8 branch. Many thanks for reporting.

-g

[1] https://openacs.org/forums/message-view?message_id=1529065