From 9f0d8221034bf8735919e7bd2c2e72e4db2947e2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 17 Jan 1995 23:13:07 +0000 Subject: (check_uid): Return true if P has root. --- proc/mgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'proc') diff --git a/proc/mgt.c b/proc/mgt.c index 9a3cec19..aea9b024 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -1,5 +1,5 @@ /* Process management - Copyright (C) 1992, 1993, 1994 Free Software Foundation + Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU Hurd. @@ -67,13 +67,13 @@ free_ids (struct ids *i) free (i); } -/* Tell if process P has uid UID. */ +/* Tell if process P has uid UID, or has root. */ int check_uid (struct proc *p, uid_t uid) { int i; for (i = 0; i < p->p_id->i_nuids; i++) - if (p->p_id->i_uids[i] == uid) + if (p->p_id->i_uids[i] == uid || p->p_id\->i_uids[i] == 0) return 1; return 0; } -- cgit v1.2.3