aboutsummaryrefslogtreecommitdiff
path: root/libnetfs/io-reauthenticate.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-11-18 23:51:17 +0000
committerThomas Bushnell <thomas@gnu.org>1996-11-18 23:51:17 +0000
commit1e156105080b6168f7fd22574dda6140dc5454de (patch)
tree3dfdcc6f84b81e2a983621d4fd2f696c62d11528 /libnetfs/io-reauthenticate.c
parentd79de6fd652140aa4d9a5fd9405466f8cc0d6386 (diff)
downloadhurd-1e156105080b6168f7fd22574dda6140dc5454de.tar.gz
hurd-1e156105080b6168f7fd22574dda6140dc5454de.tar.bz2
hurd-1e156105080b6168f7fd22574dda6140dc5454de.zip
Mon Nov 18 17:06:39 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* netfs.h (netfs_report_access): Return error_t. * file-check-access.c (netfs_S_file_check_access): Deal with errors from netfs_report_access. Sat Nov 16 17:17:50 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * io-restrict-auth.c (netfs_S_io_restrict_auth): Fix several typos. * fsys-getroot.c (netfs_S_fsys_getroot): iohelp_make_iouser -> iohelp_create_iouser. New arg syntax for fshelp_fetch_root. Fri Nov 15 13:39:03 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * netfs.h (struct protid): Replace member `credential' with `user' of new type. All uses of old `credential' member changed to use `user' member. Change all functions that used to take `struct netcred' args to take `struct iouser' args. All callers changed. (netfs_copy_credential, netfs_dropy_credential, netfs_make_credential): Delete functions. * dir-lookup.c (netfs_S_dir_lookup): netfs_copy_credential -> iohelp_dup_iouser. * dir-mkfile.c (netfs_S_dir_mkfile): Likewise. * file-exec.c (netfs_S_file_exec): Likewise. * io-duplicate.c (netfs_S_io_duplicate): Likewise. * release-protid.c (netfs_release_protid): netfs_drop_credential -> iohelp_free_iouser. * dir-lookup.c (netfs_S_dir_lookup): Omit uses of netfs_interpret_credential; do it with new structures. * file-exec.c (netfs_S_file_exec): Likewise. * file-getcontrol.c (netfs_S_file_getcontrol): Likewise. * file-set-translator.c (netfs_S_file_set_translator): Likewise; using fshelp_isowner for permission check. * io-restrict-auth.c (netfs_S_io_restrict_auth): Likewise; guts rewritten. * dir-lookup.c (netfs_S_dir_lookup): netfs_make_credential -> iohelp_make_iouser. * fsys-getroot.c (netfs_S_fsys_getroot): Likewise. * fsys-syncfs.c (netfs_S_fsys_syncfs): Likewise. * io-reauthenticate.c (netfs_S_io_reauthenticate): Use iohelp_reauth instead of doing it by hand.
Diffstat (limited to 'libnetfs/io-reauthenticate.c')
-rw-r--r--libnetfs/io-reauthenticate.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/libnetfs/io-reauthenticate.c b/libnetfs/io-reauthenticate.c
index dff3af8f..c88e773d 100644
--- a/libnetfs/io-reauthenticate.c
+++ b/libnetfs/io-reauthenticate.c
@@ -25,21 +25,12 @@ error_t
netfs_S_io_reauthenticate (struct protid *user, mach_port_t rend_port)
{
struct protid *newpi;
- uid_t gubuf[20], ggbuf[20], aubuf[20], agbuf[20];
- uid_t *gen_uids, *gen_gids, *aux_uids, *aux_gids;
- u_int genuidlen, gengidlen, auxuidlen, auxgidlen;
error_t err;
mach_port_t newright;
if (!user)
return EOPNOTSUPP;
- genuidlen = gengidlen = auxuidlen = auxgidlen = 20;
- gen_uids = gubuf;
- gen_gids = ggbuf;
- aux_uids = aubuf;
- aux_gids = agbuf;
-
mutex_lock (&user->po->np->lock);
newpi = netfs_make_protid (user->po, 0);
@@ -47,43 +38,17 @@ netfs_S_io_reauthenticate (struct protid *user, mach_port_t rend_port)
err = mach_port_insert_right (mach_task_self (), newright, newright,
MACH_MSG_TYPE_MAKE_SEND);
assert_perror (err);
- do
- err = auth_server_authenticate (netfs_auth_server_port,
- rend_port,
- MACH_MSG_TYPE_COPY_SEND,
- newright,
- MACH_MSG_TYPE_COPY_SEND,
- &gen_uids, &genuidlen,
- &aux_uids, &auxuidlen,
- &gen_gids, &gengidlen,
- &aux_uids, &auxuidlen);
- while (err == EINTR);
+
+ newpi->user = iohelp_reauth (netfs_auth_server_port, rend_port, newright, 1);
+
mach_port_deallocate (mach_task_self (), rend_port);
mach_port_deallocate (mach_task_self (), newright);
- if (err)
- newpi->credential = netfs_make_credential (0, 0, 0, 0);
- else
- newpi->credential = netfs_make_credential (gen_uids, genuidlen,
- gen_gids, gengidlen);
-
mach_port_move_member (mach_task_self (), newpi->pi.port_right,
netfs_port_bucket->portset);
mutex_unlock (&user->po->np->lock);
ports_port_deref (newpi);
- if (gen_uids != gubuf)
- vm_deallocate (mach_task_self (), (vm_address_t) gen_uids,
- genuidlen * sizeof (uid_t));
- if (aux_uids != aubuf)
- vm_deallocate (mach_task_self (), (vm_address_t) aux_uids,
- auxuidlen * sizeof (uid_t));
- if (gen_gids != ggbuf)
- vm_deallocate (mach_task_self (), (vm_address_t) gen_gids,
- gengidlen * sizeof (uid_t));
- if (aux_gids != agbuf)
- vm_deallocate (mach_task_self (), (vm_address_t) aux_gids,
- auxgidlen * sizeof (uid_t));
return 0;
}