Re: looking for the solution of rootless subhurd

2009-01-24 Thread olafBuddenhagen
Hi, On Sat, Jan 17, 2009 at 01:38:11AM +, Zheng Da wrote: > On Thu, Jan 15, 2009 at 11:03 AM, wrote: > > Indeed, while the primary goal is running subhurd as normal user, it > > is evidently a desirable variation to have a completely isolated > > subhurd. [...] > I don't really accept this o

Re: looking for the solution of rootless subhurd

2009-01-16 Thread Zheng Da
Hi, On Thu, Jan 15, 2009 at 11:03 AM, wrote: > Hi, > > On Sat, Jan 10, 2009 at 08:29:02PM +, Da Zheng wrote: > > > I just found that there are two RPCs that can change the kernel ports > > of tasks and threads: thread_set_kernel_port and > > task_set_kernel_port. Mach does provide an easy w

Re: looking for the solution of rootless subhurd

2009-01-16 Thread olafBuddenhagen
Hi, On Sat, Jan 10, 2009 at 08:29:02PM +, Da Zheng wrote: > I just found that there are two RPCs that can change the kernel ports > of tasks and threads: thread_set_kernel_port and > task_set_kernel_port. Mach does provide an easy way to override these > two ports:-) That's great news :-)

Re: looking for the solution of rootless subhurd

2009-01-10 Thread Da Zheng
olafbuddenha...@gmx.net wrote: However, I browsed the Mach documentation a bit, and found task_set_emulation(). It is not documented properly, so I don't know what it can do exactly -- whether it's for UNIX system call emulation, or Mach trap emulation, or both... It *might* be a way to provide p

Re: looking for the solution of rootless subhurd

2009-01-10 Thread Da Zheng
olafbuddenha...@gmx.net wrote: One way I think of is to use a different RPC. Suppose it is called mach_task_to_subhurd_task(mach_port_t subhurd_port, task_t task). Therefore, the task in subhurd gets its task port with mach_task_self() and translate it to subhurd task port with this RPC.

Re: looking for the solution of rootless subhurd

2009-01-09 Thread olafBuddenhagen
Hi, On Sun, Jan 04, 2009 at 07:20:17PM +, Da Zheng wrote: > Zheng Da wrote: >> I just found there is the RPC proc_getallpids, so I can get all >> processes in the main hurd and then use pid2task to get their task >> port. I also found that pid2task only works for the tasks that belong >> to t

Re: looking for the solution of rootless subhurd

2009-01-09 Thread olafBuddenhagen
Hi, On Thu, Jan 01, 2009 at 09:11:16PM +, Zheng Da wrote: > On Mon, Dec 22, 2008 at 10:04 AM, wrote: > > Note that the implementation of the pseudo master host port does not > > need to forward the RPCs directly to Mach. (In fact, it can't even > > do that, as it lacks the necessary privileg

Re: looking for the solution of rootless subhurd

2009-01-04 Thread Da Zheng
Zheng Da wrote: On Mon, Dec 22, 2008 at 10:04 AM, > wrote: > The point here is that the process server needs to get all tasks in > the host, Yes, obviously it needs to. I understand your concern now, but I still don't see an actual problem...

Re: looking for the solution of rootless subhurd

2009-01-01 Thread Zheng Da
On Mon, Dec 22, 2008 at 10:04 AM, wrote: > > > > The point here is that the process server needs to get all tasks in > > the host, > > Yes, obviously it needs to. I understand your concern now, but I still > don't see an actual problem... The first problem is how to get the all of these task por

Re: looking for the solution of rootless subhurd

2008-12-22 Thread olafBuddenhagen
Hi, On Sat, Dec 13, 2008 at 03:55:26PM +, Da Zheng wrote: > olafbuddenha...@gmx.net wrote: >> On Tue, Dec 09, 2008 at 12:30:08AM +, Da Zheng wrote: >>> The function add_tasks (proc/mgt.c) gets all tasks in the host by >>> calling host_processor_sets(), host_processor_set_priv() and >>> pr

Re: looking for the solution of rootless subhurd

2008-12-13 Thread Da Zheng
olafbuddenha...@gmx.net wrote: Hi, On Tue, Dec 09, 2008 at 12:30:08AM +, Da Zheng wrote: The function add_tasks (proc/mgt.c) gets all tasks in the host by calling host_processor_sets(), host_processor_set_priv() and processor_set_tasks() because the process server needs to check if the

Re: looking for the solution of rootless subhurd

2008-12-13 Thread olafBuddenhagen
Hi, On Tue, Dec 09, 2008 at 12:30:08AM +, Da Zheng wrote: > The function add_tasks (proc/mgt.c) gets all tasks in the host by > calling host_processor_sets(), host_processor_set_priv() and > processor_set_tasks() because the process server needs to check if the > port is a task port or not.

Re: looking for the solution of rootless subhurd

2008-12-08 Thread Da Zheng
Hello everyone, Da Zheng wrote: Hello everyone, I am trying to make subhurd run without root's permission. AFAIK, the reason that subhurd needs the root's permission is that the subhurd needs the master device port and privileged host port, and the current implementation gets the real ones fr

looking for the solution of rootless subhurd

2008-11-23 Thread Da Zheng
Hello everyone, I am trying to make subhurd run without root's permission. AFAIK, the reason that subhurd needs the root's permission is that the subhurd needs the master device port and privileged host port, and the current implementation gets the real ones from mach. It's relatively easy to h