summaryrefslogtreecommitdiff
path: root/proc/mgt.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-01-17 23:13:07 +0000
committerRoland McGrath <roland@gnu.org>1995-01-17 23:13:07 +0000
commit9f0d8221034bf8735919e7bd2c2e72e4db2947e2 (patch)
tree56191d69e1c690587ce28c58d02baa0dafe47df8 /proc/mgt.c
parentfc141a5a811fd191dfa25409256ac3910ad1b340 (diff)
(check_uid): Return true if P has root.
Diffstat (limited to 'proc/mgt.c')
-rw-r--r--proc/mgt.c6
1 files changed, 3 insertions, 3 deletions
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;
}