diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-05-24 22:00:50 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-05-24 22:00:50 +0000 |
commit | 8440e7dd0e8c05d860f37a92ce10d0c2607af40d (patch) | |
tree | 132c9e915fe92320e644ca6f974adc46320c38ad | |
parent | 3b2f1f531ed89722215e47adcfd19873daafd587 (diff) |
Formerly io-reauthenticate.c.~4~
-rw-r--r-- | libtrivfs/io-reauthenticate.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libtrivfs/io-reauthenticate.c b/libtrivfs/io-reauthenticate.c index 2818662b..4f4d3c3d 100644 --- a/libtrivfs/io-reauthenticate.c +++ b/libtrivfs/io-reauthenticate.c @@ -19,11 +19,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Written by Michael I. Bushnell. */ -error_t -trivfs_S_io_reauthenticate (struct protid *cred, +#include "priv.h" +#include "io_S.h" +#include <assert.h> + +kern_return_t +trivfs_S_io_reauthenticate (struct trivfs_protid *cred, int rendint) { - struct protid *newcred; + struct trivfs_protid *newcred; uid_t *gen_uids = alloca (sizeof (uid_t) * 20); uid_t *gen_gids = alloca (sizeof (uid_t) * 20); uid_t *aux_uids = alloca (sizeof (uid_t) * 20); @@ -32,6 +36,7 @@ trivfs_S_io_reauthenticate (struct protid *cred, uid_t *gubuf, *ggbuf, *aubuf, *agbuf; error_t err; int i; + auth_t auth; if (cred == 0) return EOPNOTSUPP; @@ -40,12 +45,13 @@ trivfs_S_io_reauthenticate (struct protid *cred, gubuf = gen_uids; ggbuf = gen_gids; aubuf = aux_uids; agbuf = aux_gids; - newcred = ports_allocate_port (sizeof (struct protid), + newcred = ports_allocate_port (sizeof (struct trivfs_protid), trivfs_protid_porttype); - err = auth_server_authenticate (diskfs_auth_server_port, + auth = getauth (); + err = auth_server_authenticate (auth, ports_get_right (cred), MACH_MSG_TYPE_MAKE_SEND, - rend_int, + rendint, ports_get_right (newcred), MACH_MSG_TYPE_MAKE_SEND, &gen_uids, &genuidlen, @@ -53,6 +59,7 @@ trivfs_S_io_reauthenticate (struct protid *cred, &gen_gids, &gengidlen, &aux_gids, &auxgidlen); assert (!err); /* XXX */ + mach_port_deallocate (mach_task_self (), auth); newcred->isroot = 0; for (i = 0; i < genuidlen; i++) |