https://issues.apache.org/bugzilla/show_bug.cgi?id=44312

Konstantin Kolinko <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #4 from Konstantin Kolinko <[email protected]> ---
Reopening.

>From looking into this, I think messing up host and alias names can really be a
surprise for a sloppy admin.

In the Mapper class the hosts and aliases are in the same list. Duplicates are
silently prevented by Mapper.insertMap() with the "first come, first served"
behaviour. The results may be surprising.


I have a patch for this.

A test case:
Configure the following hosts in server.xml:

[[[
      <Host name="localhost"  appBase="webapps">
        <!-- Alias equal to the name of its own Host is OK. -->
        <Alias>localhost</Alias>
      </Host>
      <Host name="second"  appBase="secondwebapps">
        <Alias>localhost</Alias>
      </Host>
      <Host name="third"  appBase="thirdwebapps">
        <Alias>fourth</Alias>
      </Host>
      <Host name="fourth"  appBase="fourthwebapps">
        <Alias>localhost</Alias>
        <Alias>second</Alias>
      </Host>
]]]

There is also a bug in Mapper.removeHost(name):
If host with such name is not registered in the mapper, it results in NPE at 
"if (newHosts[i].object == host)" line.
(The find() method returns the closest match. To check that the correct item
was found, one has to compare names).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to