Skip to contentSkip to conversation

LinuxThreads, setuid - Is there user mode hook?

Question Alon Bar-Lev 1 participant 1 message Dec 22, 2005

lore
Share & tools
lore
#0 lore raw

Hello,

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.

I read about discussions regarding LinuxThreads and figured out that I need to sync the uid,gid by my-self... :(

Is there a way in user mode to know when the process is setuid (some kind of callback)?

The best solution is to set this callback in every thread, so that it will setuid also when the main setuided.

Of course I can spawn a threads that pools the id of the main process... But there must be a better way to do that.

Best Regards,
Alon Bar-Lev.