diff options
author | Justus Winter <justus@gnupg.org> | 2017-03-10 12:36:39 +0100 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-03-10 15:46:59 +0100 |
commit | baf7e5c8ce176aead15c2559952d8bdf0da41ffd (patch) | |
tree | 43161242fdcab242042d56e0e6d4ad61227a2ded /proc/info.c | |
parent | 150ff2ad69344d8555c14b42b2658313f16e9d1e (diff) | |
download | hurd-baf7e5c8ce176aead15c2559952d8bdf0da41ffd.tar.gz hurd-baf7e5c8ce176aead15c2559952d8bdf0da41ffd.tar.bz2 hurd-baf7e5c8ce176aead15c2559952d8bdf0da41ffd.zip |
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.
Diffstat (limited to 'proc/info.c')
-rw-r--r-- | proc/info.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/proc/info.c b/proc/info.c index 0f5ca0f8..97321408 100644 --- a/proc/info.c +++ b/proc/info.c @@ -99,7 +99,8 @@ S_proc_task2pid (struct proc *callerp, kern_return_t S_proc_task2proc (struct proc *callerp, task_t t, - mach_port_t *outproc) + mach_port_t *outproc, + mach_msg_type_name_t *outproc_type) { struct proc *p = task_find (t); @@ -109,6 +110,7 @@ S_proc_task2proc (struct proc *callerp, return ESRCH; *outproc = ports_get_right (p); + *outproc_type = MACH_MSG_TYPE_MAKE_SEND; mach_port_deallocate (mach_task_self (), t); return 0; } @@ -128,7 +130,8 @@ S_proc_proc2task (struct proc *p, kern_return_t S_proc_pid2proc (struct proc *callerp, pid_t pid, - mach_port_t *outproc) + mach_port_t *outproc, + mach_msg_type_name_t *outproc_type) { struct proc *p; @@ -149,6 +152,7 @@ S_proc_pid2proc (struct proc *callerp, return EPERM; *outproc = ports_get_right (p); + *outproc_type = MACH_MSG_TYPE_MAKE_SEND; return 0; } |