[EMAIL PROTECTED] wrote:
> On Wed, 5 Jun 2002, GOMEZ Henri wrote:
> 
> 
>>But I've got problem with putenv/getenv calls, which didn't 
>>appears to works (did there is a problem if we want to 
>>putenv() from inside a process ?).
> 
> 
> Yes, most of the times it is. I don't know exactly why, it may 
> depend on the VM ( because I got it to work with some VMs ).
> 
> Setting the env before starting the process seems the best solution.
> ( I suspect LD_LIBRARY_PATH is used by ld.so before the process
> starts, and changes are not picked up ).
> 
> Or it may be something else - but even if we get it to work on
> linux, there are many other platforms where it may brake.
> 
> 
>>>  void init() {
>>>    apr.setUser();
>>>  }
>>>}
>>>
>>>It's more flexible.
>>
>>Did you plan to add setUser calls ?
> 
> 
> 
> Eventually. I'm a bit tired right now, I spent 2 days building and 
> finding dependencies. If you have some time...
> 
> 
> 
>>>I think late - to make sure logs and other resources can be acquired ( 
>>>port 80, etc ).
>>
>>Hum, so jni/java could get root protected resources ?
>>I didn't understand well here, since jni/vm is launched by a child
>>and apache2 child are no more root, (only main process stay root) 
>>so they couldn't get access to resource (and that's why I've got
>>problem with shm access, which was created by the main process which
>>is root).
> 
> 
> That's a tricky one. Of course, the quick workaround is to change 
> permissions. I'm curious what would happen if we start the VM in _parent_,
> before forking. We can then get access to root-protected resources, fork,
> than hope it'll work.
> 
> I never tried fork from a JVM. Interesting...

I am afraid it will not work... The JVM is several threads, you are going to 
fork() in one thread.
Things like setid() setgid() are very tricky in some platfroms (Linux for 
example) because they apply only to the current thread not to whole process.

> 
> But except in-process, I think tomcat should first acquire the resources
> it needs and then call setUser().
> 
> 
> Costin
> 
> 




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

Reply via email to