gcj crashes if a user-thread gives up its rights
Jost Boekemeier
jost2345@yahoo.de
Mon Dec 13 14:07:00 GMT 2004
> In java, this is usually do at the java level using
> a Security Manager.
A security manager does not change the uid, does it?
> 1) If you need superuser only to listen to port 80,
> you can open the socket
> before starting the VM
My application receives the credentials from the
kernel and then must switch to the uid/gid received
via struct ucred. This works quite well except in gcj
on Linux (with pthreads or with NPTL) because gcj
incorrectly assumes that all threads have the same
permission. At least on Linux with pthreads or NPTL
is is not the case (and I don't think this behaviour
will ever change).
A workaround would be to switch off threads on Linux
(use green threads), but this doesn't seem right.
Since gcj already catches the error, it should be easy
to use a different IPC mechanism when pthread_kill
fails, I guess a patch would consist of no more than a
few lines. I check this, if I have some time.
Jost
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
More information about the Java
mailing list