From 8e70335df10f114b9d377b12573710b7b685efdf Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 18 Feb 1994 20:07:55 +0000 Subject: Formerly io-restrict-auth.c.~3~ --- libtrivfs/io-restrict-auth.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libtrivfs/io-restrict-auth.c') diff --git a/libtrivfs/io-restrict-auth.c b/libtrivfs/io-restrict-auth.c index 7aa9dd55..e091a84a 100644 --- a/libtrivfs/io-restrict-auth.c +++ b/libtrivfs/io-restrict-auth.c @@ -29,16 +29,19 @@ trivfs_S_io_restrict_auth (struct protid *cred, uid_t *gids, u_int ngids) { struct protid *newcred; + int i; if (!cred) return EOPNOTSUPP; newcred = ports_allocate_port (sizeof (struct protid), PT_PROTID); - spin_lock (&trivfs_refcnt_lock); - newcred->po = cred->po; - newcred->po->refcnt++; - spin_unlock (&trivfs_refcnt_lock); - + newcred->isroot = 0; + if (cred->isroot) + { + for (i = 0; i < nuids; i++) + if (uids[i] == 0) + newcred->isroot = 1; + } io_restrict_auth (cred->realnode, &newcred->realnode, uids, nuids, gids, ngids); -- cgit v1.2.3