diff options
author | Roland McGrath <roland@gnu.org> | 2001-06-16 20:22:14 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-06-16 20:22:14 +0000 |
commit | a2529808d1aaf878eb6fff54ab491bd3d47db894 (patch) | |
tree | 426a3711fbb7be96251412ca626976c1246439a8 /libiohelp/iouser-reauth.c | |
parent | 93054f14cb52bfd576e4ecfdcf0bc1c468e4cbbf (diff) | |
download | hurd-a2529808d1aaf878eb6fff54ab491bd3d47db894.tar.gz hurd-a2529808d1aaf878eb6fff54ab491bd3d47db894.tar.bz2 hurd-a2529808d1aaf878eb6fff54ab491bd3d47db894.zip |
2001-04-21 Neal H Walfield <neal@cs.uml.edu>
* iohelp.h (iohelp_create_iouser): Change declaration
such that as error_t is now returned and the iouser is
a parameter.
(iohelp_create_empty_iouser): New funtion.
(iohelp_create_simple_iouser): New function.
(iohelp_create_complex_iouser): New funtion.
* iouser-create.c (iohelp_create_iouser): Implement new
semantics.
(iohelp_create_empty_iouser): Implement new function.
(iohelp_create_simple_iouser): Implement new function.
(iohelp_create_complex_iouser): Implement new function.
* iouser-dup.c (iohelp_dup_iouser): Implement new semantics.
* iouser-reauth.c (iohelp_reauth): Implement new semantics.
Diffstat (limited to 'libiohelp/iouser-reauth.c')
-rw-r--r-- | libiohelp/iouser-reauth.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libiohelp/iouser-reauth.c b/libiohelp/iouser-reauth.c index 3514b5d8..2139bcc6 100644 --- a/libiohelp/iouser-reauth.c +++ b/libiohelp/iouser-reauth.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1996, 1999 Free Software Foundation + Copyright (C) 1996,99,2001 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -26,8 +26,9 @@ PERMIT_FAILURE is nonzero, then should the transaction fail, return an iouser that has no ids. The new port to be sent to the user is newright. */ -struct iouser *iohelp_reauth (auth_t authserver, mach_port_t rend_port, - mach_port_t newright, int permit_failure) +error_t iohelp_reauth (struct iouser **user, + auth_t authserver, mach_port_t rend_port, + mach_port_t newright, int permit_failure) { uid_t gubuf[20], ggbuf[20], aubuf[20], agbuf[20]; uid_t *gen_uids, *gen_gids, *aux_uids, *aux_gids; @@ -35,9 +36,9 @@ struct iouser *iohelp_reauth (auth_t authserver, mach_port_t rend_port, error_t err; struct iouser *new; - new = malloc (sizeof (struct iouser)); + *user = new = malloc (sizeof (struct iouser)); if (!new) - return 0; + return ENOMEM; new->uids = make_idvec (); new->gids = make_idvec (); @@ -48,7 +49,7 @@ struct iouser *iohelp_reauth (auth_t authserver, mach_port_t rend_port, if (new->gids) idvec_free (new->gids); free (new); - return 0; + return ENOMEM; } genuidlen = gengidlen = auxuidlen = auxgidlen = 20; @@ -96,7 +97,10 @@ struct iouser *iohelp_reauth (auth_t authserver, mach_port_t rend_port, idvec_free (new->uids); idvec_free (new->gids); free (new); - return 0; + *user = 0; + return err; } - return new; + + *user = new; + return 0; } |