aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/io-reauthenticate.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-11-13 00:19:28 +0000
committerThomas Bushnell <thomas@gnu.org>1996-11-13 00:19:28 +0000
commite50352b16beed1f96343f780603b6dca1c9ada3a (patch)
tree7e01d93eb2cb0572194be4d3a5765b1502e8e5dc /libdiskfs/io-reauthenticate.c
parent4bfcb3e730972ec9da6d7c9ce9a768b7a4b9f164 (diff)
downloadhurd-e50352b16beed1f96343f780603b6dca1c9ada3a.tar.gz
hurd-e50352b16beed1f96343f780603b6dca1c9ada3a.tar.bz2
hurd-e50352b16beed1f96343f780603b6dca1c9ada3a.zip
Thu Nov 7 01:03:11 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* protid-rele.c (diskfs_protid_rele): Free CRED->user. Wed Nov 6 17:55:17 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * diskfs.h (diskfs_isuid, diskfs_groupmember, diskfs_isowner, diskfs_access, diskfs_checkdirmod): Delete functions. * fsys-getroot.c (diskfs_S_fsys_getroot): Replace PSEUDOCRED with a real iouser and specify that in the relevant calls. * io-restrict-auth.c (diskfs_S_io_restrict_auth): Reworked to use idvecs. * file-chmod.c (diskfs_S_file_chmod): diskfs_isuid -> idvec_contains. * file-chown.c (diskfs_S_file_chown): Likewise. * file-getcontrol.c (diskfs_S_file_getcontrol): Likewise. * file-chmod.c (diskfs_S_file_chmod): diskfs_groupmember -> idvec_contains. * file-chown.c (diskfs_S_file_chown): Likewise. * node-create.c (diskfs_create_node): Likewise. * dir-lookup.c (diskfs_S_dir_lookup): diskfs_isowner -> fshelp_isowner. * file-chflags.c (diskfs_S_file_chflags): Likewise. * file-chmod.c (diskfs_S_file_chmod): Likewise. * file-chown.c (diskfs_S_file_chown): Likewise. * file-get-transcntl.c (diskfs_S_file_get_translator_cntl): Likewise. * file-set-trans.c (diskfs_S_file_set_translator): Likewise. * file-utimes.c (diskfs_S_file_utimes): Likewise. * fsys-getroot.c (diskfs_S_fsys_getroot): Likewise. * lithp.h (dithkfth_ithowner): Deleted macro. (fthhelp_ithowner, uther): New macros. * file-chauthor.c (dithkfth_TH_file_chauthor): dthkfth_ithowner -> fthhelp_ithowner. * dir-lookup.c (diskfs_S_dir_lookup): diskfs_access -> fshelp_access. * dir-mkfile.c (diskfs_S_dir_mkfile): Likewise. * file-access.c (diskfs_S_file_check_access): Likewise. * file-exec.c (diskfs_S_file_exec): Likewise (in dead code). * fsys-getroot.c (diskfs_S_fsys_getroot): Likewise. * ifsock.c (diskfs_S_ifsock_getsockaddr): Likewise. * lookup.c (diskfs_lookup): Likewise. (diskfs_lookup): diskfs_checkdirmod -> fshelp_checkdirmod. * dir-lookup.c (diskfs_S_dir_lookup): New arg format for fshelp_fetch_root. * fsys-getroot.c (diskfs_S_fsys_getroot): Likewise. * diskfs.h, protid-make.c (diskfs_create_protid): Delete args `uids', `gids', `nuids', and `ngids'. Replace with new arg `user'. All callers changed. (diskfs_finish_protid): Likewise. * file-inv-trans.c (diskfs_S_file_invoke_translator): Use CRED->user instead of old fields. * io-restrict-auth.c (diskfs_S_io_restrict_auth): Likewise. * node-create.c (diskfs_create_node): Likewise. * file-exec.c (diskfs_S_file_exec): Likewise. Use idvec_merge instead of idvec_merge_ids, now that it's convenient. * io-reauthenticate.c (diskfs_S_io_reauthenticate): Use new iohelp_reauthenticate. Tue Nov 5 21:10:18 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * diskfs.h: Include <idvec.h>. (struct protid): Delete members `uids', `gids', `nuids' and `ngids'. New member `user'.
Diffstat (limited to 'libdiskfs/io-reauthenticate.c')
-rw-r--r--libdiskfs/io-reauthenticate.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/libdiskfs/io-reauthenticate.c b/libdiskfs/io-reauthenticate.c
index 9b065a3b..3fc780d2 100644
--- a/libdiskfs/io-reauthenticate.c
+++ b/libdiskfs/io-reauthenticate.c
@@ -24,21 +24,12 @@ diskfs_S_io_reauthenticate (struct protid *cred,
mach_port_t rend_port)
{
struct protid *newcred;
- 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 (cred == 0)
return EOPNOTSUPP;
- genuidlen = gengidlen = auxuidlen = auxgidlen = 20;
- gen_uids = gubuf;
- gen_gids = ggbuf;
- aux_uids = aubuf;
- aux_gids = agbuf;
-
/* This routine must carefully ignore EINTR because we
are a simpleroutine, so callers won't know to restart. */
@@ -56,40 +47,15 @@ diskfs_S_io_reauthenticate (struct protid *cred,
err = mach_port_insert_right (mach_task_self (), newright, newright,
MACH_MSG_TYPE_MAKE_SEND);
assert_perror (err);
- do
- err = auth_server_authenticate (diskfs_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_gids, &auxgidlen);
- while (err == EINTR);
+
+ diskfs_finish_protid (newcred, iohelp_reauth (diskfs_auth_server_port,
+ rend_port, newright, 1));
mach_port_deallocate (mach_task_self (), rend_port);
mach_port_deallocate (mach_task_self (), newright);
- if (err)
- diskfs_finish_protid (newcred, 0, 0, 0, 0);
- else
- diskfs_finish_protid (newcred, gen_uids, genuidlen, gen_gids, gengidlen);
mutex_unlock (&cred->po->np->lock);
ports_port_deref (newcred);
- if (gubuf != gen_uids)
- vm_deallocate (mach_task_self (), (u_int) gen_uids,
- genuidlen * sizeof (uid_t));
- if (ggbuf != gen_gids)
- vm_deallocate (mach_task_self (), (u_int) gen_gids,
- gengidlen * sizeof (uid_t));
- if (aubuf != aux_uids)
- vm_deallocate (mach_task_self (), (u_int) aux_uids,
- auxuidlen * sizeof (uid_t));
- if (agbuf != aux_gids)
- vm_deallocate (mach_task_self (), (u_int) aux_gids,
- auxgidlen * sizeof (uid_t));
-
return 0;
}