diff options
author | Miles Bader <miles@gnu.org> | 1996-05-15 03:09:12 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-05-15 03:09:12 +0000 |
commit | 26d6a1892e7e549d093a641bff5033a29f04bf22 (patch) | |
tree | 09f191edc46c44fa14e25d89a56b9040288aca24 /proc | |
parent | 01e95358480684ba2337ff63fef11ca82553bdbc (diff) |
(check_owner): New inline function.
Diffstat (limited to 'proc')
-rw-r--r-- | proc/proc.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/proc/proc.h b/proc/proc.h index b3fe7e8a..4114777b 100644 --- a/proc/proc.h +++ b/proc/proc.h @@ -208,8 +208,17 @@ void complete_exit (struct proc *); void initialize_version_info (void); void send_signal (mach_port_t, int, mach_port_t); - - - + +/* Returns true if PROC1 has `owner' privileges over PROC2 (and can thus get + its task port &c). If PROC2 has an owner, then PROC1 must have that uid; + otherwise, both must be in the same login collection. */ +extern inline int +check_owner (struct proc *proc1, struct proc *proc2) +{ + return + proc2->p_noowner + ? proc1->p_login == proc2->p_login + : check_uid (proc1, proc2->p_owner); +} #endif |