On Tue, Aug 31, 2004 at 04:52:14PM +0300, Muli Ben-Yehuda wrote: > On Tue, Aug 31, 2004 at 04:33:40PM +0300, [EMAIL PROTECTED] wrote: > > > Muli - could you give a little more background on what are you trying to > > achieve? > > Make a process which is running with root capabilities appear in a > standard ps output as though it belongs to user 'foo'. I can't change > ps; I can't change the kernel. I can only use the standard POSIX > APIs. I do have root on the system.
Can you surreptitiously modify LD_PRELOAD for the user who'll be running ps/top (by modifying their startup files or whatever)? If you can, write a tiny library that redirects open() to itself and, in case a process is trying to open /proc/<your pid>/stat, writes out a similar file in a different private location, opens that instead, and returns the descriptor to the process. If your library is tiny enough and the argument check is the first thing its modified open() does, no one will notice the performance penalty. -- avva "There's nothing simply good, nor ill alone" -- John Donne ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
