33 |
#include "proc.h" |
#include "proc.h" |
34 |
#include "process_S.h" |
#include "process_S.h" |
35 |
|
|
36 |
|
|
37 |
|
/* Returns true if PROC1 has `owner' privileges over PROC2 (and can thus get |
38 |
|
its task port &c). If PROC2 has an owner, then PROC1 must have that uid; |
39 |
|
otherwise, both must be in the same login collection. */ |
40 |
|
static inline int |
41 |
|
check_owner (struct proc *proc1, struct proc *proc2) |
42 |
|
{ |
43 |
|
return |
44 |
|
proc2->p_noowner |
45 |
|
? check_uid (proc1, 0) || proc1->p_login == proc2->p_login |
46 |
|
: check_uid (proc1, proc2->p_owner); |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
/* Implement S_proc_pid2task as described in <hurd/process.defs>. */ |
/* Implement S_proc_pid2task as described in <hurd/process.defs>. */ |
51 |
kern_return_t |
kern_return_t |
52 |
S_proc_pid2task (struct proc *callerp, |
S_proc_pid2task (struct proc *callerp, |
54 |
task_t *t) |
task_t *t) |
55 |
{ |
{ |
56 |
struct proc *p; |
struct proc *p; |
57 |
|
|
58 |
if (!callerp) |
if (!callerp) |
59 |
return EOPNOTSUPP; |
return EOPNOTSUPP; |
60 |
|
|