summaryrefslogtreecommitdiff
path: root/libtrivfs/fsys-getroot.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-05-10 19:38:55 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-05-10 19:38:55 +0000
commita4ce9b138126bb214168ee5956993c5d30455135 (patch)
treed13aeeacd7da5e89505abc7968b7fa53458c66f3 /libtrivfs/fsys-getroot.c
parentf814ab95ea7835ae695378c6bb1feeec5116aec0 (diff)
Formerly fsys-getroot.c.~3~
Diffstat (limited to 'libtrivfs/fsys-getroot.c')
-rw-r--r--libtrivfs/fsys-getroot.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c
index 52089ac4..9812ba96 100644
--- a/libtrivfs/fsys-getroot.c
+++ b/libtrivfs/fsys-getroot.c
@@ -31,10 +31,10 @@ trivfs_S_fsys_getroot (mach_port_t fsys,
{
struct protid *cred;
int i;
- struct port_info *pi;
+ struct control *cntl;
- pi = ports_get_port (fsys, PT_CTL);
- if (!pi)
+ cntl = ports_check_port_type (fsys, trivfs_cntl_porttype);
+ if (!cntl)
return EOPNOTSUPP;
assert (!trivfs_support_read && !trivfs_support_write
@@ -42,20 +42,22 @@ trivfs_S_fsys_getroot (mach_port_t fsys,
if (flags & (O_READ|O_WRITE|O_EXEC))
{
- ports_done_with_port (pi);
+ ports_done_with_port (cntl);
return EACCES;
}
- cred = ports_allocate_port (sizeof (struct protid), PT_PROTID);
+ cred = ports_allocate_port (sizeof (struct protid), trivfs_protid_porttype);
cred->isroot = 0;
for (i = 0; i < nuids; i++)
if (uids[i] == 0)
cred->isroot = 1;
- io_restrict_auth (trivfs_underlying_node, &cred->realnod,
+ cred->cntl = cntl;
+ ports_port_ref (cntl);
+ io_restrict_auth (cred->cntl->underlying, &cred->realnode,
uids, nuids, gids, ngids);
*newpt = ports_get_right (cred);
*newpttype = MACH_MSG_TYPE_MAKE_SEND;
- ports_done_with_port (pi);
+ ports_done_with_port (cntl);
return 0;
}