aboutsummaryrefslogtreecommitdiff
path: root/libtrivfs/fsys-getroot.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-11-13 00:25:08 +0000
committerThomas Bushnell <thomas@gnu.org>1996-11-13 00:25:08 +0000
commit5b0f97db93a76e2b6d99acb959071f60ca456d0c (patch)
treee3afaa02ddd81ed4e2ec8a5717f19b034453f83a /libtrivfs/fsys-getroot.c
parentae63ea3f8d3d677a5d47ca8d7cc46137e947030e (diff)
downloadhurd-5b0f97db93a76e2b6d99acb959071f60ca456d0c.tar.gz
hurd-5b0f97db93a76e2b6d99acb959071f60ca456d0c.tar.bz2
hurd-5b0f97db93a76e2b6d99acb959071f60ca456d0c.zip
Thu Nov 7 01:01:05 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* io-restrict-auth.c (trivfs_S_io_restrict_auth): Rewrite to use idvecs. Wed Nov 6 23:40:50 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * trivfs.h (struct trivfs_protid): Delete members `uids', `gids', `nuids', and `ngids'. Replace with `user'. (trivfs_check_open_hook): Delete args `uids', `nuids', `gids', `ngids'. Replace with new arg `user'. All callers changed. (trivfs_open): Likewise. * open.c (trivfs_open): Change to match new declaration. * trivfs.h (struct trivfs_protid): Delete members `uids', `gids', * io-reauthenticate.c (trivfs_S_io_reauthenticate): Use new iohelp_reauth call.
Diffstat (limited to 'libtrivfs/fsys-getroot.c')
-rw-r--r--libtrivfs/fsys-getroot.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c
index 9eca01f5..81b8c25e 100644
--- a/libtrivfs/fsys-getroot.c
+++ b/libtrivfs/fsys-getroot.c
@@ -43,6 +43,8 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
error_t err = 0;
mach_port_t new_realnode;
struct trivfs_protid *cred;
+ struct iouser *user;
+ struct idvec *uvec, *gvec;
if (!cntl)
return EOPNOTSUPP;
@@ -67,15 +69,23 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
!= (flags & (O_READ|O_WRITE|O_EXEC)))
err = EACCES;
+ uvec = make_idvec ();
+ gvec = make_idvec ();
+ idvec_set_ids (uvec, uids, nuids);
+ idvec_set_ids (gvec, gids, ngids);
+ user = iohelp_create_iouser (uvec, gvec);
+
if (!err && trivfs_check_open_hook)
- err = (*trivfs_check_open_hook) (cntl, uids, nuids, gids, ngids, flags);
+ err = (*trivfs_check_open_hook) (cntl, user, flags);
if (!err)
- err = trivfs_open (cntl, uids, nuids, gids, ngids, flags, new_realnode,
- &cred);
- if (err)
- mach_port_deallocate (mach_task_self (), new_realnode);
+ err = trivfs_open (cntl, user, flags, new_realnode, &cred);
- if (!err)
+ if (err)
+ {
+ mach_port_deallocate (mach_task_self (), new_realnode);
+ iohelp_free_iouser (user);
+ }
+ else
{
*do_retry = FS_RETRY_NORMAL;
*retry_name = '\0';