diff options
author | Roland McGrath <roland@gnu.org> | 2001-06-16 20:23:09 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-06-16 20:23:09 +0000 |
commit | 487bba2f0cd506b4a79e1d92184a5f80d827954f (patch) | |
tree | f26a7bc5548e27603cdd3a239fec26490b2f8b4a /libdiskfs/protid-make.c | |
parent | a2529808d1aaf878eb6fff54ab491bd3d47db894 (diff) |
2001-04-01 Neal H Walfield <neal@cs.uml.edu>
* dir-lookup.c (diskfs_S_dir_lookup): Use
iohelp_create_empty_iouser.
* fsys-getfile.c (diskfs_S_fsys_getfile): Use
iohelp_create_complex_iouser.
* io-reauthenticate.c (diskfs_S_io_reauthenticate): Use
new iohelp_reauth semantics.
* io-restrict-auth.c (diskfs_S_io_restrict_auth): Use
new iohelp_create_iouser semantics.
* protid-make.c (diskfs_finish_protid): Use
iohelp_create_simple_iouser and new iohelp_dup_iouse
semantics.
* trans-callback.c (_diskfs_translator_callback2_fn):
Use iohelp_create_simple_iouser.
Diffstat (limited to 'libdiskfs/protid-make.c')
-rw-r--r-- | libdiskfs/protid-make.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/libdiskfs/protid-make.c b/libdiskfs/protid-make.c index 8f45cfd5..9b78a37f 100644 --- a/libdiskfs/protid-make.c +++ b/libdiskfs/protid-make.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995, 1996 Free Software Foundation + Copyright (C) 1994,95,96,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 @@ -17,6 +17,7 @@ #include "priv.h" #include <string.h> +#include <assert.h> /* Build and return in CRED a protid which has no user identification, for peropen PO. The node PO->np must be locked. */ @@ -41,20 +42,17 @@ diskfs_start_protid (struct peropen *po, struct protid **cred) void diskfs_finish_protid (struct protid *cred, struct iouser *user) { + error_t err; + if (!user) - { - uid_t zero = 0; - /* Create one for root */ - user = iohelp_create_iouser (make_idvec (), make_idvec ()); - idvec_set_ids (user->uids, &zero, 1); - idvec_set_ids (user->gids, &zero, 1); - cred->user = user; - } + err = iohelp_create_simple_iouser (&cred->user, 0, 0); else - cred->user = iohelp_dup_iouser (user); + err = iohelp_dup_iouser (&cred->user, user); + assert_perror (err); - mach_port_move_member (mach_task_self (), cred->pi.port_right, - diskfs_port_bucket->portset); + err = mach_port_move_member (mach_task_self (), cred->pi.port_right, + diskfs_port_bucket->portset); + assert_perror (err); } /* Create and return a protid for an existing peropen PO in CRED for USER. |