This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj crashes if a user-thread gives up its rights
- From: Jost Boekemeier <jost2345 at yahoo dot de>
- To: Cedric Berger <cedric at berger dot to>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 13 Dec 2004 15:07:20 +0100 (CET)
- Subject: Re: gcj crashes if a user-thread gives up its rights
> 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