summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-18 20:07:55 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-18 20:07:55 +0000
commit8e70335df10f114b9d377b12573710b7b685efdf (patch)
tree1bec2b847c4582189fd6e3ce0b31cc0a65405aa0
parentf5052ad7977e44a18fef640961e42fd80b4cb9c7 (diff)
Formerly io-restrict-auth.c.~3~
-rw-r--r--libtrivfs/io-restrict-auth.c13
1 files changed, 8 insertions, 5 deletions
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);