From baf7e5c8ce176aead15c2559952d8bdf0da41ffd Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 10 Mar 2017 12:36:39 +0100 Subject: hurd: Use polymorphic port types to return some rights. Currently, the RPC definitions of two procedures of the process subsystem assume that the rights are created from a receive right. Similarly, 'proc_getmsgport' assumes that the right is to be copied. This needlessly limits the ability to relay the RPC in server code. This fixes this. The protocol is unchanged, only the generated server stubs assume an additional parameter for the type. * hurd/process.defs (proc_getmsgport): Make 'msgport' parameter polymorphic. (proc_task2proc): Make 'proc' parameter polymorphic. (proc_pid2proc): Likewise. * hurd/process_reply.defs (proc_getmsgport): Likewise. (proc_task2proc_reply): Likewise. (proc_pid2proc_reply): Likewise. * proc/info.c (S_proc_task2proc): Adapt server function. (S_proc_pid2proc): Likewise. * proc/msg.c (S_proc_getmsgport): Likewise. --- proc/msg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'proc/msg.c') diff --git a/proc/msg.c b/proc/msg.c index 1f132cd0..e145f6e6 100644 --- a/proc/msg.c +++ b/proc/msg.c @@ -126,7 +126,8 @@ S_proc_getmsgport (struct proc *callerp, mach_port_t reply_port, mach_msg_type_name_t reply_port_type, pid_t pid, - mach_port_t *msgport) + mach_port_t *msgport, + mach_msg_type_name_t *msgport_type) { int cancel; struct proc *p; @@ -156,7 +157,8 @@ restart: if (check_msgport_death (p)) goto restart; - + + *msgport_type = MACH_MSG_TYPE_COPY_SEND; *msgport = p->p_msgport; return 0; -- cgit v1.2.3