This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
Re: Permission to task and proc
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: frysk <frysk at sourceware dot org>
- Date: Wed, 19 Jul 2006 10:10:41 -0500
- Subject: Re: Permission to task and proc
- References: <20060719051057.GD28727@GreenHouse.cn.ibm.com>
In "Create a Frysk session" when FryskSessionDruid start up, all the
processes in "Available Process Groups" box are owned by the currenty user,
and process owned by other users are not listed. I read
frysk-gui/frysk/gui/druid/CreateFryskSessionDruid.java, but still not
know how these processes filtered. Could anybody here clarify it for
me?
They basically use Proc.getUID() and Proc.getGID() and match it against
the current users.
Those apis are just a reflection of the /proc/$$/status UID and GID.
I wrote this, but as I have to read status which has some supplemental
information that stat does not, it was supposed to be a stop-gap
measure. I don't know of a syscall to do the same thing. :(
It's demand only read too (ie the status file only gets read on
getUID/getGID not on refresh, so one must be careful of that).
Regards
Phil