Costin,

[EMAIL PROTECTED] wrote:
>
> That would be after all connectors have opened the ports, but before _any_
> user code gets executed ( including the context init which trigers loading
> of on-startup servlets ).

In Tomcat 4.x, the last port opened is in StandardServer.await() - this is the
shutdown port. The bad news is that all of the connectors are started before
this call. Hence, I suspect that there is, currently, a small window for user
code to get executed before the setuid would be called in StandardServer.await().

Looks like the Tomcat 4.x code in Catalina.start() will need to be reworked.
However, after a quick review of the code, I don't think it is that much work.
All of the connectors bind to their ports in their initialize() method and no
user code, AFAIK, is executed in this method. After all connectors are
intialized(), only then are the connectors started. So, I am thinking that all I
need to do is move the shutdown port binding out of StandardServer.await() and
into StandardServer.initialize(). Since StandardServer.initialize() invokes
initialize() on all of the connectors, I can put the setuid code at the end of
the StandardServer.initialize() method.

Of course, this is how I think it will work so I definitely need to try it out.
Maybe later this week I will have some time to try this out and make sure that
it actually works.

Thanks,

Patrick

-- 
_____________________________________________________________________
Patrick Luby                          Email: [EMAIL PROTECTED]
Sun Microsystems                              Phone: 408-276-7471
901 San Antonio Road, USCA14-303
Palo Alto, CA 94303-4900
_____________________________________________________________________

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to