Re: [Question] LinuxThreads, setuid - Is there user mode hook?

From: Alon Bar-Lev
Date: Fri Dec 23 2005 - 04:53:14 EST


David Wagner wrote:
In article <43AACA82.5050305@xxxxxxxxx> you write:

I am writing a provider that uses pthreads. The main program does not aware that the provider is using threads and it is not multithreaded.

After initialization the program setuid to nobody, the problem is that my threads remains in root id.


Mixing threads and setuid programs seems like a really bad idea.
This is especially true if you have to ask about it -- which means
that you don't know enough to write such a program safely (please
don't take offense).


I know that!
And I am aware of the (Linux implementation) implications...

I don't think you read my question in deep...
I offer a provider (Shared library), and I must deal with this edge condition where the main program setuid.

In Linux every thread is a process so only the main thread is setuided.

I need to catch this even in my shared library and setuid my threads as well, since Linux pthreads implementation does not take care of this.

Since I am not writing the main program and since I cannot force the main programmer to behave any differently, I must handle this internally.

Do you know a way to be notified when the process setuid?

Best Regards,
Alon Bar-Lev.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/